[svn:parrot] r46358 - in branches/codestring: . config/auto/zlib config/gen/makefiles include/parrot ports/fedora/2.3.0 ports/suse/2.2.0 runtime/parrot/library runtime/parrot/library/Archive src/dynpmc src/gc src/interp src/pmc src/runcore src/string t/distro t/dynpmc t/library t/native_pbc t/pmc t/src tools/dev

coke at svn.parrot.org coke at svn.parrot.org
Thu May 6 14:34:35 UTC 2010


Author: coke
Date: Thu May  6 14:34:34 2010
New Revision: 46358
URL: https://trac.parrot.org/parrot/changeset/46358

Log:
merge latest from trunk

Added:
   branches/codestring/runtime/parrot/library/Archive/Zip.pir
      - copied unchanged from r46357, trunk/runtime/parrot/library/Archive/Zip.pir
   branches/codestring/src/pmc/stringbuilder.pmc
      - copied unchanged from r46357, trunk/src/pmc/stringbuilder.pmc
   branches/codestring/t/distro/manifest_generated.t
      - copied unchanged from r46357, trunk/t/distro/manifest_generated.t
   branches/codestring/t/library/archive_zip.t
      - copied unchanged from r46357, trunk/t/library/archive_zip.t
   branches/codestring/t/pmc/stringbuilder.t
      - copied unchanged from r46357, trunk/t/pmc/stringbuilder.t
Modified:
   branches/codestring/   (props changed)
   branches/codestring/MANIFEST
   branches/codestring/MANIFEST.generated
   branches/codestring/PBC_COMPAT
   branches/codestring/config/auto/zlib/   (props changed)
   branches/codestring/config/gen/makefiles/root.in
   branches/codestring/include/parrot/runcore_trace.h   (props changed)
   branches/codestring/include/parrot/string_funcs.h
   branches/codestring/ports/fedora/2.3.0/   (props changed)
   branches/codestring/ports/suse/2.2.0/   (props changed)
   branches/codestring/runtime/parrot/library/distutils.pir
   branches/codestring/src/dynpmc/gziphandle.pmc
   branches/codestring/src/gc/gc_ms.c
   branches/codestring/src/interp/inter_create.c   (props changed)
   branches/codestring/src/runcore/cores.c   (props changed)
   branches/codestring/src/runcore/trace.c   (props changed)
   branches/codestring/src/string/api.c
   branches/codestring/t/dynpmc/gziphandle.t
   branches/codestring/t/native_pbc/annotations.pbc
   branches/codestring/t/native_pbc/integer_1.pbc
   branches/codestring/t/native_pbc/number_1.pbc
   branches/codestring/t/native_pbc/string_1.pbc
   branches/codestring/t/src/embed.t   (props changed)
   branches/codestring/tools/dev/mk_gitignore.pl   (props changed)
   branches/codestring/tools/dev/pbc_to_exe.pir

Modified: branches/codestring/MANIFEST
==============================================================================
--- branches/codestring/MANIFEST	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/MANIFEST	Thu May  6 14:34:34 2010	(r46358)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Tue May  4 01:57:56 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu May  6 12:11:46 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1125,6 +1125,7 @@
 runtime/parrot/include/test_more.pir                        [library]
 runtime/parrot/languages/parrot/parrot.pir                  [library]
 runtime/parrot/library/Archive/Tar.pir                      [library]
+runtime/parrot/library/Archive/Zip.pir                      [library]
 runtime/parrot/library/CGI/QueryHash.pir                    [library]
 runtime/parrot/library/Config/JSON.pir                      [library]
 runtime/parrot/library/Configure/genfile.pir                [library]
@@ -1397,6 +1398,7 @@
 src/pmc/sockaddr.pmc                                        []
 src/pmc/socket.pmc                                          []
 src/pmc/string.pmc                                          []
+src/pmc/stringbuilder.pmc                                   []
 src/pmc/stringhandle.pmc                                    []
 src/pmc/stringiterator.pmc                                  []
 src/pmc/sub.pmc                                             []
@@ -1613,6 +1615,7 @@
 t/configure/testlib/verbosefoobar                           [test]
 t/distro/file_metadata.t                                    [test]
 t/distro/manifest.t                                         [test]
+t/distro/manifest_generated.t                               [test]
 t/dynoplibs/math.t                                          [test]
 t/dynoplibs/obscure.t                                       [test]
 t/dynpmc/dynlexpad.t                                        [test]
@@ -1642,6 +1645,7 @@
 t/harness.pir                                               [test]
 t/include/fp_equality.t                                     [test]
 t/library/archive_tar.t                                     [test]
+t/library/archive_zip.t                                     [test]
 t/library/cgi_query_hash.t                                  [test]
 t/library/configure.t                                       [test]
 t/library/coroutine.t                                       [test]
@@ -1883,6 +1887,7 @@
 t/pmc/sockaddr.t                                            [test]
 t/pmc/socket.t                                              [test]
 t/pmc/string.t                                              [test]
+t/pmc/stringbuilder.t                                       [test]
 t/pmc/stringhandle.t                                        [test]
 t/pmc/stringiterator.t                                      [test]
 t/pmc/sub.t                                                 [test]

Modified: branches/codestring/MANIFEST.generated
==============================================================================
--- branches/codestring/MANIFEST.generated	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/MANIFEST.generated	Thu May  6 14:34:34 2010	(r46358)
@@ -2,255 +2,389 @@
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
 # Please re-sort this file after *EVERY* modification
-blib/lib/libparrot.2.3.0.dylib                    [main]lib
-blib/lib/libparrot.a                              [main]lib
-blib/lib/libparrot.dylib                          [main]lib
-blib/lib/libparrot.so.2.3.0                       [main]lib
-blib/lib/libparrot.so                             [main]lib
-compilers/data_json/data_json.pbc                 [data_json]
-config/gen/call_list/opengl.in                    []
-docs/ops/bit.pod                                  [doc]
-docs/ops/cmp.pod                                  [doc]
-docs/ops/core.pod                                 [doc]
-docs/ops/debug.pod                                [doc]
-docs/ops/dotgnu.pod                               [doc]
-docs/ops/experimental.pod                         [doc]
-docs/ops/io.pod                                   [doc]
-docs/ops/math.pod                                 [doc]
-docs/ops/object.pod                               [doc]
-docs/ops/obscure.pod                              [doc]
-docs/ops/pic.pod                                  [doc]
-docs/ops/pmc.pod                                  [doc]
-docs/ops/python.pod                               [doc]
-docs/ops/set.pod                                  [doc]
-docs/ops/stack.pod                                [doc]
-docs/ops/string.pod                               [doc]
-docs/ops/sys.pod                                  [doc]
-docs/ops/var.pod                                  [doc]
-include/parrot/config.h                           [main]include
-include/parrot/core_pmcs.h                        [main]include
-include/parrot/exec_dep.h                         [main]include
-include/parrot/extend_vtable.h                    [main]include
-include/parrot/feature.h                          [main]include
-include/parrot/has_header.h                       [main]include
-include/parrot/oplib/core_ops.h                   [main]include
-include/parrot/oplib/ops.h                        [main]include
-include/parrot/pbcversion.h                       [devel]include
-include/parrot/platform.h                         [main]include
-include/parrot/platform_limits.h                  [devel]include
-include/parrot/vtable.h                           [main]include
-install_config.fpmc                               [main]lib
-src/install_config.o                              [main]lib
-src/install_config.obj                            [main]lib
-installable_parrot_config.exe                     [main]bin
-installable_parrot_config                         [main]bin
-installable_parrot_debugger.exe                   [main]bin
-installable_parrot_debugger                       [main]bin
-installable_parrot.exe                            [main]bin
-installable_parrot                                [main]bin
-installable_parrot_nci_thunk_gen                  [main]bin
-installable_pbc_disassemble.exe                   [main]bin
-installable_pbc_disassemble                       [main]bin
-installable_pbc_dump.exe                          [main]bin
-installable_pbc_dump                              [main]bin
-installable_pbc_merge.exe                         [main]bin
-installable_pbc_merge                             [main]bin
-installable_pbc_to_exe.exe                        [main]bin
-installable_pbc_to_exe                            [main]bin
-installable_parrot-nqp.exe                        [main]bin
-installable_parrot-nqp                            [main]bin
-installable_tapir.exe                             [main]bin
-installable_tapir                                 [main]bin
-lib/Parrot/Config/Generated.pm                    [devel]lib
-libparrot.dll                                     [main]bin
-libparrot.lib                                     [main]bin
-lib/Parrot/OpLib/core.pm                          [devel]lib
-lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm                [devel]lib
-lib/Parrot/PMC.pm                                 [devel]lib
-parrot.pc                                         [main]pkgconfig
-runtime/parrot/dynext/dynlexpad.bundle            [library]
-runtime/parrot/dynext/dynlexpad.dll               [library]
-runtime/parrot/dynext/dynlexpad.dylib             [library]
-runtime/parrot/dynext/dynlexpad.so                [library]
-runtime/parrot/dynext/file.bundle                 [library]
-runtime/parrot/dynext/file.dll                    [library]
-runtime/parrot/dynext/file.dylib                  [library]
-runtime/parrot/dynext/file.so                     [library]
-runtime/parrot/dynext/gziphandle.bundle           [library]
-runtime/parrot/dynext/gziphandle.dll              [library]
-runtime/parrot/dynext/gziphandle.dylib            [library]
-runtime/parrot/dynext/gziphandle.so               [library]
-runtime/parrot/dynext/libglutcb.bundle            [library]
-runtime/parrot/dynext/libglutcb.dll               [library]
-runtime/parrot/dynext/libglutcb.dylib             [library]
-runtime/parrot/dynext/libglutcb.so                [library]
-runtime/parrot/dynext/math_ops.so                 [library]
-runtime/parrot/dynext/math_ops.bundle             [library]
-runtime/parrot/dynext/math_ops.dll                [library]
-runtime/parrot/dynext/math_ops.dylib              [library]
-runtime/parrot/dynext/obscure_ops.bundle          [library]
-runtime/parrot/dynext/obscure_ops.dll             [library]
-runtime/parrot/dynext/obscure_ops.dylib           [library]
-runtime/parrot/dynext/obscure_ops.so              [library]
-runtime/parrot/dynext/os.bundle                   [library]
-runtime/parrot/dynext/os.dll                      [library]
-runtime/parrot/dynext/os.dylib                    [library]
-runtime/parrot/dynext/os.so                       [library]
-runtime/parrot/dynext/rational.bundle             [library]
-runtime/parrot/dynext/rational.dll                [library]
-runtime/parrot/dynext/rational.dylib              [library]
-runtime/parrot/dynext/rational.so                 [library]
-runtime/parrot/include/call_bits.pasm             [main]
-runtime/parrot/include/cclass.pasm                [main]
-runtime/parrot/include/config.fpmc                []
-runtime/parrot/include/datatypes.pasm             [main]
-runtime/parrot/include/dlopenflags.pasm           [main]
-runtime/parrot/include/errors.pasm                [main]
-runtime/parrot/include/except_severity.pasm       [main]
-runtime/parrot/include/except_types.pasm          [main]
-runtime/parrot/include/hash_key_type.pasm         [main]
-runtime/parrot/include/iglobals.pasm              [main]
-runtime/parrot/include/interpcores.pasm           [main]
-runtime/parrot/include/interpdebug.pasm           [main]
-runtime/parrot/include/interpflags.pasm           [main]
-runtime/parrot/include/interpinfo.pasm            [main]
-runtime/parrot/include/interptrace.pasm           [main]
-runtime/parrot/include/iotypes.pasm               [main]
-runtime/parrot/include/iterator.pasm              [main]
-runtime/parrot/include/libpaths.pasm              [main]
-runtime/parrot/include/longopt.pasm               [main]
-runtime/parrot/include/opengl_defines.pasm        [main]
-runtime/parrot/include/parrotlib.pbc              [main]
-runtime/parrot/include/pmctypes.pasm              [main]
-runtime/parrot/include/signal.pasm                [main]
-runtime/parrot/include/socket.pasm                [main]
-runtime/parrot/include/stat.pasm                  [main]
-runtime/parrot/include/stdio.pasm                 [main]
-runtime/parrot/include/stringinfo.pasm            [main]
-runtime/parrot/include/sysinfo.pasm               [main]
-runtime/parrot/include/timer.pasm                 [main]
-runtime/parrot/include/tm.pasm                    [main]
-runtime/parrot/include/vtable_methods.pasm        [main]
-runtime/parrot/include/warnings.pasm              [main]
-runtime/parrot/library/Archive/TAR.pbc            [main]
-runtime/parrot/library/CGI/QueryHash.pbc          [main]
-runtime/parrot/library/Config/JSON.pbc            [main]
-runtime/parrot/library/Configure/genfile.pbc      [main]
-runtime/parrot/library/config.pbc                 [main]
-runtime/parrot/library/config.pir                 [main]
-runtime/parrot/library/Crow.pbc                   [main]
-runtime/parrot/library/Data/Dumper/Base.pbc       [main]
-runtime/parrot/library/Data/Dumper/Default.pbc    [main]
-runtime/parrot/library/Data/Dumper.pbc            [main]
-runtime/parrot/library/Data/Replace.pbc           [main]
-runtime/parrot/library/Digest/MD5.pbc             [main]
-runtime/parrot/library/distutils.pbc              [main]
-runtime/parrot/library/dumper.pbc                 [main]
-runtime/parrot/library/Getopt/Obj.pbc             [main]
-runtime/parrot/library/HLL.pbc                    [main]
-runtime/parrot/library/HTTP/Daemon.pbc            [main]
-runtime/parrot/library/Iter.pbc                   [main]
-runtime/parrot/library/JSON.pbc                   [main]
-runtime/parrot/library/libpcre.pbc                [main]
-runtime/parrot/library/Math/Rand.pbc              [main]
-runtime/parrot/library/MIME/Base64.pbc            [main]
-runtime/parrot/library/NCI/call_toolkit_init.pbc  [main]
-runtime/parrot/library/ncurses.pbc                [main]
-runtime/parrot/library/nqp-rx.pbc                 [nqp]
-runtime/parrot/library/OpenGL_funcs.pir           [main]
-runtime/parrot/library/OpenGL_funcs.pbc           [main]
-runtime/parrot/library/OpenGL.pbc                 [main]
-runtime/parrot/library/osutils.pbc                [main]
-runtime/parrot/library/P6object.pbc               [main]
-runtime/parrot/library/P6Regex.pbc                [main]
-runtime/parrot/library/Parrot/Capture_PIR.pbc     [main]
-runtime/parrot/library/Parrot/Coroutine.pbc       [main]
-runtime/parrot/library/Parrot/Exception.pbc       [main]
-runtime/parrot/library/Parrot/HLLCompiler.pbc     [main]
-runtime/parrot/library/parrotlib.pbc              [main]
-runtime/parrot/library/pcore.pbc                  [main]
-runtime/parrot/library/pcre.pbc                   [main]
-runtime/parrot/library/PCT/Grammar.pbc            [main]
-runtime/parrot/library/PCT/HLLCompiler.pbc        [main]
-runtime/parrot/library/PCT/PAST.pbc               [main]
-runtime/parrot/library/PCT.pbc                    [main]
-runtime/parrot/library/PGE/Dumper.pbc             [main]
-runtime/parrot/library/PGE/Glob.pbc               [main]
-runtime/parrot/library/PGE/Hs.pbc                 [main]
-runtime/parrot/library/PGE.pbc                    [main]
-runtime/parrot/library/PGE/Perl6Grammar.pbc       [main]
-runtime/parrot/library/PGE/Text.pbc               [main]
-runtime/parrot/library/PGE/Util.pbc               [main]
-runtime/parrot/library/Protoobject.pbc            [main]
-runtime/parrot/library/Range.pbc                  [main]
-runtime/parrot/library/Regex.pbc                  [main]
-runtime/parrot/library/Stream/Base.pbc            [main]
-runtime/parrot/library/Stream/Combiner.pbc        [main]
-runtime/parrot/library/Stream/Coroutine.pbc       [main]
-runtime/parrot/library/Stream/Filter.pbc          [main]
-runtime/parrot/library/Stream/Lines.pbc           [main]
-runtime/parrot/library/Stream/ParrotIO.pbc        [main]
-runtime/parrot/library/Stream/Replay.pbc          [main]
-runtime/parrot/library/Stream/Sub.pbc             [main]
-runtime/parrot/library/Stream/Writer.pbc          [main]
-runtime/parrot/library/TAP/Formatter.pbc          [main]
-runtime/parrot/library/TAP/Harness.pbc            [main]
-runtime/parrot/library/TAP/Parser.pbc             [main]
-runtime/parrot/library/Tcl/Glob.pbc               [main]
-runtime/parrot/library/TclLibrary.pbc             [main]
-runtime/parrot/library/Test/Builder/Test.pbc      [main]
-runtime/parrot/library/Test/Builder/Tester.pbc    [main]
-runtime/parrot/library/Test/Builder/TestPlan.pbc  [main]
-runtime/parrot/library/Test/Builder/Output.pbc    [main]
-runtime/parrot/library/Test/Builder.pbc           [main]
-runtime/parrot/library/Test/Class.pbc             [main]
-runtime/parrot/library/Test/More.pbc              [main]
-runtime/parrot/library/TGE.pbc                    [tge]
-runtime/parrot/library/uuid.pbc                   [main]
-runtime/parrot/library/YAML/Dumper/Base.pmc       [main]
-runtime/parrot/library/YAML/Dumper/Default.pmc    [main]
-runtime/parrot/library/YAML/Dumper.pbc            [main]
-src/call_list.txt                                 [devel]src
-src/glut_callbacks.c                              []
-src/jit_emit.h                                    []
-src/nci.c                                         []
-src/null_config.c                                 []
-src/parrot_config.c                               []
-src/pmc/boolean.dump                              [devel]src
-src/pmc/continuation.dump                         [devel]src
-src/pmc/default.dump                              [devel]src
-src/pmc/fixedpmcarray.dump                        [devel]src
-src/pmc/float.dump                                [devel]src
-src/pmc/hash.dump                                 [devel]src
-src/pmc/integer.dump                              [devel]src
-src/pmc/multisub.dump                             [devel]src
-src/pmc/object.dump                               [devel]src
-include/pmc/pmc_boolean.h                         [devel]include
-include/pmc/pmc_class.h                           [devel]include
-include/pmc/pmc_callcontext.h                     [devel]include
-include/pmc/pmc_continuation.h                    [devel]include
-include/pmc/pmc_context.h                         [devel]include
-include/pmc/pmc_default.h                         [devel]include
-include/pmc/pmc_fixedintegerarray.h               [devel]include
-include/pmc/pmc_fixedpmcarray.h                   [devel]include
-include/pmc/pmc_float.h                           [devel]include
-include/pmc/pmc_hash.h                            [devel]include
-include/pmc/pmc_integer.h                         [devel]include
-include/pmc/pmc_multisub.h                        [devel]include
-include/pmc/pmc_object.h                          [devel]include
-include/pmc/pmc_parrotlibrary.h                   [devel]include
-include/pmc/pmc_resizablepmcarray.h               [devel]include
-include/pmc/pmc_role.h                            [devel]include
-include/pmc/pmc_scalar.h                          [devel]include
-include/pmc/pmc_string.h                          [devel]include
-include/pmc/pmc_sub.h                             [devel]include
-include/pmc/pmc_undef.h                           [devel]include
-src/pmc/resizablepmcarray.dump                    [devel]src
-src/pmc/role.dump                                 [devel]src
-src/pmc/scalar.dump                               [devel]src
-src/pmc/string.dump                               [devel]src
-src/pmc/sub.dump                                  [devel]src
-src/pmc/undef.dump                                [devel]src
-src/string_private_cstring.h                      []
-tools/build/dynpmc.pl                             []
-vtable.dump                                       [devel]src
+blib/lib/libparrot.2.3.0.dylib                   [main]lib
+blib/lib/libparrot.a                             [main]lib
+blib/lib/libparrot.dylib                         [main]lib
+blib/lib/libparrot.so                            [main]lib
+blib/lib/libparrot.so.2.3.0                      [main]lib
+compilers/data_json/data_json.pbc                [data_json]
+config/gen/call_list/opengl.in                   []
+docs/ops/bit.pod                                 [doc]
+docs/ops/cmp.pod                                 [doc]
+docs/ops/core.pod                                [doc]
+docs/ops/debug.pod                               [doc]
+docs/ops/dotgnu.pod                              [doc]
+docs/ops/experimental.pod                        [doc]
+docs/ops/io.pod                                  [doc]
+docs/ops/math.pod                                [doc]
+docs/ops/object.pod                              [doc]
+docs/ops/obscure.pod                             [doc]
+docs/ops/pic.pod                                 [doc]
+docs/ops/pmc.pod                                 [doc]
+docs/ops/python.pod                              [doc]
+docs/ops/set.pod                                 [doc]
+docs/ops/stack.pod                               [doc]
+docs/ops/string.pod                              [doc]
+docs/ops/sys.pod                                 [doc]
+docs/ops/var.pod                                 [doc]
+include/parrot/config.h                          [main]include
+include/parrot/core_pmcs.h                       [main]include
+include/parrot/exec_dep.h                        [main]include
+include/parrot/extend_vtable.h                   [main]include
+include/parrot/feature.h                         [main]include
+include/parrot/has_header.h                      [main]include
+include/parrot/oplib/core_ops.h                  [main]include
+include/parrot/oplib/ops.h                       [main]include
+include/parrot/pbcversion.h                      [devel]include
+include/parrot/platform.h                        [main]include
+include/parrot/platform_limits.h                 [devel]include
+include/parrot/vtable.h                          [main]include
+include/pmc/pmc_addrregistry.h                   [devel]include
+include/pmc/pmc_arrayiterator.h                  [devel]include
+include/pmc/pmc_bigint.h                         [devel]include
+include/pmc/pmc_bignum.h                         [devel]include
+include/pmc/pmc_boolean.h                        [devel]include
+include/pmc/pmc_callcontext.h                    [devel]include
+include/pmc/pmc_capture.h                        [devel]include
+include/pmc/pmc_class.h                          [devel]include
+include/pmc/pmc_codestring.h                     [devel]include
+include/pmc/pmc_complex.h                        [devel]include
+include/pmc/pmc_context.h                        [devel]include
+include/pmc/pmc_continuation.h                   [devel]include
+include/pmc/pmc_coroutine.h                      [devel]include
+include/pmc/pmc_default.h                        [devel]include
+include/pmc/pmc_env.h                            [devel]include
+include/pmc/pmc_eval.h                           [devel]include
+include/pmc/pmc_eventhandler.h                   [devel]include
+include/pmc/pmc_exception.h                      [devel]include
+include/pmc/pmc_exceptionhandler.h               [devel]include
+include/pmc/pmc_exporter.h                       [devel]include
+include/pmc/pmc_filehandle.h                     [devel]include
+include/pmc/pmc_fixedbooleanarray.h              [devel]include
+include/pmc/pmc_fixedfloatarray.h                [devel]include
+include/pmc/pmc_fixedintegerarray.h              [devel]include
+include/pmc/pmc_fixedpmcarray.h                  [devel]include
+include/pmc/pmc_fixedstringarray.h               [devel]include
+include/pmc/pmc_float.h                          [devel]include
+include/pmc/pmc_handle.h                         [devel]include
+include/pmc/pmc_hash.h                           [devel]include
+include/pmc/pmc_hashiterator.h                   [devel]include
+include/pmc/pmc_hashiteratorkey.h                [devel]include
+include/pmc/pmc_imageio.h                        [devel]include
+include/pmc/pmc_imageiosize.h                    [devel]include
+include/pmc/pmc_imageiostrings.h                 [devel]include
+include/pmc/pmc_integer.h                        [devel]include
+include/pmc/pmc_iterator.h                       [devel]include
+include/pmc/pmc_key.h                            [devel]include
+include/pmc/pmc_lexinfo.h                        [devel]include
+include/pmc/pmc_lexpad.h                         [devel]include
+include/pmc/pmc_managedstruct.h                  [devel]include
+include/pmc/pmc_multisub.h                       [devel]include
+include/pmc/pmc_namespace.h                      [devel]include
+include/pmc/pmc_nci.h                            [devel]include
+include/pmc/pmc_null.h                           [devel]include
+include/pmc/pmc_object.h                         [devel]include
+include/pmc/pmc_oplib.h                          [devel]include
+include/pmc/pmc_orderedhash.h                    [devel]include
+include/pmc/pmc_orderedhashiterator.h            [devel]include
+include/pmc/pmc_packfile.h                       [devel]include
+include/pmc/pmc_packfileannotation.h             [devel]include
+include/pmc/pmc_packfileannotations.h            [devel]include
+include/pmc/pmc_packfileconstanttable.h          [devel]include
+include/pmc/pmc_packfiledebug.h                  [devel]include
+include/pmc/pmc_packfiledirectory.h              [devel]include
+include/pmc/pmc_packfilefixupentry.h             [devel]include
+include/pmc/pmc_packfilefixuptable.h             [devel]include
+include/pmc/pmc_packfilerawsegment.h             [devel]include
+include/pmc/pmc_packfilesegment.h                [devel]include
+include/pmc/pmc_parrotinterpreter.h              [devel]include
+include/pmc/pmc_parrotlibrary.h                  [devel]include
+include/pmc/pmc_parrotthread.h                   [devel]include
+include/pmc/pmc_pmcproxy.h                       [devel]include
+include/pmc/pmc_pointer.h                        [devel]include
+include/pmc/pmc_resizablebooleanarray.h          [devel]include
+include/pmc/pmc_resizablefloatarray.h            [devel]include
+include/pmc/pmc_resizableintegerarray.h          [devel]include
+include/pmc/pmc_resizablepmcarray.h              [devel]include
+include/pmc/pmc_resizablestringarray.h           [devel]include
+include/pmc/pmc_role.h                           [devel]include
+include/pmc/pmc_scalar.h                         [devel]include
+include/pmc/pmc_scheduler.h                      [devel]include
+include/pmc/pmc_schedulermessage.h               [devel]include
+include/pmc/pmc_sockaddr.h                       [devel]include
+include/pmc/pmc_socket.h                         [devel]include
+include/pmc/pmc_string.h                         [devel]include
+include/pmc/pmc_stringbuilder.h                  [devel]include
+include/pmc/pmc_stringhandle.h                   [devel]include
+include/pmc/pmc_stringiterator.h                 [devel]include
+include/pmc/pmc_sub.h                            [devel]include
+include/pmc/pmc_task.h                           [devel]include
+include/pmc/pmc_threadinterpreter.h              [devel]include
+include/pmc/pmc_timer.h                          [devel]include
+include/pmc/pmc_undef.h                          [devel]include
+include/pmc/pmc_unmanagedstruct.h                [devel]include
+install_config.fpmc                              [main]lib
+installable_parrot                               [main]bin
+installable_parrot-nqp                           [main]bin
+installable_parrot-nqp.exe                       [main]bin
+installable_parrot.exe                           [main]bin
+installable_parrot_config                        [main]bin
+installable_parrot_config.exe                    [main]bin
+installable_parrot_debugger                      [main]bin
+installable_parrot_debugger.exe                  [main]bin
+installable_parrot_nci_thunk_gen                 [main]bin
+installable_pbc_disassemble                      [main]bin
+installable_pbc_disassemble.exe                  [main]bin
+installable_pbc_dump                             [main]bin
+installable_pbc_dump.exe                         [main]bin
+installable_pbc_merge                            [main]bin
+installable_pbc_merge.exe                        [main]bin
+installable_pbc_to_exe                           [main]bin
+installable_pbc_to_exe.exe                       [main]bin
+installable_tapir                                [main]bin
+installable_tapir.exe                            [main]bin
+lib/Parrot/Config/Generated.pm                   [devel]lib
+lib/Parrot/OpLib/core.pm                         [devel]lib
+lib/Parrot/PMC.pm                                [devel]lib
+lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm               [devel]lib
+libparrot.dll                                    [main]bin
+libparrot.lib                                    [main]bin
+parrot.pc                                        [main]pkgconfig
+runtime/parrot/dynext/dynlexpad.bundle           [library]
+runtime/parrot/dynext/dynlexpad.dll              [library]
+runtime/parrot/dynext/dynlexpad.dylib            [library]
+runtime/parrot/dynext/dynlexpad.so               [library]
+runtime/parrot/dynext/file.bundle                [library]
+runtime/parrot/dynext/file.dll                   [library]
+runtime/parrot/dynext/file.dylib                 [library]
+runtime/parrot/dynext/file.so                    [library]
+runtime/parrot/dynext/gziphandle.bundle          [library]
+runtime/parrot/dynext/gziphandle.dll             [library]
+runtime/parrot/dynext/gziphandle.dylib           [library]
+runtime/parrot/dynext/gziphandle.so              [library]
+runtime/parrot/dynext/libglutcb.bundle           [library]
+runtime/parrot/dynext/libglutcb.dll              [library]
+runtime/parrot/dynext/libglutcb.dylib            [library]
+runtime/parrot/dynext/libglutcb.so               [library]
+runtime/parrot/dynext/math_ops.bundle            [library]
+runtime/parrot/dynext/math_ops.dll               [library]
+runtime/parrot/dynext/math_ops.dylib             [library]
+runtime/parrot/dynext/math_ops.so                [library]
+runtime/parrot/dynext/obscure_ops.bundle         [library]
+runtime/parrot/dynext/obscure_ops.dll            [library]
+runtime/parrot/dynext/obscure_ops.dylib          [library]
+runtime/parrot/dynext/obscure_ops.so             [library]
+runtime/parrot/dynext/os.bundle                  [library]
+runtime/parrot/dynext/os.dll                     [library]
+runtime/parrot/dynext/os.dylib                   [library]
+runtime/parrot/dynext/os.so                      [library]
+runtime/parrot/dynext/rational.bundle            [library]
+runtime/parrot/dynext/rational.dll               [library]
+runtime/parrot/dynext/rational.dylib             [library]
+runtime/parrot/dynext/rational.so                [library]
+runtime/parrot/include/call_bits.pasm            [main]
+runtime/parrot/include/cclass.pasm               [main]
+runtime/parrot/include/config.fpmc               []
+runtime/parrot/include/datatypes.pasm            [main]
+runtime/parrot/include/dlopenflags.pasm          [main]
+runtime/parrot/include/errors.pasm               [main]
+runtime/parrot/include/except_severity.pasm      [main]
+runtime/parrot/include/except_types.pasm         [main]
+runtime/parrot/include/hash_key_type.pasm        [main]
+runtime/parrot/include/iglobals.pasm             [main]
+runtime/parrot/include/interpcores.pasm          [main]
+runtime/parrot/include/interpdebug.pasm          [main]
+runtime/parrot/include/interpflags.pasm          [main]
+runtime/parrot/include/interpinfo.pasm           [main]
+runtime/parrot/include/interptrace.pasm          [main]
+runtime/parrot/include/iotypes.pasm              [main]
+runtime/parrot/include/iterator.pasm             [main]
+runtime/parrot/include/libpaths.pasm             [main]
+runtime/parrot/include/longopt.pasm              [main]
+runtime/parrot/include/opengl_defines.pasm       [main]
+runtime/parrot/include/parrotlib.pbc             [main]
+runtime/parrot/include/pmctypes.pasm             [main]
+runtime/parrot/include/signal.pasm               [main]
+runtime/parrot/include/socket.pasm               [main]
+runtime/parrot/include/stat.pasm                 [main]
+runtime/parrot/include/stdio.pasm                [main]
+runtime/parrot/include/stringinfo.pasm           [main]
+runtime/parrot/include/sysinfo.pasm              [main]
+runtime/parrot/include/timer.pasm                [main]
+runtime/parrot/include/tm.pasm                   [main]
+runtime/parrot/include/vtable_methods.pasm       [main]
+runtime/parrot/include/warnings.pasm             [main]
+runtime/parrot/library/Archive/Tar.pbc           [main]
+runtime/parrot/library/Archive/Zip.pbc           [main]
+runtime/parrot/library/CGI/QueryHash.pbc         [main]
+runtime/parrot/library/Config/JSON.pbc           [main]
+runtime/parrot/library/Configure/genfile.pbc     [main]
+runtime/parrot/library/Crow.pbc                  [main]
+runtime/parrot/library/Data/Dumper.pbc           [main]
+runtime/parrot/library/Data/Dumper/Base.pbc      [main]
+runtime/parrot/library/Data/Dumper/Default.pbc   [main]
+runtime/parrot/library/Data/Replace.pbc          [main]
+runtime/parrot/library/Digest/MD5.pbc            [main]
+runtime/parrot/library/Getopt/Obj.pbc            [main]
+runtime/parrot/library/HLL.pbc                   [main]
+runtime/parrot/library/HTTP/Daemon.pbc           [main]
+runtime/parrot/library/Iter.pbc                  [main]
+runtime/parrot/library/JSON.pbc                  [main]
+runtime/parrot/library/MIME/Base64.pbc           [main]
+runtime/parrot/library/Math/Rand.pbc             [main]
+runtime/parrot/library/NCI/call_toolkit_init.pbc [main]
+runtime/parrot/library/OpenGL.pbc                [main]
+runtime/parrot/library/OpenGL_funcs.pbc          [main]
+runtime/parrot/library/OpenGL_funcs.pir          [main]
+runtime/parrot/library/P6Regex.pbc               [main]
+runtime/parrot/library/P6object.pbc              [main]
+runtime/parrot/library/PCT.pbc                   [main]
+runtime/parrot/library/PCT/Grammar.pbc           [main]
+runtime/parrot/library/PCT/HLLCompiler.pbc       [main]
+runtime/parrot/library/PCT/PAST.pbc              [main]
+runtime/parrot/library/PGE.pbc                   [main]
+runtime/parrot/library/PGE/Dumper.pbc            [main]
+runtime/parrot/library/PGE/Glob.pbc              [main]
+runtime/parrot/library/PGE/Hs.pbc                [main]
+runtime/parrot/library/PGE/Perl6Grammar.pbc      [main]
+runtime/parrot/library/PGE/Text.pbc              [main]
+runtime/parrot/library/PGE/Util.pbc              [main]
+runtime/parrot/library/Parrot/Capture_PIR.pbc    [main]
+runtime/parrot/library/Parrot/Coroutine.pbc      [main]
+runtime/parrot/library/Parrot/Exception.pbc      [main]
+runtime/parrot/library/Parrot/HLLCompiler.pbc    [main]
+runtime/parrot/library/Protoobject.pbc           [main]
+runtime/parrot/library/Range.pbc                 [main]
+runtime/parrot/library/Regex.pbc                 [main]
+runtime/parrot/library/Stream/Base.pbc           [main]
+runtime/parrot/library/Stream/Combiner.pbc       [main]
+runtime/parrot/library/Stream/Coroutine.pbc      [main]
+runtime/parrot/library/Stream/Filter.pbc         [main]
+runtime/parrot/library/Stream/Lines.pbc          [main]
+runtime/parrot/library/Stream/ParrotIO.pbc       [main]
+runtime/parrot/library/Stream/Replay.pbc         [main]
+runtime/parrot/library/Stream/Sub.pbc            [main]
+runtime/parrot/library/Stream/Writer.pbc         [main]
+runtime/parrot/library/TAP/Formatter.pbc         [main]
+runtime/parrot/library/TAP/Harness.pbc           [main]
+runtime/parrot/library/TAP/Parser.pbc            [main]
+runtime/parrot/library/TGE.pbc                   [tge]
+runtime/parrot/library/Tcl/Glob.pbc              [main]
+runtime/parrot/library/TclLibrary.pbc            [main]
+runtime/parrot/library/Test/Builder.pbc          [main]
+runtime/parrot/library/Test/Builder/Output.pbc   [main]
+runtime/parrot/library/Test/Builder/Test.pbc     [main]
+runtime/parrot/library/Test/Builder/TestPlan.pbc [main]
+runtime/parrot/library/Test/Builder/Tester.pbc   [main]
+runtime/parrot/library/Test/Class.pbc            [main]
+runtime/parrot/library/Test/More.pbc             [main]
+runtime/parrot/library/YAML/Dumper.pbc           [main]
+runtime/parrot/library/YAML/Dumper/Base.pmc      [main]
+runtime/parrot/library/YAML/Dumper/Default.pmc   [main]
+runtime/parrot/library/config.pbc                [main]
+runtime/parrot/library/config.pir                [main]
+runtime/parrot/library/distutils.pbc             [main]
+runtime/parrot/library/dumper.pbc                [main]
+runtime/parrot/library/libpcre.pbc               [main]
+runtime/parrot/library/ncurses.pbc               [main]
+runtime/parrot/library/nqp-rx.pbc                [nqp]
+runtime/parrot/library/osutils.pbc               [main]
+runtime/parrot/library/parrotlib.pbc             [main]
+runtime/parrot/library/pcore.pbc                 [main]
+runtime/parrot/library/pcre.pbc                  [main]
+runtime/parrot/library/uuid.pbc                  [main]
+src/call_list.txt                                [devel]src
+src/glut_callbacks.c                             []
+src/install_config.o                             [main]lib
+src/install_config.obj                           [main]lib
+src/jit_emit.h                                   []
+src/nci.c                                        []
+src/null_config.c                                []
+src/parrot_config.c                              []
+src/pmc/addrregistry.dump                        [devel]src
+src/pmc/arrayiterator.dump                       [devel]src
+src/pmc/bigint.dump                              [devel]src
+src/pmc/bignum.dump                              [devel]src
+src/pmc/boolean.dump                             [devel]src
+src/pmc/callcontext.dump                         [devel]src
+src/pmc/capture.dump                             [devel]src
+src/pmc/class.dump                               [devel]src
+src/pmc/codestring.dump                          [devel]src
+src/pmc/complex.dump                             [devel]src
+src/pmc/continuation.dump                        [devel]src
+src/pmc/coroutine.dump                           [devel]src
+src/pmc/default.dump                             [devel]src
+src/pmc/env.dump                                 [devel]src
+src/pmc/eval.dump                                [devel]src
+src/pmc/eventhandler.dump                        [devel]src
+src/pmc/exception.dump                           [devel]src
+src/pmc/exceptionhandler.dump                    [devel]src
+src/pmc/exporter.dump                            [devel]src
+src/pmc/filehandle.dump                          [devel]src
+src/pmc/fixedbooleanarray.dump                   [devel]src
+src/pmc/fixedfloatarray.dump                     [devel]src
+src/pmc/fixedintegerarray.dump                   [devel]src
+src/pmc/fixedpmcarray.dump                       [devel]src
+src/pmc/fixedstringarray.dump                    [devel]src
+src/pmc/float.dump                               [devel]src
+src/pmc/handle.dump                              [devel]src
+src/pmc/hash.dump                                [devel]src
+src/pmc/hashiterator.dump                        [devel]src
+src/pmc/hashiteratorkey.dump                     [devel]src
+src/pmc/imageio.dump                             [devel]src
+src/pmc/imageiosize.dump                         [devel]src
+src/pmc/imageiostrings.dump                      [devel]src
+src/pmc/integer.dump                             [devel]src
+src/pmc/iterator.dump                            [devel]src
+src/pmc/key.dump                                 [devel]src
+src/pmc/lexinfo.dump                             [devel]src
+src/pmc/lexpad.dump                              [devel]src
+src/pmc/managedstruct.dump                       [devel]src
+src/pmc/multisub.dump                            [devel]src
+src/pmc/namespace.dump                           [devel]src
+src/pmc/nci.dump                                 [devel]src
+src/pmc/null.dump                                [devel]src
+src/pmc/object.dump                              [devel]src
+src/pmc/opcode.dump                              [devel]src
+src/pmc/oplib.dump                               [devel]src
+src/pmc/orderedhash.dump                         [devel]src
+src/pmc/orderedhashiterator.dump                 [devel]src
+src/pmc/packfile.dump                            [devel]src
+src/pmc/packfileannotation.dump                  [devel]src
+src/pmc/packfileannotations.dump                 [devel]src
+src/pmc/packfileconstanttable.dump               [devel]src
+src/pmc/packfiledebug.dump                       [devel]src
+src/pmc/packfiledirectory.dump                   [devel]src
+src/pmc/packfilefixupentry.dump                  [devel]src
+src/pmc/packfilefixuptable.dump                  [devel]src
+src/pmc/packfilerawsegment.dump                  [devel]src
+src/pmc/packfilesegment.dump                     [devel]src
+src/pmc/parrotinterpreter.dump                   [devel]src
+src/pmc/parrotlibrary.dump                       [devel]src
+src/pmc/parrotthread.dump                        [devel]src
+src/pmc/pmcproxy.dump                            [devel]src
+src/pmc/pointer.dump                             [devel]src
+src/pmc/resizablebooleanarray.dump               [devel]src
+src/pmc/resizablefloatarray.dump                 [devel]src
+src/pmc/resizableintegerarray.dump               [devel]src
+src/pmc/resizablepmcarray.dump                   [devel]src
+src/pmc/resizablestringarray.dump                [devel]src
+src/pmc/role.dump                                [devel]src
+src/pmc/scalar.dump                              [devel]src
+src/pmc/scheduler.dump                           [devel]src
+src/pmc/schedulermessage.dump                    [devel]src
+src/pmc/sockaddr.dump                            [devel]src
+src/pmc/socket.dump                              [devel]src
+src/pmc/string.dump                              [devel]src
+src/pmc/stringbuilder.dump                       [devel]src
+src/pmc/stringhandle.dump                        [devel]src
+src/pmc/stringiterator.dump                      [devel]src
+src/pmc/sub.dump                                 [devel]src
+src/pmc/task.dump                                [devel]src
+src/pmc/threadinterpreter.dump                   [devel]src
+src/pmc/timer.dump                               [devel]src
+src/pmc/undef.dump                               [devel]src
+src/pmc/unmanagedstruct.dump                     [devel]src
+src/string_private_cstring.h                     []
+tools/build/dynpmc.pl                            []
+vtable.dump                                      [devel]src

Modified: branches/codestring/PBC_COMPAT
==============================================================================
--- branches/codestring/PBC_COMPAT	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/PBC_COMPAT	Thu May  6 14:34:34 2010	(r46358)
@@ -27,6 +27,7 @@
 
 # please insert tab separated entries at the top of the list
 
+6.15	2010.05.06	bacek	add StringBuilder PMC
 6.14	2010.05.03	coke	remove popaction, pushmark, pushaction ops.
 6.13	2010.05.03	coke	move File/OS pmcs to src/dynpmc
 6.12	2010.05.02	plobsing	store constant PMC strings as top level constant strings    

Modified: branches/codestring/config/gen/makefiles/root.in
==============================================================================
--- branches/codestring/config/gen/makefiles/root.in	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/config/gen/makefiles/root.in	Thu May  6 14:34:34 2010	(r46358)
@@ -257,6 +257,7 @@
 
 GEN_LIBRARY = \
     $(LIBRARY_DIR)/Archive/Tar.pbc \
+    $(LIBRARY_DIR)/Archive/Zip.pbc \
     $(LIBRARY_DIR)/CGI/QueryHash.pbc \
     $(LIBRARY_DIR)/Crow.pbc \
     $(LIBRARY_DIR)/config.pbc \

Modified: branches/codestring/include/parrot/string_funcs.h
==============================================================================
--- branches/codestring/include/parrot/string_funcs.h	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/include/parrot/string_funcs.h	Thu May  6 14:34:34 2010	(r46358)
@@ -322,7 +322,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 PMC* Parrot_str_split(PARROT_INTERP,
-    ARGIN_NULLOK(STRING *delim),
+    ARGIN_NULLOK(const STRING *delim),
     ARGIN_NULLOK(STRING *str))
         __attribute__nonnull__(1);
 
@@ -470,6 +470,19 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*tc);
 
+PARROT_INLINE
+PARROT_IGNORABLE_RESULT
+PARROT_CAN_RETURN_NULL
+const CHARSET * Parrot_str_rep_compatible(PARROT_INTERP,
+    ARGIN(const STRING *a),
+    ARGIN(const STRING *b),
+    ARGOUT(const ENCODING **e))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*e);
+
 #define ASSERT_ARGS_Parrot_str_bitwise_and __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_str_bitwise_not __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
@@ -614,6 +627,11 @@
 #define ASSERT_ARGS_Parrot_str_from_uint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(tc))
+#define ASSERT_ARGS_Parrot_str_rep_compatible __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(a) \
+    , PARROT_ASSERT_ARG(b) \
+    , PARROT_ASSERT_ARG(e))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/string/api.c */
 

Copied: branches/codestring/runtime/parrot/library/Archive/Zip.pir (from r46357, trunk/runtime/parrot/library/Archive/Zip.pir)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/codestring/runtime/parrot/library/Archive/Zip.pir	Thu May  6 14:34:34 2010	(r46358, copy of r46357, trunk/runtime/parrot/library/Archive/Zip.pir)
@@ -0,0 +1,844 @@
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+Archive/Zip
+
+=head2 DESCRIPTION
+
+Partial port of Archive::Zip (version 1.30)
+
+See L<http://search.cpan.org/~adamk/Archive-Zip/>
+
+=cut
+
+.include 'stat.pasm'
+.include 'tm.pasm'
+
+=head3 Class Archive;Zip;Base
+
+=cut
+
+.namespace ['Archive';'Zip';'Base']
+
+.sub '' :init :load :anon
+    $P0 = loadlib 'gziphandle'
+    $P0 = newclass ['Archive';'Zip';'Base']
+    .globalconst int AZ_OK = 0
+    .globalconst int AZ_STREAM_END = 1
+    .globalconst int AZ_ERROR = 2
+    .globalconst int AZ_FORMAT_ERROR = 3
+    .globalconst int AZ_IO_ERROR = 4
+    .globalconst int FA_UNIX = 3
+    .globalconst int GPBF_HAS_DATA_DESCRIPTOR_MASK = 8
+    .globalconst int COMPRESSION_STORED = 0
+    .globalconst int COMPRESSION_DEFLATED = 8
+    .globalconst int SIGNATURE_LENGTH = 4
+    .globalconst int LOCAL_FILE_HEADER_LENGTH = 26
+    .globalconst int DATA_DESCRIPTOR_LENGTH = 12
+    .globalconst int CENTRAL_DIRECTORY_FILE_HEADER_LENGTH = 42
+.end
+
+.sub '_printError'
+    .param pmc args :slurpy
+    $S0 = join '', args
+    printerr $S0
+    printerr "\n"
+.end
+
+.sub '_ioError' :method
+    .param pmc args :slurpy
+    $S0 = err
+    _printError('IO error:', args :flat, ':', $S0)
+    .return (AZ_IO_ERROR)
+.end
+
+.sub '_error' :method
+    .param pmc args :slurpy
+    _printError('error:', args :flat)
+    .return (AZ_ERROR)
+.end
+
+.sub 'pack_C' :method
+    .param int val
+    $S0 = chr val
+    .return ($S0)
+.end
+
+.sub 'pack_v' :method
+    .param int val
+    $I0 = val & 0x000000ff
+    $S0 = chr $I0
+    $I0 = val >> 8
+    $I0 &= 0x000000ff
+    $S1 = chr $I0
+    $S0 .= $S1
+    .return ($S0)
+.end
+
+.sub 'pack_V' :method
+    .param int val
+    $I0 = val & 0x000000ff
+    $S0 = chr $I0
+    $I0 = val >> 8
+    $I0 &= 0x000000ff
+    $S1 = chr $I0
+    $S0 .= $S1
+    $I0 = val >> 16
+    $I0 &= 0x000000ff
+    $S2 = chr $I0
+    $S0 .= $S2
+    $I0 = val >> 24
+    $I0 &= 0x000000ff
+    $S3 = chr $I0
+    $S0 .= $S3
+    .return ($S0)
+.end
+
+=head3 Class Archive;Zip;Member
+
+=over 4
+
+=cut
+
+.namespace ['Archive';'Zip';'Member']
+
+.sub '' :init :load :anon
+    $P0 = subclass ['Archive';'Zip';'Base'], ['Archive';'Zip';'Member']
+    $P0.'add_attribute'('fileName')
+    $P0.'add_attribute'('externalFileName')
+    $P0.'add_attribute'('compressionMethod')
+    $P0.'add_attribute'('compressedSize')
+    $P0.'add_attribute'('uncompressedSize')
+    $P0.'add_attribute'('lastModFileDateTime')
+    $P0.'add_attribute'('writeCentralDirectoryOffset')
+    $P0.'add_attribute'('writeLocalHeaderRelativeOffset')
+    $P0.'add_attribute'('readDataRemaining')
+    $P0.'add_attribute'('localExtraField')
+    $P0.'add_attribute'('cdExtraField')
+    $P0.'add_attribute'('fileComment')
+    $P0.'add_attribute'('crc32')
+    $P0.'add_attribute'('fileAttributeFormat')
+    $P0.'add_attribute'('bitFlag')
+    $P0.'add_attribute'('internalFileAttributes')
+    $P0.'add_attribute'('externalFileAttributes')
+.end
+
+.sub 'init' :vtable :method
+    $P0 = box FA_UNIX
+    setattribute self, 'fileAttributeFormat', $P0
+    $P0 = box 0
+    setattribute self, 'bitFlag', $P0
+    $P0 = box 0
+    setattribute self, 'crc32', $P0
+    $P0 = box 0
+    setattribute self, 'internalFileAttributes', $P0
+    $P0 = box 0
+    setattribute self, 'externalFileAttributes', $P0
+    $P0 = box ''
+    setattribute self, 'cdExtraField', $P0
+    $P0 = box ''
+    setattribute self, 'localExtraField', $P0
+    $P0 = box ''
+    setattribute self, 'fileComment', $P0
+.end
+
+=item newFromFile
+
+=cut
+
+.sub 'newFromFile'
+    .param string fileName
+    .param string zipName       :optional
+    $P0 = get_hll_global ['Archive';'Zip';'NewFileMember'], '_newFromFileNamed'
+    .tailcall $P0(fileName, zipName)
+.end
+
+
+.sub 'setLastModFileDateTimeFromUnix' :method
+    .param int time_t
+    $I0 = self.'_unixToDosTime'(time_t)
+    $P0 = box $I0
+    setattribute self, 'lastModFileDateTime', $P0
+.end
+
+.sub '_unixToDosTime' :method
+    .param int time_t
+    .const int safe_epoch = 315576060
+    unless time_t < safe_epoch goto L1
+    self.'_ioError'("Unsupported date before 1980 encountered, moving to 1980")
+    time_t = safe_epoch
+  L1:
+    $P0 = decodelocaltime time_t
+    .local int dt
+    dt = 0
+    $I0 = $P0[.TM_SEC]
+    $I0 >>= 1
+    dt += $I0
+    $I0 = $P0[.TM_MIN]
+    $I0 <<= 5
+    dt += $I0
+    $I0 = $P0[.TM_HOUR]
+    $I0 <<= 11
+    dt += $I0
+    $I0 = $P0[.TM_MDAY]
+    $I0 <<= 16
+    dt += $I0
+    $I0 = $P0[.TM_MON]
+    $I0 <<= 21
+    dt += $I0
+    $I0 = $P0[.TM_YEAR]
+    $I0 -= 1980
+    $I0 <<= 25
+    dt += $I0
+    .return (dt)
+.end
+
+.sub '_mapPermissionsFromUnix' :method
+    .param int dummy
+    .return (0)
+.end
+
+.sub 'unixFileAttributes' :method
+    .param int perms
+    $I0 = self.'_mapPermissionsFromUnix'(perms)
+    $P0 = box $I0
+    setattribute self, 'externalFileAttributes', $P0
+.end
+
+.sub '_writeOffset' :method
+    $P0 = getattribute self, 'compressedSize'
+    .return ($P0)
+.end
+
+.sub '_localHeaderSize' :method
+    # Return the total size of my local header
+    $I0 = SIGNATURE_LENGTH + LOCAL_FILE_HEADER_LENGTH
+    $P0 = getattribute self, 'fileName'
+    $S0 = $P0
+    $I1 = length $S0
+    $I0 += $I1
+    $P0 = getattribute self, 'localExtraField'
+    $S0 = $P0
+    $I1 = length $S0
+    $I0 += $I1
+    .return ($I0)
+.end
+
+.sub '_centralDirectoryHeaderSize' :method
+    # Return the total size of my CD header
+    $I0 = SIGNATURE_LENGTH + CENTRAL_DIRECTORY_FILE_HEADER_LENGTH
+    $P0 = getattribute self, 'fileName'
+    $S0 = $P0
+    $I1 = length $S0
+    $I0 += $I1
+    $P0 = getattribute self, 'cdExtraField'
+    $S0 = $P0
+    $I1 = length $S0
+    $I0 += $I1
+    $P0 = getattribute self, 'fileComment'
+    $S0 = $P0
+    $I1 = length $S0
+    $I0 += $I1
+    .return ($I0)
+.end
+
+.sub 'hasDataDescriptor' :method
+    .return (0)
+.end
+
+.sub '_writeLocalFileHeader' :method
+    .param pmc fh
+    .const string LOCAL_FILE_HEADER_SIGNATURE = "PK\x03\x04"
+    $I0 = fh.'puts'(LOCAL_FILE_HEADER_SIGNATURE)
+    if $I0 goto L1
+    .tailcall self.'_ioError'('writing local header signature')
+  L1:
+    .local string header, fileName, localExtraField
+    .const string VERSION = 20
+    header = self.'pack_v'(VERSION)
+    $P0 = getattribute self, 'bitFlag'
+    $S0 = self.'pack_v'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'compressionMethod'
+    $S0 = self.'pack_v'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'lastModFileDateTime'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'crc32'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'compressedSize'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'uncompressedSize'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'fileName'
+    fileName = $P0
+    $I0 = length fileName
+    $S0 = self.'pack_v'($I0)
+    header .= $S0
+    $P0 = getattribute self, 'localExtraField'
+    localExtraField = $P0
+    $I0 = length localExtraField
+    $S0 = self.'pack_v'($I0)
+    header .= $S0
+    $I0 = fh.'puts'(header)
+    if $I0 goto L2
+    .tailcall self.'_ioError'('writing local header')
+  L2:
+    if fileName == '' goto L3
+    $I0 = fh.'puts'(fileName)
+    if $I0 goto L3
+    .tailcall self.'_ioError'('writing local header filename')
+  L3:
+    if localExtraField == '' goto L4
+    $I0 = fh.'puts'(localExtraField)
+    if $I0 goto L4
+    .tailcall self.'_ioError'('writing local extra field')
+  L4:
+    .return (AZ_OK)
+.end
+
+.sub '_writeCentralDirectoryFileHeader' :method
+    .param pmc fh
+    .const string CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE = "PK\x01\x02"
+    $I0 = fh.'puts'(CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE)
+    if $I0 goto L1
+    .tailcall self.'_ioError'('writing central directory header signature')
+  L1:
+    .local string header, fileName, cdExtraField, fileComment
+    .local int fileNameLength, extraFieldLength, fileCommentLength
+    .const string VERSION = 20
+    header = self.'pack_C'(VERSION) # versionMadeBy
+    $P0 = getattribute self, 'fileAttributeFormat'
+    $S0 = self.'pack_C'($P0)
+    header .= $S0
+    $S0 = self.'pack_v'(VERSION) # versionNeededToExtract
+    header .= $S0
+    $P0 = getattribute self, 'bitFlag'
+    $S0 = self.'pack_v'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'compressionMethod'
+    $S0 = self.'pack_v'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'lastModFileDateTime'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'crc32'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'compressedSize'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'uncompressedSize'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'fileName'
+    fileName = $P0
+    fileNameLength = length fileName
+    $S0 = self.'pack_v'(fileNameLength)
+    header .= $S0
+    $P0 = getattribute self, 'cdExtraField'
+    cdExtraField = $P0
+    extraFieldLength = length cdExtraField
+    $S0 = self.'pack_v'(extraFieldLength)
+    header .= $S0
+    $P0 = getattribute self, 'fileComment'
+    fileComment = $P0
+    fileCommentLength = length fileComment
+    $S0 = self.'pack_v'(fileCommentLength)
+    header .= $S0
+    $S0 = self.'pack_v'(0)
+    header .= $S0
+    $P0 = getattribute self, 'internalFileAttributes'
+    $S0 = self.'pack_v'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'externalFileAttributes'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'writeLocalHeaderRelativeOffset'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $I0 = fh.'puts'(header)
+    if $I0 goto L2
+    .tailcall self.'_ioError'('writing central directory header')
+  L2:
+    unless fileNameLength goto L3
+    $I0 = fh.'puts'(fileName)
+    if $I0 goto L3
+    .tailcall self.'_ioError'('writing central directory filename')
+  L3:
+    unless extraFieldLength goto L4
+    $I0 = fh.'puts'(cdExtraField)
+    if $I0 goto L4
+    .tailcall self.'_ioError'('writing central directory extra field')
+  L4:
+    unless fileCommentLength goto L5
+    $I0 = fh.'puts'(fileComment)
+    if $I0 goto L5
+    .tailcall self.'_ioError'('writing central directory file comment')
+  L5:
+    .return (AZ_OK)
+.end
+
+.sub '_refreshLocalFileHeader' :method
+    .param pmc fh
+    .local int here
+    here = tell fh
+    $P0 = getattribute self, 'writeLocalHeaderRelativeOffset'
+    $I0 = $P0
+    $I0 += SIGNATURE_LENGTH
+    seek fh, $I0, 0
+    .local string header, fileName, localExtraField
+    .const string VERSION = 20
+    header = self.'pack_v'(VERSION)
+    $P0 = getattribute self, 'bitFlag'
+    $S0 = self.'pack_v'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'compressionMethod'
+    $S0 = self.'pack_v'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'lastModFileDateTime'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'crc32'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'compressedSize'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'uncompressedSize'
+    $S0 = self.'pack_V'($P0)
+    header .= $S0
+    $P0 = getattribute self, 'fileName'
+    fileName = $P0
+    $I0 = length fileName
+    $S0 = self.'pack_v'($I0)
+    header .= $S0
+    $P0 = getattribute self, 'localExtraField'
+    localExtraField = $P0
+    $I0 = length localExtraField
+    $S0 = self.'pack_v'($I0)
+    header .= $S0
+    $I0 = fh.'puts'(header)
+    if $I0 goto L2
+    .tailcall self.'_ioError'('re-writing local header')
+  L2:
+    seek fh, here, 0
+    .return (AZ_OK)
+.end
+
+.sub 'readChunk' :method
+    .param int chunkSize        :optional
+    .param int has_chunkSize    :opt_flag
+    if has_chunkSize goto L1
+    chunkSize = 32768
+  L1:
+    $I0 = self.'readIsDone'()
+    unless $I0 goto L2
+    self.'endRead'()
+    .return ('', AZ_STREAM_END)
+  L2:
+    ($S0, $I0) = self.'_readRawChunk'(chunkSize)
+    if $I0 == AZ_OK goto L3
+    .return ('', $I0)
+  L3:
+    $P0 = getattribute self, 'readDataRemaining'
+    $I0 = length $S0
+    $P0 -= $I0
+    $P0 = new 'GzipHandle'
+    $P1 = getattribute self, 'crc32'
+    $I1 = $P1
+    $I1 = $P0.'crc32'($I1, $S0)
+    set $P1, $I1
+    $S1 = $P0.'compress'($S0)
+    .return ($S1, AZ_OK)
+.end
+
+.sub 'rewindData' :method :nsentry
+    $P0 = getattribute self, 'uncompressedSize'
+    $P0 = clone $P0
+    setattribute self, 'readDataRemaining', $P0
+    .return (AZ_OK)
+.end
+
+.sub 'endRead' :method :nsentry
+    $P0 = box 0
+    setattribute self, 'readDataRemaining', $P0
+    .return (AZ_OK)
+.end
+
+.sub 'readIsDone' :method
+    $P0 = getattribute self, 'readDataRemaining'
+    $I0 = $P0
+    $I0 = not $I0
+    .return ($I0)
+.end
+
+.sub '_writeToFileHandle' :method
+    .param pmc fh
+    .param int fhIsSeekable
+    .param int offset
+    $P0 = getattribute self, 'fileName'
+    if null $P0 goto L1
+    $S0 = $P0
+    unless $S0 == '' goto L2
+  L1:
+    self.'_error'("no member name given")
+  L2:
+    $P0 = box offset
+    setattribute self, 'writeLocalHeaderRelativeOffset', $P0
+    $I0 = self.'rewindData'()
+    unless $I0 == AZ_OK goto L3
+    $I0 = self.'_writeLocalFileHeader'(fh)
+    unless $I0 == AZ_OK goto L3
+    $I0 = self.'_writeData'(fh)
+    unless $I0 == AZ_OK goto L3
+    $I0 = self.'_refreshLocalFileHeader'(fh)
+  L3:
+    .return ($I0)
+.end
+
+.sub '_writeData' :method
+    .param pmc writeFh
+    $P0 = getattribute self, 'uncompressedSize'
+    $I0 = $P0
+    if $I0 goto L1
+    $P0 = box 0
+    setattribute self, 'compressedSize', $P0
+    .return (AZ_OK)
+  L1:
+    .local int compressedSize
+    compressedSize = 0
+  L2:
+    ($S0, $I0) = self.'readChunk'()
+    if $I0 == AZ_STREAM_END goto L3
+    if $I0 == AZ_OK goto L4
+    .return ($I0)
+  L4:
+    writeFh.'puts'($S0)
+    $I0 = length $S0
+    compressedSize += $I0
+    goto L2
+  L3:
+    $P0 = box compressedSize
+    setattribute self, 'compressedSize', $P0
+    .return (AZ_OK)
+.end
+
+.sub '_usesFileNamed' :method
+    .param string fileName
+    .return (0)
+.end
+
+=back
+
+=head3 Class Archive;Zip;FileMember
+
+=cut
+
+.namespace ['Archive';'Zip';'FileMember']
+
+.sub '' :init :load :anon
+    $P0 = subclass ['Archive';'Zip';'Member'], ['Archive';'Zip';'FileMember']
+    $P0.'add_attribute'('fh')
+.end
+
+.sub '_usesFileNamed' :method
+    .param string fileName
+    $P0 = getattribute self, 'externalFileName'
+    unless null $P0 goto L1
+    .return (0)
+  L1:
+    $S0 = $P0
+    $I0 = $S0 == fileName
+    .return ($I0)
+.end
+
+.sub 'fh' :method
+    $P0 = getattribute self, 'fh'
+    if null $P0 goto L1
+    $I0 = $P0.'is_closed'()
+    unless $I0 goto L2
+  L1:
+    $P0 = getattribute self, 'externalFileName'
+    $S0 = $P0
+    $P0 = new 'FileHandle'
+    $P0.'open'($S0, 'rb')
+    setattribute self, 'fh', $P0
+  L2:
+    .return ($P0)
+.end
+
+.sub 'endRead' :method
+    $P0 = getattribute self, 'fh'
+    $P0.'close'()
+    $P0 = get_hll_global ['Archive';'Zip';'Member'], 'endRead'
+    $P0(self)
+.end
+
+=head3 Class Archive;Zip;NewFileMember
+
+=cut
+
+.namespace ['Archive';'Zip';'NewFileMember']
+
+.sub '' :init :load :anon
+    $P0 = subclass ['Archive';'Zip';'FileMember'], ['Archive';'Zip';'NewFileMember']
+.end
+
+.sub '_readRawChunk' :method
+    .param int chunkSize
+    if chunkSize goto L1
+    .return ('', AZ_OK)
+  L1:
+    $P0 = self.'fh'()
+    $S0 = read $P0, chunkSize
+    unless $S0 == '' goto L2
+    $I0 = self.'_ioError'("reading data")
+    .return ($S0, $I0)
+  L2:
+    .return ($S0, AZ_OK)
+.end
+
+.sub '_newFromFileNamed'
+    .param string fileName
+    .param string newName       :optional
+    .param int has_newName      :opt_flag
+    if has_newName goto L1
+    newName = fileName
+  L1:
+    $I0 = stat fileName, .STAT_EXISTS
+    unless $I0 goto L2
+    $I0 = stat fileName, .STAT_ISREG
+    if $I0 goto L3
+  L2:
+    null $P0
+    .return ($P0)
+  L3:
+    $P0 = new ['Archive';'Zip';'NewFileMember']
+    $P1 = box newName
+    setattribute $P0, 'fileName', $P1
+    $P1 = box fileName
+    setattribute $P0, 'externalFileName', $P1
+    $I0 = stat fileName, .STAT_FILESIZE
+    $P1 = box $I0
+    setattribute $P0, 'uncompressedSize', $P1
+    $I1 = COMPRESSION_STORED
+    if $I0 == 0 goto L4
+    $I1 = COMPRESSION_DEFLATED
+  L4:
+    $P1 = box $I1
+    setattribute $P0, 'compressionMethod', $P1
+    $P0.'unixFileAttributes'(0o666)
+    $I0 = stat fileName, .STAT_MODIFYTIME
+    $P0.'setLastModFileDateTimeFromUnix'($I0)
+    .return ($P0)
+.end
+
+.sub 'rewindData' :method
+    $P0 = get_hll_global ['Archive';'Zip';'Member'], 'rewindData'
+    $I0 = $P0(self)
+    if $I0 == AZ_OK goto L1
+    .return ($I0)
+  L1:
+    $P0 = self.'fh'()
+    seek $P0, 0, 0
+    .return (AZ_OK)
+.end
+
+=head3 Class Archive;Zip
+
+=over 4
+
+=cut
+
+.namespace ['Archive';'Zip']
+
+.sub '' :init :load :anon
+    $P0 = subclass ['Archive';'Zip';'Base'], ['Archive';'Zip']
+    $P0.'add_attribute'('members')
+    $P0.'add_attribute'('zipfileComment')
+.end
+
+.sub 'init' :vtable :method
+    $P0 = new 'ResizablePMCArray'
+    setattribute self, 'members', $P0
+    $P0 = box ''
+    setattribute self, 'zipfileComment', $P0
+.end
+
+=item addMember
+
+=cut
+
+.sub 'addMember' :method
+    .param pmc member
+    $P0 = getattribute self, 'members'
+    push $P0, member
+.end
+
+=item addFile
+
+=cut
+
+.sub 'addFile' :method
+    .param string fileName
+    .param string newName       :optional
+    $P0 = get_hll_global ['Archive';'Zip';'Member'], 'newFromFile'
+    $P1 = $P0(fileName, newName)
+    self.'addMember'($P1)
+    .return ($P1)
+.end
+
+=item writeToFileNamed
+
+=cut
+
+.sub 'writeToFileNamed' :method
+    .param string fileName
+    $P0 = getattribute self, 'members'
+    $P1 = iter $P0
+  L1:
+    unless $P1 goto L2
+    .local pmc member
+    member = shift $P1
+    $I0 = member.'_usesFileNamed'(fileName)
+    unless $I0 goto L1
+    $S0 = member.'fileName'()
+    .tailcall self.'_error'("$fileName is needed by member ", $S0, "; consider using overwrite() or overwriteAs() instead.")
+  L2:
+    $P0 = new 'FileHandle'
+    push_eh _handler
+    $P0.'open'(fileName, 'wb')
+    pop_eh
+    $I0 = self.'writeToFileHandle'($P0, 1)
+    $P0.'close'()
+    .return ($I0)
+  _handler:
+    .tailcall self.'_ioError'("Can't open ", fileName, " for write")
+.end
+
+=item writeToFileHandle
+
+=cut
+
+.sub 'writeToFileHandle' :method
+    .param pmc fh
+    .param int fhIsSeekable
+    unless null fh goto L1
+    $I0 = isa fh, 'FileHandle'
+    if $I0 goto L1
+    .tailcall self.'_error'('No filehandle given')
+  L1:
+    $I0 = fh.'is_closed'()
+    unless $I0 goto L2
+    .tailcall self.'_ioError'('filehandle not open')
+  L2:
+    .local int offset
+    offset = 0
+    $P0 = getattribute self, 'members'
+    $P1 = iter $P0
+  L3:
+    unless $P1 goto L4
+    .local pmc member
+    member = shift $P1
+    $I0 = member.'_writeToFileHandle'(fh, fhIsSeekable, offset)
+    member.'endRead'()
+    if $I0 == AZ_OK goto L5
+    .return ($I0)
+  L5:
+    $I0 = member.'_localHeaderSize'()
+    offset += $I0
+    $I0 = member.'_writeOffset'()
+    offset += $I0
+    $I0 = member.'hasDataDescriptor'()
+    unless $I0 goto L3
+    offset += DATA_DESCRIPTOR_LENGTH
+    offset += SIGNATURE_LENGTH
+    goto L3
+  L4:
+    .tailcall self.'writeCentralDirectory'(fh, offset)
+.end
+
+.sub writeCentralDirectory :method
+    .param pmc fh
+    .param int CDoffset
+    .local int offset
+    offset = CDoffset
+    $P0 = getattribute self, 'members'
+    $P1 = iter $P0
+  L1:
+    unless $P1 goto L2
+    .local pmc member
+    member = shift $P1
+    $I0 = member.'_writeCentralDirectoryFileHeader'(fh)
+    if $I0 == AZ_OK goto L3
+    .return ($I0)
+  L3:
+    $I0 = member.'_centralDirectoryHeaderSize'()
+    offset += $I0
+    goto L1
+  L2:
+    .tailcall self.'_writeEndOfCentralDirectory'(fh, CDoffset, offset)
+.end
+
+.sub '_writeEndOfCentralDirectory' :method
+    .param pmc fh
+    .param int CDoffset
+    .param int EOCDoffset
+    .const string END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING = "PK\x05\x06"
+    $I0 = fh.'puts'(END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING)
+    if $I0 goto L1
+    .tailcall self.'_ioError'('writing EOCD Signature')
+  L1:
+    .local string zipfileComment
+    $P0 = getattribute self, 'zipfileComment'
+    zipfileComment = $P0
+    .local int zipfileCommentLength
+    zipfileCommentLength = length zipfileComment
+    .local int numberOfMembers
+    $P0 = getattribute self, 'members'
+    numberOfMembers = elements $P0
+    .local string header
+    $S0 = self.'pack_v'(0)
+    header = repeat $S0, 2
+    $S0 = self.'pack_v'(numberOfMembers)
+    header .= $S0
+    header .= $S0
+    $I0 = EOCDoffset - CDoffset
+    $S0 = self.'pack_V'($I0)
+    header .= $S0
+    $S0 = self.'pack_V'(CDoffset)
+    header .= $S0
+    $S0 = self.'pack_v'(zipfileCommentLength)
+    header .= $S0
+    $I0 = fh.'puts'(header)
+    if $I0 goto L2
+    .tailcall self.'_ioError'('writing EOCD header')
+  L2:
+    unless zipfileCommentLength goto L3
+    $I0 = fh.'puts'(zipfileComment)
+    if $I0 goto L3
+    .tailcall self.'_ioError'('writing zipfile comment')
+  L3:
+    .return (AZ_OK)
+.end
+
+=back
+
+=head1 AUTHOR
+
+Francois Perrad
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/codestring/runtime/parrot/library/distutils.pir
==============================================================================
--- branches/codestring/runtime/parrot/library/distutils.pir	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/runtime/parrot/library/distutils.pir	Thu May  6 14:34:34 2010	(r46358)
@@ -124,10 +124,6 @@
 
 curl
 
-=item sdist_zip
-
-zip
-
 =item spec, sdist_rpm, bdist_rpm
 
 rpmbuild
@@ -3033,14 +3029,14 @@
     .local pmc archive
     archive = new ['Archive';'Tar']
     $P1 = archive.'add_files'($P0 :flat)
-    .local string dir
-    dir = get_tarname('', kv :flat :named)
+    .local string dirname
+    $S0 = get_tarname('', kv :flat :named)
+    dirname = $S0 . '/'
   L2:
     unless $P1 goto L3
     $P2 = shift $P1
     $S0 = $P2.'full_path'()
-    $S0 = '/' . $S0
-    $S0 = dir . $S0
+    $S0 = dirname . $S0
     $P2.'rename'($S0)
     goto L2
   L3:
@@ -3082,23 +3078,28 @@
     .param pmc kv :slurpy :named
     run_step('manifest', kv :flat :named)
 
+    load_bytecode 'Archive/Zip.pbc'
     $S0 = slurp('MANIFEST')
     $P0 = split "\n", $S0
     $S0 = pop $P0
-    $S0 = get_tarname('.zip', kv :flat :named)
-    $I0 = newer($S0, $P0)
+    .local string archive_file
+    archive_file = get_tarname('.zip', kv :flat :named)
+    $I0 = newer(archive_file, $P0)
     if $I0 goto L1
-    .local string cmd
+    .local pmc archive
+    archive = new ['Archive';'Zip']
+    .local string dirname
     $S0 = get_tarname('', kv :flat :named)
-    copy_sdist($S0, $P0)
-
-    cmd = 'zip -9 -r '
-    cmd .= $S0
-    cmd .= '.zip '
-    cmd .= $S0
-    system(cmd, 1 :named('verbose'))
-
-    rmtree($S0)
+    dirname = $S0 . '/'
+    $P1 = iter $P0
+  L2:
+    unless $P1 goto L3
+    $S0 = shift $P1
+    $S1 = dirname . $S0
+    archive.'addFile'($S0, $S1)
+    goto L2
+  L3:
+    archive.'writeToFileNamed'(archive_file)
   L1:
 .end
 
@@ -3110,21 +3111,6 @@
     unlink('MANIFEST', 1 :named('verbose'))
 .end
 
-.sub 'copy_sdist' :anon
-    .param string dirname
-    .param pmc files
-    mkdir(dirname)
-    $S1 = dirname . "/"
-    $P0 = iter files
-  L1:
-    unless $P0 goto L2
-    $S0 = shift $P0
-    $S2 = $S1 . $S0
-    install($S0, $S2)
-    goto L1
-  L2:
-.end
-
 =head3 Step sdist_rpm
 
 =cut

Modified: branches/codestring/src/dynpmc/gziphandle.pmc
==============================================================================
--- branches/codestring/src/dynpmc/gziphandle.pmc	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/src/dynpmc/gziphandle.pmc	Thu May  6 14:34:34 2010	(r46358)
@@ -249,16 +249,16 @@
         int rc;
         char *buf;
         STRING *dst = NULL;
-        UINTVAL srcLen, bufSize, dstLen;
+        UINTVAL srcLen, dstLen;
         char * const src = Parrot_str_to_cstring(INTERP, str);
 
         if (!src)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
                 "failed to allocate");
 
-        srcLen  = Parrot_str_byte_length(INTERP, str);
-        bufSize = 12 + srcLen + srcLen / 1000;
-        buf     = mem_allocate_n_zeroed_typed(bufSize, char);
+        srcLen = Parrot_str_byte_length(INTERP, str);
+        dstLen = 12 + srcLen + srcLen / 1000;
+        buf    = mem_allocate_n_zeroed_typed(dstLen, char);
 
         if (!buf) {
             Parrot_str_free_cstring(src);
@@ -295,6 +295,23 @@
         RETURN(STRING *dst);
     }
 
+    METHOD crc32(INTVAL crc, STRING *str) {
+        int rc;
+        char *buf;
+        STRING *dst = NULL;
+        UINTVAL srcLen, bufSize, dstLen;
+        char * const src = Parrot_str_to_cstring(INTERP, str);
+
+        if (!src)
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
+                "failed to allocate");
+
+        srcLen  = Parrot_str_byte_length(INTERP, str);
+
+        crc = crc32(crc, (const Bytef *)src, srcLen);
+        RETURN(INTVAL crc);
+    }
+
 /*
 
 =back

Modified: branches/codestring/src/gc/gc_ms.c
==============================================================================
--- branches/codestring/src/gc/gc_ms.c	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/src/gc/gc_ms.c	Thu May  6 14:34:34 2010	(r46358)
@@ -1251,6 +1251,17 @@
     mem = (char *)mem_allocate(interp, interp->mem_pools, new_size, pool);
     mem += sizeof (void *);
 
+    /* Update Memory_Block usage */
+    /* We must not reallocate non-movable buffers! */
+    PARROT_ASSERT(PObj_is_movable_TESTALL(str));
+
+    /* We must not reallocate shared buffers! */
+    PARROT_ASSERT(!(*Buffer_bufrefcountptr(str) & Buffer_shared_FLAG));
+
+    /* Decrease usage */
+    PARROT_ASSERT(Buffer_pool(str));
+    Buffer_pool(str)->freed  += ALIGNED_STRING_SIZE(Buffer_buflen(str));
+
     /* copy mem from strstart, *not* bufstart */
     oldmem             = str->strstart;
     Buffer_bufstart(str) = (void *)mem;

Copied: branches/codestring/src/pmc/stringbuilder.pmc (from r46357, trunk/src/pmc/stringbuilder.pmc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/codestring/src/pmc/stringbuilder.pmc	Thu May  6 14:34:34 2010	(r46358, copy of r46357, trunk/src/pmc/stringbuilder.pmc)
@@ -0,0 +1,281 @@
+/*
+Copyright (C) 2010, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/stringbuilder.pmc - StringBuilder PMC Class
+
+=head1 DESCRIPTION
+
+TODO: Add description here.
+
+=head2 Methods
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/string_funcs.h"
+
+/* HEADERIZER HFILE: none */
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static size_t calculate_capacity(SHIM_INTERP,
+    size_t current,
+    size_t additional);
+
+#define ASSERT_ARGS_calculate_capacity __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
+#define INITIAL_STRING_CAPACITY 128
+
+pmclass StringBuilder provides string auto_attrs {
+    ATTR STRING *buffer;    /* Mutable string to gather results */
+
+/*
+
+=item C<void init()>
+
+Initializes the StringBuilder.
+
+=cut
+
+*/
+
+    VTABLE void init() {
+        STATICSELF.init_int(INITIAL_STRING_CAPACITY);
+    }
+
+/*
+
+=item C<void init_int()>
+
+Initializes the StringBuilder with initial size of buffer.
+
+=cut
+
+*/
+
+    VTABLE void init_int(INTVAL initial_size) {
+        STRING * const buffer = Parrot_str_new_init(INTERP, NULL, initial_size,
+                Parrot_default_encoding_ptr, Parrot_default_charset_ptr, 0);
+        SET_ATTR_buffer(INTERP, SELF, buffer);
+
+        PObj_custom_mark_SET(SELF);
+    }
+
+/*
+
+=item C<void mark()>
+
+Marks the StringBuilder as live.
+
+=cut
+
+*/
+
+    VTABLE void mark() {
+        STRING *buffer;
+
+        if (!PMC_data(SELF))
+            return;
+
+        GET_ATTR_buffer(INTERP, SELF, buffer);
+        Parrot_gc_mark_STRING_alive(INTERP, buffer);
+    }
+
+/*
+
+=item C<STRING *get_string()>
+
+Clones and returns current buffer. We need clone because outside of
+StringBuilder strings are immutable.
+
+=cut
+
+*/
+
+    VTABLE STRING *get_string() {
+        STRING *buffer;
+        GET_ATTR_buffer(INTERP, SELF, buffer);
+        return Parrot_str_clone(INTERP, buffer);
+    }
+
+/*
+
+=item C<STRING *push_string()>
+
+Append string to current buffer.
+
+=cut
+
+*/
+
+    VTABLE void push_string(STRING *s) {
+        STRING          *buffer;
+        size_t           total_size;
+        const CHARSET   *cs;
+        const ENCODING  *enc = NULL;
+
+        /* Early return on NULL strings */
+        if (STRING_IS_NULL(s))
+            return;
+
+        GET_ATTR_buffer(INTERP, SELF, buffer);
+
+        /* If strings are incompatible - convert them */
+        /* TODO Ask chromatic why in Parrot_str_join he ignored charset */
+        cs = Parrot_str_rep_compatible(interp, buffer, s, &enc);
+        if (!cs) {
+            cs = Parrot_unicode_charset_ptr;
+            enc = (buffer->encoding == Parrot_utf16_encoding_ptr
+               ||  s->encoding == Parrot_utf16_encoding_ptr
+               ||  buffer->encoding == Parrot_ucs2_encoding_ptr
+               ||  s->encoding == Parrot_ucs2_encoding_ptr)
+                ? Parrot_utf16_encoding_ptr
+                : Parrot_utf8_encoding_ptr;
+
+            buffer = Parrot_unicode_charset_ptr->to_charset(interp, buffer);
+            s      = Parrot_unicode_charset_ptr->to_charset(interp, s);
+
+            SET_ATTR_buffer(INTERP, SELF, buffer);
+        }
+
+        /* Calculate (possibly new) total size */
+        total_size = calculate_capacity(INTERP, buffer->bufused, s->bufused);
+
+        /* Reallocate if necessary */
+        if (total_size > Buffer_buflen(buffer))
+            Parrot_gc_reallocate_string_storage(INTERP, buffer, total_size);
+
+        /* Tack s on the end of buffer */
+        mem_sys_memcopy((void *)((ptrcast_t)buffer->strstart + buffer->bufused),
+                s->strstart, s->bufused);
+
+        /* Update buffer */
+        buffer->bufused += s->bufused;
+        buffer->strlen  += Parrot_str_length(INTERP, s);
+
+        PARROT_ASSERT(buffer->bufused <= Buffer_buflen(buffer));
+    }
+
+/*
+
+=item C<VTABLE i_concatenate_str()
+
+=item C<VTABLE i_concatenate()
+
+Append string. Synonym for push_string
+
+=cut
+
+*/
+
+    VTABLE void i_concatenate_str(STRING *s) {
+        SELF.push_string(s);
+    }
+
+    VTABLE void i_concatenate(PMC *p) {
+        SELF.push_string(VTABLE_get_string(INTERP, p));
+    }
+
+/*
+
+=item C<VTABLE set_string_native()>
+
+Set content of buffer to passed string
+
+=cut
+
+*/
+    VTABLE void set_string_native(STRING *s) {
+        SET_ATTR_buffer(INTERP, SELF, Parrot_str_clone(INTERP, s));
+    }
+
+
+/*
+
+=item C<VTABLE get_integer()>
+
+Returns current capacity of allocated buffer.
+
+For testing purpose only?
+
+=cut
+
+*/
+    INTVAL get_integer() {
+        STRING *buffer;
+        GET_ATTR_buffer(INTERP, SELF, buffer);
+        return Buffer_buflen(buffer);
+    }
+
+/*
+
+=back
+
+=cut
+
+*/
+
+}
+
+
+/*
+
+=head2 Helper functions.
+
+=over 4
+
+=cut
+
+*/
+
+/*
+
+=item C<static size_t calculate_capacity(PARROT_INTERP, size_t current, size_t
+additional)>
+
+Calculate capacity for string. Usually StringBuilders used for "large"
+strings. So capacity rounded up by next algorithm:
+  - By 128 bytes if total capacity less then 1KB
+  - By 1KB if total less than 4KB
+  - By 4KB if total less than 1MB
+  - By 1MB otherwise.
+
+This function is subject for tuning on real-world usage scenarios.
+
+=back
+
+=cut
+
+*/
+
+static size_t
+calculate_capacity(SHIM_INTERP, size_t current, size_t additional)
+{
+    ASSERT_ARGS(calculate_capacity)
+    size_t total_size = current + additional;
+    if (total_size < 1024)
+        total_size = (total_size / 128 + 1) * 128;
+    else if (total_size < 4096)
+        total_size = (total_size / 1024 + 1) * 1024;
+    else if (total_size < 1024*1024)
+        total_size = (total_size / 4096 + 1) * 4096;
+    else
+        total_size = (total_size / 1024 / 1024 + 1) * 1024 * 1024;
+
+    return total_size;
+}
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/codestring/src/string/api.c
==============================================================================
--- branches/codestring/src/string/api.c	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/src/string/api.c	Thu May  6 14:34:34 2010	(r46358)
@@ -294,6 +294,32 @@
     return NULL;
 }
 
+/*
+
+=item C<const CHARSET * Parrot_str_rep_compatible(PARROT_INTERP, const STRING
+*a, const STRING *b, const ENCODING **e)>
+
+Find the "lowest" possible charset and encoding for the given string. E.g.
+
+  ascii <op> utf8 => utf8
+                  => ascii, B<if> C<STRING *b> has ascii chars only.
+
+Returns NULL, if no compatible string representation can be found.
+
+=cut
+
+*/
+
+PARROT_INLINE
+PARROT_IGNORABLE_RESULT
+PARROT_CAN_RETURN_NULL
+const CHARSET *
+Parrot_str_rep_compatible(PARROT_INTERP,
+    ARGIN(const STRING *a), ARGIN(const STRING *b), ARGOUT(const ENCODING **e))
+{
+    ASSERT_ARGS(Parrot_str_rep_compatible)
+    return string_rep_compatible(interp, a, b, e);
+}
 
 /*
 
@@ -2213,7 +2239,7 @@
 Parrot_str_pin(SHIM_INTERP, ARGMOD(STRING *s))
 {
     ASSERT_ARGS(Parrot_str_pin)
-    size_t size   = Buffer_buflen(s);
+    const size_t size = Buffer_buflen(s);
     char  *memory = (char *)mem_internal_allocate(size);
 
     mem_sys_memcopy(memory, Buffer_bufstart(s), size);
@@ -3044,7 +3070,7 @@
 
 /*
 
-=item C<PMC* Parrot_str_split(PARROT_INTERP, STRING *delim, STRING *str)>
+=item C<PMC* Parrot_str_split(PARROT_INTERP, const STRING *delim, STRING *str)>
 
 Splits the string C<str> at the delimiter C<delim>, returning a
 C<ResizableStringArray>, or his mapped type in the current HLL, of results.
@@ -3059,7 +3085,7 @@
 PARROT_CAN_RETURN_NULL
 PMC*
 Parrot_str_split(PARROT_INTERP,
-    ARGIN_NULLOK(STRING *delim), ARGIN_NULLOK(STRING *str))
+    ARGIN_NULLOK(const STRING *delim), ARGIN_NULLOK(STRING *str))
 {
     ASSERT_ARGS(Parrot_str_split)
     PMC    *res;

Copied: branches/codestring/t/distro/manifest_generated.t (from r46357, trunk/t/distro/manifest_generated.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/codestring/t/distro/manifest_generated.t	Thu May  6 14:34:34 2010	(r46358, copy of r46357, trunk/t/distro/manifest_generated.t)
@@ -0,0 +1,61 @@
+#! perl
+# Copyright (C) 2001-2010, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use Test::More;
+plan(tests => 5);
+
+=head1 NAME
+
+t/distro/manifest_generated.t - check sanity of MANIFEST.generated file
+
+=head1 SYNOPSIS
+
+    % prove t/distro/manifest_generated.t
+
+=head1 DESCRIPTION
+
+Checks that MANIFEST.generated is in the required format (eg: sorted) and that it
+contains appropriate items (eg: PMC generated files).
+
+=cut
+
+ok( -e 'MANIFEST.generated', 'MANIFEST.generated exists' );
+
+# slurp MANIFEST.generated, ignoring comment lines
+open my $fh, '<', 'MANIFEST.generated'
+    or die "open MANIFEST.generated: $!";
+my @contents = grep {!/^#/} map {chomp; $_} <$fh>;
+close $fh;
+
+is_deeply([sort @contents], \@contents, 'MANIFEST.generated is sorted');
+
+# parse records
+my @records;
+is_deeply(  [grep {
+        my $match = m/^ (\S+) \s+ (\[ \w* \] \w*) $/x;
+        push @records, [$1, $2] if $match;
+        not $match } @contents],
+        [],
+        'MANIFEST.generated contains no irregular records' );
+
+# check for appropriate contents
+my %contained_files = map {$$_[0] => 1} @records;
+is_deeply(  [],
+        [grep {not exists $contained_files{$_}} glob('include/pmc/*.h')],
+        'MANIFEST.generated lists all core PMC headers' );
+
+is_deeply(  [],
+        [grep {not exists $contained_files{$_}} glob('src/pmc/*.dump')],
+        'MANIFEST.generated lists all core PMC dump files' )
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/codestring/t/dynpmc/gziphandle.t
==============================================================================
--- branches/codestring/t/dynpmc/gziphandle.t	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/t/dynpmc/gziphandle.t	Thu May  6 14:34:34 2010	(r46358)
@@ -22,7 +22,7 @@
     .local pmc config_hash, interp
     .local int num_tests
 
-    num_tests = 3
+    num_tests = 5
     plan(num_tests)
     interp = getinterp
     config_hash = interp[.IGLOBALS_CONFIG_HASH]
@@ -32,6 +32,7 @@
     $P0 = loadlib 'gziphandle'
     test_handle()
     test_version()
+    test_basic()
     .return()
 
   no_zlib:
@@ -56,6 +57,15 @@
     is($I0, 0, 'zlib version')
 .end
 
+.sub 'test_basic'
+    $P0 = new 'GzipHandle'
+    .const string data = "message"
+    $I0 = $P0.'crc32'(0, data)
+    ok($I0, "crc32")
+    $S0 = $P0.'compress'(data)
+    $I0 = length $S0
+    is($I0, 15, "compress")
+.end
 
 # Local Variables:
 #   mode: pir

Copied: branches/codestring/t/library/archive_zip.t (from r46357, trunk/t/library/archive_zip.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/codestring/t/library/archive_zip.t	Thu May  6 14:34:34 2010	(r46358, copy of r46357, trunk/t/library/archive_zip.t)
@@ -0,0 +1,72 @@
+#!./parrot
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/library/archive_zip.t
+
+=head1 DESCRIPTION
+
+Test the Archive/Zip library
+
+=head1 SYNOPSIS
+
+    % prove t/library/archive_zip.t
+
+=cut
+
+.sub 'main' :main
+    .include 'test_more.pir'
+
+    load_bytecode 'Archive/Zip.pir'
+
+    plan(14)
+    test_new()
+    test_pack()
+.end
+
+.sub 'test_new'
+    $P0 = new ['Archive';'Zip']
+    $I0 = isa $P0, ['Archive';'Zip']
+    ok($I0, "new ['Archive';'Zip']")
+    $I0 = isa $P0, ['Archive';'Zip';'Base']
+    ok($I0, "is a ['Archive';'Zip';'Base']")
+    $P0 = new ['Archive';'Zip';'Member']
+    $I0 = isa $P0, ['Archive';'Zip';'Member']
+    ok($I0, "new ['Archive';'Zip';'Member']")
+    $I0 = isa $P0, ['Archive';'Zip';'Base']
+    ok($I0, "is a ['Archive';'Zip';'Base']")
+    $P0 = new ['Archive';'Zip';'FileMember']
+    $I0 = isa $P0, ['Archive';'Zip';'FileMember']
+    ok($I0, "new ['Archive';'Zip';'FileMember']")
+    $I0 = isa $P0, ['Archive';'Zip';'Member']
+    ok($I0, "is a ['Archive';'Zip';'Member']")
+    $P0 = new ['Archive';'Zip';'NewFileMember']
+    $I0 = isa $P0, ['Archive';'Zip';'NewFileMember']
+    ok($I0, "new ['Archive';'Zip';'NewFileMember']")
+    $I0 = isa $P0, ['Archive';'Zip';'FileMember']
+    ok($I0, "is a ['Archive';'Zip';'FileMember']")
+.end
+
+.sub 'test_pack'
+    $P0 = new ['Archive';'Zip']
+    $S0 = $P0.'pack_C'(0x12)
+    is( $S0, "\x12", "pack C (unsigned char)" )
+    $I0 = length $S0
+    is( $I0, 1 )
+    $S0 = $P0.'pack_v'(0x1234)
+    is( $S0, "\x34\x12", "pack v (16bits litle endian)" )
+    $I0 = length $S0
+    is( $I0, 2 )
+    $S0 = $P0.'pack_V'(0x12345678)
+    is( $S0, "\x78\x56\x34\x12", "pack V (32bits litle endian)" )
+    $I0 = length $S0
+    is( $I0, 4 )
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/codestring/t/native_pbc/annotations.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/codestring/t/native_pbc/integer_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/codestring/t/native_pbc/number_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/codestring/t/native_pbc/string_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Copied: branches/codestring/t/pmc/stringbuilder.t (from r46357, trunk/t/pmc/stringbuilder.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/codestring/t/pmc/stringbuilder.t	Thu May  6 14:34:34 2010	(r46358, copy of r46357, trunk/t/pmc/stringbuilder.t)
@@ -0,0 +1,147 @@
+#!./parrot
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pmc/stringbuilder.t - StringBuilder
+
+=head1 SYNOPSIS
+
+    % prove t/pmc/stringbuilder.t
+
+=head1 DESCRIPTION
+
+Tests the C<StringBuilder> PMC.
+
+=cut
+
+
+.sub 'main' :main
+    .include 'test_more.pir'
+
+    plan(17)
+    test_create()               # 2 tests
+    test_push_string()          # 9 tests
+    test_push_string_unicode()  # 1 test
+    test_i_concatenate()        # 1 test
+    test_set_string_native()    # 3 tests
+
+    # END_OF_TESTS
+.end
+
+.sub 'test_create'
+    .local pmc sb
+    sb = new ['StringBuilder']
+
+    $I0 = isnull sb
+    not $I0
+    ok( $I0, 'StringBuilder created' )
+
+    $S0 = sb
+    is( $S0, '', '... with empty content')
+
+.end
+
+.sub 'test_push_string'
+    .local pmc sb
+    sb = new ["StringBuilder"]
+
+    push sb, "foo"
+    $S0 = sb
+    is( $S0, "foo", "First string pushed")
+
+    push sb, "bar"
+    $S1 = sb
+    is( $S1, "foobar", "Second string pushed")
+
+    is( $S0, "foo", "... without clobbering first string")
+
+    $I0 = sb
+    is( $I0, 128, "... and capacity still 128" )
+
+    # Push large string which will cause reallocate
+    $S99 = repeat "x", 128
+    push sb, $S99
+
+    $S0 = concat "foobar", $S99
+    $S1 = sb
+    is( $S0, $S1, "Push 128 chars string works")
+
+    $I0 = sb
+    is( $I0, 256, "... and capacity increased" )
+
+    $S99 = repeat "x", 1000
+    push sb, $S99
+
+    $S0 = concat $S0, $S99
+    $S1 = sb
+    is( $S0, $S1, "Push 1000 chars string works")
+
+    $I0 = sb
+    is( $I0, 2048, "... and capacity increased" )
+
+    $S99 = repeat "x", 12000
+    push sb, $S99
+
+    $S0 = concat $S0, $S99
+    $S1 = sb
+    is( $S0, $S1, "Push 10000 chars string works")
+
+    $I0 = sb
+    is( $I0, 16384, "... and capacity increased" )
+
+.end
+
+.sub 'test_push_string_unicode'
+    .local pmc sb
+    sb = new ["StringBuilder"]
+
+    push sb, "le"
+    push sb, unicode:"o "
+    push sb, iso-8859-1:"tötsch"
+
+    $S0 = sb
+    is( $S0, iso-8859-1:"leo tötsch", "Unicode strings appened")
+.end
+
+.sub 'test_i_concatenate'
+    .local pmc sb
+    sb = new ["StringBuilder"]
+
+    concat sb, "foo"
+
+    $P0 = new ["String"]
+    $P0 = "bar"
+    concat sb, $P0
+
+    sb .= "baz"
+
+    $S0 = sb
+    is( $S0, "foobarbaz", "StringBuilder handles concat properly")
+
+.end
+
+.sub 'test_set_string_native'
+    .local pmc sb
+    sb = new ["StringBuilder"]
+
+    $S99 = "foo"
+    sb   = $S99
+
+    $S0  = sb
+    is( $S0, "foo", "Assignment works")
+
+    sb .= "bar"
+    $S0  = sb
+    is( $S0, "foobar", "... with appending string after")
+    is( $S99, "foo", "... without touching of original string")
+
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+

Modified: branches/codestring/tools/dev/pbc_to_exe.pir
==============================================================================
--- branches/codestring/tools/dev/pbc_to_exe.pir	Thu May  6 14:20:15 2010	(r46357)
+++ branches/codestring/tools/dev/pbc_to_exe.pir	Thu May  6 14:34:34 2010	(r46358)
@@ -221,7 +221,7 @@
     .local pmc codestring
     .local int size
 
-    codestring = new [ 'ResizableStringArray' ]
+    codestring = new [ 'StringBuilder' ]
     push codestring, "const Parrot_UInt1 program_code[] = {"
     size = 0
 
@@ -248,10 +248,6 @@
     push codestring, "\n"
     goto code_loop
   code_done:
-    # Join current strings to avoid storing too much
-    $S0 = join '', codestring
-    codestring = 0
-    push codestring, $S0
     goto read_loop
 
   read_done:
@@ -268,7 +264,7 @@
         }
 END_OF_FUNCTION
 
-    $S0 = join '', codestring
+    $S0 = codestring
     .return ($S0)
 
   err_infile:
@@ -317,7 +313,7 @@
     .local pmc codestring
     .local int size
 
-    codestring = new ['ResizableStringArray']
+    codestring = new ['StringBuilder']
 
     push codestring, "const char * program_code =\n"
     push codestring, '"'
@@ -347,10 +343,6 @@
     push codestring, '"'
     goto code_loop
   code_done:
-    # Join current strings to avoid storing too much
-    $S0 = join '', codestring
-    codestring = 0
-    push codestring, $S0
     goto read_loop
 
   read_done:
@@ -370,7 +362,7 @@
         }
 END_OF_FUNCTION
 
-    $S0 = join '', codestring
+    $S0 = codestring
     .return ($S0)
 
   err_infile:
@@ -453,7 +445,7 @@
 
 
     .local pmc codestring
-    codestring  = new [ 'ResizableStringArray' ]
+    codestring  = new [ 'StringBuilder' ]
     push codestring, "#include <windows.h>\n"
     push codestring, rc_constant_defines
     push codestring, "const unsigned int bytecode_size = "
@@ -505,7 +497,7 @@
     die "RC command failed"
 
   rc_ok:
-    $S0 = join '', codestring
+    $S0 = codestring
     .return ($S0)
 
   err_h_open:


More information about the parrot-commits mailing list