From 679147eead574d186ebf3069647b4c23e8ccace6 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Thu, 15 Aug 2013 21:46:11 +0200 Subject: Initial import. --- chromium/third_party/snappy/OWNERS | 6 + chromium/third_party/snappy/README.chromium | 18 + chromium/third_party/snappy/linux/config.h | 108 + .../third_party/snappy/linux/snappy-stubs-public.h | 85 + chromium/third_party/snappy/mac/config.h | 108 + .../third_party/snappy/mac/snappy-stubs-public.h | 85 + chromium/third_party/snappy/snappy.gyp | 78 + chromium/third_party/snappy/src/AUTHORS | 1 + chromium/third_party/snappy/src/COPYING | 28 + chromium/third_party/snappy/src/ChangeLog | 1618 +++ chromium/third_party/snappy/src/Makefile.am | 23 + chromium/third_party/snappy/src/NEWS | 104 + chromium/third_party/snappy/src/README | 135 + chromium/third_party/snappy/src/autogen.sh | 7 + chromium/third_party/snappy/src/configure.ac | 126 + .../third_party/snappy/src/format_description.txt | 110 + chromium/third_party/snappy/src/framing_format.txt | 124 + chromium/third_party/snappy/src/m4/gtest.m4 | 74 + chromium/third_party/snappy/src/snappy-c.cc | 90 + chromium/third_party/snappy/src/snappy-c.h | 138 + chromium/third_party/snappy/src/snappy-internal.h | 150 + .../third_party/snappy/src/snappy-sinksource.cc | 71 + .../third_party/snappy/src/snappy-sinksource.h | 137 + .../snappy/src/snappy-stubs-internal.cc | 42 + .../third_party/snappy/src/snappy-stubs-internal.h | 491 + .../snappy/src/snappy-stubs-public.h.in | 85 + chromium/third_party/snappy/src/snappy-test.cc | 606 ++ chromium/third_party/snappy/src/snappy-test.h | 580 + chromium/third_party/snappy/src/snappy.cc | 1119 ++ chromium/third_party/snappy/src/snappy.h | 163 + chromium/third_party/snappy/src/snappy_unittest.cc | 1164 ++ .../third_party/snappy/src/testdata/alice29.txt | 3609 +++++++ .../third_party/snappy/src/testdata/asyoulik.txt | 4122 +++++++ .../snappy/src/testdata/baddata1.snappy | Bin 0 -> 27512 bytes .../snappy/src/testdata/baddata2.snappy | Bin 0 -> 27483 bytes .../snappy/src/testdata/baddata3.snappy | Bin 0 -> 28384 bytes chromium/third_party/snappy/src/testdata/cp.html | 645 ++ chromium/third_party/snappy/src/testdata/fields.c | 431 + .../third_party/snappy/src/testdata/geo.protodata | Bin 0 -> 118588 bytes .../third_party/snappy/src/testdata/grammar.lsp | 94 + chromium/third_party/snappy/src/testdata/house.jpg | Bin 0 -> 126958 bytes chromium/third_party/snappy/src/testdata/html | 1 + chromium/third_party/snappy/src/testdata/html_x_4 | 1 + .../third_party/snappy/src/testdata/kennedy.xls | Bin 0 -> 1029744 bytes chromium/third_party/snappy/src/testdata/kppkn.gtb | Bin 0 -> 184320 bytes .../third_party/snappy/src/testdata/lcet10.txt | 7519 +++++++++++++ .../snappy/src/testdata/mapreduce-osdi-1.pdf | Bin 0 -> 94330 bytes .../third_party/snappy/src/testdata/plrabn12.txt | 10699 +++++++++++++++++++ chromium/third_party/snappy/src/testdata/ptt5 | Bin 0 -> 513216 bytes chromium/third_party/snappy/src/testdata/sum | Bin 0 -> 38240 bytes chromium/third_party/snappy/src/testdata/urls.10K | 10000 +++++++++++++++++ chromium/third_party/snappy/src/testdata/xargs.1 | 112 + .../third_party/snappy/win32/snappy-stubs-public.h | 85 + 53 files changed, 44992 insertions(+) create mode 100644 chromium/third_party/snappy/OWNERS create mode 100644 chromium/third_party/snappy/README.chromium create mode 100644 chromium/third_party/snappy/linux/config.h create mode 100644 chromium/third_party/snappy/linux/snappy-stubs-public.h create mode 100644 chromium/third_party/snappy/mac/config.h create mode 100644 chromium/third_party/snappy/mac/snappy-stubs-public.h create mode 100644 chromium/third_party/snappy/snappy.gyp create mode 100644 chromium/third_party/snappy/src/AUTHORS create mode 100644 chromium/third_party/snappy/src/COPYING create mode 100644 chromium/third_party/snappy/src/ChangeLog create mode 100644 chromium/third_party/snappy/src/Makefile.am create mode 100644 chromium/third_party/snappy/src/NEWS create mode 100644 chromium/third_party/snappy/src/README create mode 100755 chromium/third_party/snappy/src/autogen.sh create mode 100644 chromium/third_party/snappy/src/configure.ac create mode 100644 chromium/third_party/snappy/src/format_description.txt create mode 100644 chromium/third_party/snappy/src/framing_format.txt create mode 100644 chromium/third_party/snappy/src/m4/gtest.m4 create mode 100644 chromium/third_party/snappy/src/snappy-c.cc create mode 100644 chromium/third_party/snappy/src/snappy-c.h create mode 100644 chromium/third_party/snappy/src/snappy-internal.h create mode 100644 chromium/third_party/snappy/src/snappy-sinksource.cc create mode 100644 chromium/third_party/snappy/src/snappy-sinksource.h create mode 100644 chromium/third_party/snappy/src/snappy-stubs-internal.cc create mode 100644 chromium/third_party/snappy/src/snappy-stubs-internal.h create mode 100644 chromium/third_party/snappy/src/snappy-stubs-public.h.in create mode 100644 chromium/third_party/snappy/src/snappy-test.cc create mode 100644 chromium/third_party/snappy/src/snappy-test.h create mode 100644 chromium/third_party/snappy/src/snappy.cc create mode 100644 chromium/third_party/snappy/src/snappy.h create mode 100644 chromium/third_party/snappy/src/snappy_unittest.cc create mode 100644 chromium/third_party/snappy/src/testdata/alice29.txt create mode 100644 chromium/third_party/snappy/src/testdata/asyoulik.txt create mode 100644 chromium/third_party/snappy/src/testdata/baddata1.snappy create mode 100644 chromium/third_party/snappy/src/testdata/baddata2.snappy create mode 100644 chromium/third_party/snappy/src/testdata/baddata3.snappy create mode 100644 chromium/third_party/snappy/src/testdata/cp.html create mode 100644 chromium/third_party/snappy/src/testdata/fields.c create mode 100644 chromium/third_party/snappy/src/testdata/geo.protodata create mode 100644 chromium/third_party/snappy/src/testdata/grammar.lsp create mode 100644 chromium/third_party/snappy/src/testdata/house.jpg create mode 100644 chromium/third_party/snappy/src/testdata/html create mode 100644 chromium/third_party/snappy/src/testdata/html_x_4 create mode 100644 chromium/third_party/snappy/src/testdata/kennedy.xls create mode 100644 chromium/third_party/snappy/src/testdata/kppkn.gtb create mode 100644 chromium/third_party/snappy/src/testdata/lcet10.txt create mode 100644 chromium/third_party/snappy/src/testdata/mapreduce-osdi-1.pdf create mode 100644 chromium/third_party/snappy/src/testdata/plrabn12.txt create mode 100644 chromium/third_party/snappy/src/testdata/ptt5 create mode 100644 chromium/third_party/snappy/src/testdata/sum create mode 100644 chromium/third_party/snappy/src/testdata/urls.10K create mode 100644 chromium/third_party/snappy/src/testdata/xargs.1 create mode 100644 chromium/third_party/snappy/win32/snappy-stubs-public.h (limited to 'chromium/third_party/snappy') diff --git a/chromium/third_party/snappy/OWNERS b/chromium/third_party/snappy/OWNERS new file mode 100644 index 00000000000..ae0fc4845d0 --- /dev/null +++ b/chromium/third_party/snappy/OWNERS @@ -0,0 +1,6 @@ +dgrogan@chromium.org +alecflett@chromium.org +jsbell@chromium.org +kinuko@chromium.org +michaeln@chromium.org +ericu@chromium.org diff --git a/chromium/third_party/snappy/README.chromium b/chromium/third_party/snappy/README.chromium new file mode 100644 index 00000000000..358a5f37420 --- /dev/null +++ b/chromium/third_party/snappy/README.chromium @@ -0,0 +1,18 @@ +Name: Snappy: A fast compressor/decompressor +Short Name: snappy +URL: http://code.google.com/p/snappy/ +Version: r74 +License: New BSD +License File: src/COPYING +Security Critical: yes + +Description: +Compression library used by LevelDB. + +Local Additions: +* gyp file for building in chromium + * Suppress clang header-hygiene warning - https://code.google.com/p/snappy/issues/detail?id=70 + * Suppress MSVC signed/unsigned warning - https://code.google.com/p/snappy/issues/detail?id=71 + * Suppress MSVC x64 size_t warnings - https://code.google.com/p/snappy/issues/detail?id=75 +* {mac,linux}/config.h autogenerated configuration script +* {mac,linux,win}/snappy-stubs-public.h autogenerated public headers diff --git a/chromium/third_party/snappy/linux/config.h b/chromium/third_party/snappy/linux/config.h new file mode 100644 index 00000000000..d993481e6aa --- /dev/null +++ b/chromium/third_party/snappy/linux/config.h @@ -0,0 +1,108 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to 1 if the compiler supports __builtin_ctz and friends. */ +#define HAVE_BUILTIN_CTZ 1 + +/* Define to 1 if the compiler supports __builtin_expect. */ +#define HAVE_BUILTIN_EXPECT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Use the gflags package for command-line parsing. */ +/* #undef HAVE_GFLAGS */ + +/* Defined when Google Test is available. */ +/* #undef HAVE_GTEST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `fastlz' library (-lfastlz). */ +/* #undef HAVE_LIBFASTLZ */ + +/* Define to 1 if you have the `lzf' library (-llzf). */ +/* #undef HAVE_LIBLZF */ + +/* Define to 1 if you have the `lzo2' library (-llzo2). */ +/* #undef HAVE_LIBLZO2 */ + +/* Define to 1 if you have the `quicklz' library (-lquicklz). */ +/* #undef HAVE_LIBQUICKLZ */ + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "snappy" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "snappy" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "snappy 1.0.5" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "snappy" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.0.5" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.0.5" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif diff --git a/chromium/third_party/snappy/linux/snappy-stubs-public.h b/chromium/third_party/snappy/linux/snappy-stubs-public.h new file mode 100644 index 00000000000..9ee4ca52b35 --- /dev/null +++ b/chromium/third_party/snappy/linux/snappy-stubs-public.h @@ -0,0 +1,85 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// Author: sesse@google.com (Steinar H. Gunderson) +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various type stubs for the open-source version of Snappy. +// +// This file cannot include config.h, as it is included from snappy.h, +// which is a public header. Instead, snappy-stubs-public.h is generated by +// from snappy-stubs-public.h.in at configure time. + +#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ +#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ + +#if 1 +#include +#endif + +#if 1 +#include +#endif + +#define SNAPPY_MAJOR 1 +#define SNAPPY_MINOR 0 +#define SNAPPY_PATCHLEVEL 5 +#define SNAPPY_VERSION \ + ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) + +#include + +namespace snappy { + +#if 1 +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#else +typedef signed char int8; +typedef unsigned char uint8; +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned int uint32; +typedef long long int64; +typedef unsigned long long uint64; +#endif + +typedef std::string string; + +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) + +} // namespace snappy + +#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ diff --git a/chromium/third_party/snappy/mac/config.h b/chromium/third_party/snappy/mac/config.h new file mode 100644 index 00000000000..d993481e6aa --- /dev/null +++ b/chromium/third_party/snappy/mac/config.h @@ -0,0 +1,108 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to 1 if the compiler supports __builtin_ctz and friends. */ +#define HAVE_BUILTIN_CTZ 1 + +/* Define to 1 if the compiler supports __builtin_expect. */ +#define HAVE_BUILTIN_EXPECT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Use the gflags package for command-line parsing. */ +/* #undef HAVE_GFLAGS */ + +/* Defined when Google Test is available. */ +/* #undef HAVE_GTEST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `fastlz' library (-lfastlz). */ +/* #undef HAVE_LIBFASTLZ */ + +/* Define to 1 if you have the `lzf' library (-llzf). */ +/* #undef HAVE_LIBLZF */ + +/* Define to 1 if you have the `lzo2' library (-llzo2). */ +/* #undef HAVE_LIBLZO2 */ + +/* Define to 1 if you have the `quicklz' library (-lquicklz). */ +/* #undef HAVE_LIBQUICKLZ */ + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "snappy" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "snappy" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "snappy 1.0.5" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "snappy" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.0.5" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.0.5" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif diff --git a/chromium/third_party/snappy/mac/snappy-stubs-public.h b/chromium/third_party/snappy/mac/snappy-stubs-public.h new file mode 100644 index 00000000000..9ee4ca52b35 --- /dev/null +++ b/chromium/third_party/snappy/mac/snappy-stubs-public.h @@ -0,0 +1,85 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// Author: sesse@google.com (Steinar H. Gunderson) +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various type stubs for the open-source version of Snappy. +// +// This file cannot include config.h, as it is included from snappy.h, +// which is a public header. Instead, snappy-stubs-public.h is generated by +// from snappy-stubs-public.h.in at configure time. + +#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ +#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ + +#if 1 +#include +#endif + +#if 1 +#include +#endif + +#define SNAPPY_MAJOR 1 +#define SNAPPY_MINOR 0 +#define SNAPPY_PATCHLEVEL 5 +#define SNAPPY_VERSION \ + ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) + +#include + +namespace snappy { + +#if 1 +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#else +typedef signed char int8; +typedef unsigned char uint8; +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned int uint32; +typedef long long int64; +typedef unsigned long long uint64; +#endif + +typedef std::string string; + +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) + +} // namespace snappy + +#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ diff --git a/chromium/third_party/snappy/snappy.gyp b/chromium/third_party/snappy/snappy.gyp new file mode 100644 index 00000000000..e6e94d0c1b0 --- /dev/null +++ b/chromium/third_party/snappy/snappy.gyp @@ -0,0 +1,78 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ +'variables': { + 'conditions': [ + # Define an "os_include" variable that points at the OS-specific generated + # headers. These were generated by running the configure script offline. + ['os_posix == 1 and OS != "mac"', { + 'os_include': 'linux' + }], + ['OS=="mac"', {'os_include': 'mac'}], + ['OS=="win"', {'os_include': 'win32'}], + ], + 'use_system_libxml%': 0, + }, + 'targets': [ + { + 'target_name': 'snappy', + 'type': 'static_library', + 'include_dirs': [ + '<(os_include)', + 'src', + '../..', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '<(os_include)', + 'src', + ], + }, + 'sources': [ + 'src/snappy-internal.h', + 'src/snappy-sinksource.cc', + 'src/snappy-sinksource.h', + 'src/snappy-stubs-internal.cc', + 'src/snappy-stubs-internal.h', + 'src/snappy.cc', + 'src/snappy.h', + ], + 'conditions': [ + ['OS=="win"', { + # Signed/unsigned comparison + 'msvs_disabled_warnings': [ + # https://code.google.com/p/snappy/issues/detail?id=71 + 4018, + # https://code.google.com/p/snappy/issues/detail?id=75 + 4267, + ], + }], + ['clang == 1', { + # snappy-stubs-internal.h unapologetically has: using namespace std + # https://code.google.com/p/snappy/issues/detail?id=70 + 'xcode_settings': { + 'WARNING_CFLAGS!': [ '-Wheader-hygiene' ], + }, + 'cflags!': [ '-Wheader-hygiene' ], + }], + ], + }, + { + 'target_name': 'snappy_unittest', + 'type': 'executable', + 'sources': [ + 'src/snappy-test.cc', + 'src/snappy-test.h', + 'src/snappy_unittest.cc', + ], + 'dependencies': [ + 'snappy', + '../../base/base.gyp:base', + '../../testing/gtest.gyp:gtest', + '../../third_party/zlib/zlib.gyp:zlib', + ], + }, + ], +} diff --git a/chromium/third_party/snappy/src/AUTHORS b/chromium/third_party/snappy/src/AUTHORS new file mode 100644 index 00000000000..4858b377c74 --- /dev/null +++ b/chromium/third_party/snappy/src/AUTHORS @@ -0,0 +1 @@ +opensource@google.com diff --git a/chromium/third_party/snappy/src/COPYING b/chromium/third_party/snappy/src/COPYING new file mode 100644 index 00000000000..8d6bd9fed4e --- /dev/null +++ b/chromium/third_party/snappy/src/COPYING @@ -0,0 +1,28 @@ +Copyright 2011, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/chromium/third_party/snappy/src/ChangeLog b/chromium/third_party/snappy/src/ChangeLog new file mode 100644 index 00000000000..10aa968a4d2 --- /dev/null +++ b/chromium/third_party/snappy/src/ChangeLog @@ -0,0 +1,1618 @@ +------------------------------------------------------------------------ +r72 | snappy.mirrorbot@gmail.com | 2013-02-05 15:30:05 +0100 (Tue, 05 Feb 2013) | 9 lines + +Make ./snappy_unittest pass without "srcdir" being defined. + +Previously, snappy_unittests would read from an absolute path /testdata/..; +convert it to use a relative path instead. + +Patch from Marc-Antonie Ruel. + +R=maruel + +------------------------------------------------------------------------ +r71 | snappy.mirrorbot@gmail.com | 2013-01-18 13:16:36 +0100 (Fri, 18 Jan 2013) | 287 lines + +Increase the Zippy block size from 32 kB to 64 kB, winning ~3% density +while being effectively performance neutral. + +The longer story about density is that we win 3-6% density on the benchmarks +where this has any effect at all; many of the benchmarks (cp, c, lsp, man) +are smaller than 32 kB and thus will have no effect. Binary data also seems +to win little or nothing; of course, the already-compressed data wins nothing. +The protobuf benchmark wins as much as ~18% depending on architecture, +but I wouldn't be too sure that this is representative of protobuf data in +general. + +As of performance, we lose a tiny amount since we get more tags (e.g., a long +literal might be broken up into literal-copy-literal), but we win it back with +less clearing of the hash table, and more opportunities to skip incompressible +data (e.g. in the jpg benchmark). Decompression seems to get ever so slightly +slower, again due to more tags. The total net change is about as close to zero +as we can get, so the end effect seems to be simply more density and no +real performance change. + +The comment about not changing kBlockSize, scary as it is, is not really +relevant, since we're never going to have a block-level decompressor without +explicitly marked blocks. Replace it with something more appropriate. + +This affects the framing format, but it's okay to change it since it basically +has no users yet. + + +Density (note that cp, c, lsp and man are all smaller than 32 kB): + + Benchmark Description Base (%) New (%) Improvement + -------------------------------------------------------------- + ZFlat/0 html 22.57 22.31 +5.6% + ZFlat/1 urls 50.89 47.77 +6.5% + ZFlat/2 jpg 99.88 99.87 +0.0% + ZFlat/3 pdf 82.13 82.07 +0.1% + ZFlat/4 html4 23.55 22.51 +4.6% + ZFlat/5 cp 48.12 48.12 +0.0% + ZFlat/6 c 42.40 42.40 +0.0% + ZFlat/7 lsp 48.37 48.37 +0.0% + ZFlat/8 xls 41.34 41.23 +0.3% + ZFlat/9 txt1 59.81 57.87 +3.4% + ZFlat/10 txt2 64.07 61.93 +3.5% + ZFlat/11 txt3 57.11 54.92 +4.0% + ZFlat/12 txt4 68.35 66.22 +3.2% + ZFlat/13 bin 18.21 18.11 +0.6% + ZFlat/14 sum 51.88 48.96 +6.0% + ZFlat/15 man 59.36 59.36 +0.0% + ZFlat/16 pb 23.15 19.64 +17.9% + ZFlat/17 gaviota 38.27 37.72 +1.5% + Geometric mean 45.51 44.15 +3.1% + + +Microbenchmarks (64-bit, opt): + +Westmere 2.8 GHz: + + Benchmark Base (ns) New (ns) Improvement + ------------------------------------------------------------------------------------------------- + BM_UFlat/0 75342 75027 1.3GB/s html +0.4% + BM_UFlat/1 723767 744269 899.6MB/s urls -2.8% + BM_UFlat/2 10072 10072 11.7GB/s jpg +0.0% + BM_UFlat/3 30747 30388 2.9GB/s pdf +1.2% + BM_UFlat/4 307353 306063 1.2GB/s html4 +0.4% + BM_UFlat/5 28593 28743 816.3MB/s cp -0.5% + BM_UFlat/6 12958 12998 818.1MB/s c -0.3% + BM_UFlat/7 3700 3792 935.8MB/s lsp -2.4% + BM_UFlat/8 999685 999905 982.1MB/s xls -0.0% + BM_UFlat/9 232954 230079 630.4MB/s txt1 +1.2% + BM_UFlat/10 200785 201468 592.6MB/s txt2 -0.3% + BM_UFlat/11 617267 610968 666.1MB/s txt3 +1.0% + BM_UFlat/12 821595 822475 558.7MB/s txt4 -0.1% + BM_UFlat/13 377097 377632 1.3GB/s bin -0.1% + BM_UFlat/14 45476 45260 805.8MB/s sum +0.5% + BM_UFlat/15 4985 5003 805.7MB/s man -0.4% + BM_UFlat/16 80813 77494 1.4GB/s pb +4.3% + BM_UFlat/17 251792 241553 727.7MB/s gaviota +4.2% + BM_UValidate/0 40343 40354 2.4GB/s html -0.0% + BM_UValidate/1 426890 451574 1.4GB/s urls -5.5% + BM_UValidate/2 187 179 661.9GB/s jpg +4.5% + BM_UValidate/3 13783 13827 6.4GB/s pdf -0.3% + BM_UValidate/4 162393 163335 2.3GB/s html4 -0.6% + BM_UDataBuffer/0 93756 93302 1046.7MB/s html +0.5% + BM_UDataBuffer/1 886714 916292 730.7MB/s urls -3.2% + BM_UDataBuffer/2 15861 16401 7.2GB/s jpg -3.3% + BM_UDataBuffer/3 38934 39224 2.2GB/s pdf -0.7% + BM_UDataBuffer/4 381008 379428 1029.5MB/s html4 +0.4% + BM_UCord/0 92528 91098 1072.0MB/s html +1.6% + BM_UCord/1 858421 885287 756.3MB/s urls -3.0% + BM_UCord/2 13140 13464 8.8GB/s jpg -2.4% + BM_UCord/3 39012 37773 2.3GB/s pdf +3.3% + BM_UCord/4 376869 371267 1052.1MB/s html4 +1.5% + BM_UCordString/0 75810 75303 1.3GB/s html +0.7% + BM_UCordString/1 735290 753841 888.2MB/s urls -2.5% + BM_UCordString/2 11945 13113 9.0GB/s jpg -8.9% + BM_UCordString/3 33901 32562 2.7GB/s pdf +4.1% + BM_UCordString/4 310985 309390 1.2GB/s html4 +0.5% + BM_UCordValidate/0 40952 40450 2.4GB/s html +1.2% + BM_UCordValidate/1 433842 456531 1.4GB/s urls -5.0% + BM_UCordValidate/2 1179 1173 100.8GB/s jpg +0.5% + BM_UCordValidate/3 14481 14392 6.1GB/s pdf +0.6% + BM_UCordValidate/4 164364 164151 2.3GB/s html4 +0.1% + BM_ZFlat/0 160610 156601 623.6MB/s html (22.31 %) +2.6% + BM_ZFlat/1 1995238 1993582 335.9MB/s urls (47.77 %) +0.1% + BM_ZFlat/2 30133 24983 4.7GB/s jpg (99.87 %) +20.6% + BM_ZFlat/3 74453 73128 1.2GB/s pdf (82.07 %) +1.8% + BM_ZFlat/4 647674 633729 616.4MB/s html4 (22.51 %) +2.2% + BM_ZFlat/5 76259 76090 308.4MB/s cp (48.12 %) +0.2% + BM_ZFlat/6 31106 31084 342.1MB/s c (42.40 %) +0.1% + BM_ZFlat/7 10507 10443 339.8MB/s lsp (48.37 %) +0.6% + BM_ZFlat/8 1811047 1793325 547.6MB/s xls (41.23 %) +1.0% + BM_ZFlat/9 597903 581793 249.3MB/s txt1 (57.87 %) +2.8% + BM_ZFlat/10 525320 514522 232.0MB/s txt2 (61.93 %) +2.1% + BM_ZFlat/11 1596591 1551636 262.3MB/s txt3 (54.92 %) +2.9% + BM_ZFlat/12 2134523 2094033 219.5MB/s txt4 (66.22 %) +1.9% + BM_ZFlat/13 593024 587869 832.6MB/s bin (18.11 %) +0.9% + BM_ZFlat/14 114746 110666 329.5MB/s sum (48.96 %) +3.7% + BM_ZFlat/15 14376 14485 278.3MB/s man (59.36 %) -0.8% + BM_ZFlat/16 167908 150070 753.6MB/s pb (19.64 %) +11.9% + BM_ZFlat/17 460228 442253 397.5MB/s gaviota (37.72 %) +4.1% + BM_ZCord/0 164896 160241 609.4MB/s html +2.9% + BM_ZCord/1 2070239 2043492 327.7MB/s urls +1.3% + BM_ZCord/2 54402 47002 2.5GB/s jpg +15.7% + BM_ZCord/3 85871 83832 1073.1MB/s pdf +2.4% + BM_ZCord/4 664078 648825 602.0MB/s html4 +2.4% + BM_ZDataBuffer/0 174874 172549 566.0MB/s html +1.3% + BM_ZDataBuffer/1 2134410 2139173 313.0MB/s urls -0.2% + BM_ZDataBuffer/2 71911 69551 1.7GB/s jpg +3.4% + BM_ZDataBuffer/3 98236 99727 902.1MB/s pdf -1.5% + BM_ZDataBuffer/4 710776 699104 558.8MB/s html4 +1.7% + Sum of all benchmarks 27358908 27200688 +0.6% + + +Sandy Bridge 2.6 GHz: + + Benchmark Base (ns) New (ns) Improvement + ------------------------------------------------------------------------------------------------- + BM_UFlat/0 49356 49018 1.9GB/s html +0.7% + BM_UFlat/1 516764 531955 1.2GB/s urls -2.9% + BM_UFlat/2 6982 7304 16.2GB/s jpg -4.4% + BM_UFlat/3 15285 15598 5.6GB/s pdf -2.0% + BM_UFlat/4 206557 206669 1.8GB/s html4 -0.1% + BM_UFlat/5 13681 13567 1.7GB/s cp +0.8% + BM_UFlat/6 6571 6592 1.6GB/s c -0.3% + BM_UFlat/7 2008 1994 1.7GB/s lsp +0.7% + BM_UFlat/8 775700 773286 1.2GB/s xls +0.3% + BM_UFlat/9 165578 164480 881.8MB/s txt1 +0.7% + BM_UFlat/10 143707 144139 828.2MB/s txt2 -0.3% + BM_UFlat/11 443026 436281 932.8MB/s txt3 +1.5% + BM_UFlat/12 603129 595856 771.2MB/s txt4 +1.2% + BM_UFlat/13 271682 270450 1.8GB/s bin +0.5% + BM_UFlat/14 26200 25666 1.4GB/s sum +2.1% + BM_UFlat/15 2620 2608 1.5GB/s man +0.5% + BM_UFlat/16 48908 47756 2.3GB/s pb +2.4% + BM_UFlat/17 174638 170346 1031.9MB/s gaviota +2.5% + BM_UValidate/0 31922 31898 3.0GB/s html +0.1% + BM_UValidate/1 341265 363554 1.8GB/s urls -6.1% + BM_UValidate/2 160 151 782.8GB/s jpg +6.0% + BM_UValidate/3 10402 10380 8.5GB/s pdf +0.2% + BM_UValidate/4 129490 130587 2.9GB/s html4 -0.8% + BM_UDataBuffer/0 59383 58736 1.6GB/s html +1.1% + BM_UDataBuffer/1 619222 637786 1049.8MB/s urls -2.9% + BM_UDataBuffer/2 10775 11941 9.9GB/s jpg -9.8% + BM_UDataBuffer/3 18002 17930 4.9GB/s pdf +0.4% + BM_UDataBuffer/4 259182 259306 1.5GB/s html4 -0.0% + BM_UCord/0 59379 57814 1.6GB/s html +2.7% + BM_UCord/1 598456 615162 1088.4MB/s urls -2.7% + BM_UCord/2 8519 8628 13.7GB/s jpg -1.3% + BM_UCord/3 18123 17537 5.0GB/s pdf +3.3% + BM_UCord/4 252375 252331 1.5GB/s html4 +0.0% + BM_UCordString/0 49494 49790 1.9GB/s html -0.6% + BM_UCordString/1 524659 541803 1.2GB/s urls -3.2% + BM_UCordString/2 8206 8354 14.2GB/s jpg -1.8% + BM_UCordString/3 17235 16537 5.3GB/s pdf +4.2% + BM_UCordString/4 210188 211072 1.8GB/s html4 -0.4% + BM_UCordValidate/0 31956 31587 3.0GB/s html +1.2% + BM_UCordValidate/1 340828 362141 1.8GB/s urls -5.9% + BM_UCordValidate/2 783 744 158.9GB/s jpg +5.2% + BM_UCordValidate/3 10543 10462 8.4GB/s pdf +0.8% + BM_UCordValidate/4 130150 129789 2.9GB/s html4 +0.3% + BM_ZFlat/0 113873 111200 878.2MB/s html (22.31 %) +2.4% + BM_ZFlat/1 1473023 1489858 449.4MB/s urls (47.77 %) -1.1% + BM_ZFlat/2 23569 19486 6.1GB/s jpg (99.87 %) +21.0% + BM_ZFlat/3 49178 48046 1.8GB/s pdf (82.07 %) +2.4% + BM_ZFlat/4 475063 469394 832.2MB/s html4 (22.51 %) +1.2% + BM_ZFlat/5 46910 46816 501.2MB/s cp (48.12 %) +0.2% + BM_ZFlat/6 16883 16916 628.6MB/s c (42.40 %) -0.2% + BM_ZFlat/7 5381 5447 651.5MB/s lsp (48.37 %) -1.2% + BM_ZFlat/8 1466870 1473861 666.3MB/s xls (41.23 %) -0.5% + BM_ZFlat/9 468006 464101 312.5MB/s txt1 (57.87 %) +0.8% + BM_ZFlat/10 408157 408957 291.9MB/s txt2 (61.93 %) -0.2% + BM_ZFlat/11 1253348 1232910 330.1MB/s txt3 (54.92 %) +1.7% + BM_ZFlat/12 1702373 1702977 269.8MB/s txt4 (66.22 %) -0.0% + BM_ZFlat/13 439792 438557 1116.0MB/s bin (18.11 %) +0.3% + BM_ZFlat/14 80766 78851 462.5MB/s sum (48.96 %) +2.4% + BM_ZFlat/15 7420 7542 534.5MB/s man (59.36 %) -1.6% + BM_ZFlat/16 112043 100126 1.1GB/s pb (19.64 %) +11.9% + BM_ZFlat/17 368877 357703 491.4MB/s gaviota (37.72 %) +3.1% + BM_ZCord/0 116402 113564 859.9MB/s html +2.5% + BM_ZCord/1 1507156 1519911 440.5MB/s urls -0.8% + BM_ZCord/2 39860 33686 3.5GB/s jpg +18.3% + BM_ZCord/3 56211 54694 1.6GB/s pdf +2.8% + BM_ZCord/4 485594 479212 815.1MB/s html4 +1.3% + BM_ZDataBuffer/0 123185 121572 803.3MB/s html +1.3% + BM_ZDataBuffer/1 1569111 1589380 421.3MB/s urls -1.3% + BM_ZDataBuffer/2 53143 49556 2.4GB/s jpg +7.2% + BM_ZDataBuffer/3 65725 66826 1.3GB/s pdf -1.6% + BM_ZDataBuffer/4 517871 514750 758.9MB/s html4 +0.6% + Sum of all benchmarks 20258879 20315484 -0.3% + + +AMD Instanbul 2.4 GHz: + + Benchmark Base (ns) New (ns) Improvement + ------------------------------------------------------------------------------------------------- + BM_UFlat/0 97120 96585 1011.1MB/s html +0.6% + BM_UFlat/1 917473 948016 706.3MB/s urls -3.2% + BM_UFlat/2 21496 23938 4.9GB/s jpg -10.2% + BM_UFlat/3 44751 45639 1.9GB/s pdf -1.9% + BM_UFlat/4 391950 391413 998.0MB/s html4 +0.1% + BM_UFlat/5 37366 37201 630.7MB/s cp +0.4% + BM_UFlat/6 18350 18318 580.5MB/s c +0.2% + BM_UFlat/7 5672 5661 626.9MB/s lsp +0.2% + BM_UFlat/8 1533390 1529441 642.1MB/s xls +0.3% + BM_UFlat/9 335477 336553 431.0MB/s txt1 -0.3% + BM_UFlat/10 285140 292080 408.7MB/s txt2 -2.4% + BM_UFlat/11 888507 894758 454.9MB/s txt3 -0.7% + BM_UFlat/12 1187643 1210928 379.5MB/s txt4 -1.9% + BM_UFlat/13 493717 507447 964.5MB/s bin -2.7% + BM_UFlat/14 61740 60870 599.1MB/s sum +1.4% + BM_UFlat/15 7211 7187 560.9MB/s man +0.3% + BM_UFlat/16 97435 93100 1.2GB/s pb +4.7% + BM_UFlat/17 362662 356395 493.2MB/s gaviota +1.8% + BM_UValidate/0 47475 47118 2.0GB/s html +0.8% + BM_UValidate/1 501304 529741 1.2GB/s urls -5.4% + BM_UValidate/2 276 243 486.2GB/s jpg +13.6% + BM_UValidate/3 16361 16261 5.4GB/s pdf +0.6% + BM_UValidate/4 190741 190353 2.0GB/s html4 +0.2% + BM_UDataBuffer/0 111080 109771 889.6MB/s html +1.2% + BM_UDataBuffer/1 1051035 1085999 616.5MB/s urls -3.2% + BM_UDataBuffer/2 25801 25463 4.6GB/s jpg +1.3% + BM_UDataBuffer/3 50493 49946 1.8GB/s pdf +1.1% + BM_UDataBuffer/4 447258 444138 879.5MB/s html4 +0.7% + BM_UCord/0 109350 107909 905.0MB/s html +1.3% + BM_UCord/1 1023396 1054964 634.7MB/s urls -3.0% + BM_UCord/2 25292 24371 4.9GB/s jpg +3.8% + BM_UCord/3 48955 49736 1.8GB/s pdf -1.6% + BM_UCord/4 440452 437331 893.2MB/s html4 +0.7% + BM_UCordString/0 98511 98031 996.2MB/s html +0.5% + BM_UCordString/1 933230 963495 694.9MB/s urls -3.1% + BM_UCordString/2 23311 24076 4.9GB/s jpg -3.2% + BM_UCordString/3 45568 46196 1.9GB/s pdf -1.4% + BM_UCordString/4 397791 396934 984.1MB/s html4 +0.2% + BM_UCordValidate/0 47537 46921 2.0GB/s html +1.3% + BM_UCordValidate/1 505071 532716 1.2GB/s urls -5.2% + BM_UCordValidate/2 1663 1621 72.9GB/s jpg +2.6% + BM_UCordValidate/3 16890 16926 5.2GB/s pdf -0.2% + BM_UCordValidate/4 192365 191984 2.0GB/s html4 +0.2% + BM_ZFlat/0 184708 179103 545.3MB/s html (22.31 %) +3.1% + BM_ZFlat/1 2293864 2302950 290.7MB/s urls (47.77 %) -0.4% + BM_ZFlat/2 52852 47618 2.5GB/s jpg (99.87 %) +11.0% + BM_ZFlat/3 100766 96179 935.3MB/s pdf (82.07 %) +4.8% + BM_ZFlat/4 741220 727977 536.6MB/s html4 (22.51 %) +1.8% + BM_ZFlat/5 85402 85418 274.7MB/s cp (48.12 %) -0.0% + BM_ZFlat/6 36558 36494 291.4MB/s c (42.40 %) +0.2% + BM_ZFlat/7 12706 12507 283.7MB/s lsp (48.37 %) +1.6% + BM_ZFlat/8 2336823 2335688 420.5MB/s xls (41.23 %) +0.0% + BM_ZFlat/9 701804 681153 212.9MB/s txt1 (57.87 %) +3.0% + BM_ZFlat/10 606700 597194 199.9MB/s txt2 (61.93 %) +1.6% + BM_ZFlat/11 1852283 1803238 225.7MB/s txt3 (54.92 %) +2.7% + BM_ZFlat/12 2475527 2443354 188.1MB/s txt4 (66.22 %) +1.3% + BM_ZFlat/13 694497 696654 702.6MB/s bin (18.11 %) -0.3% + BM_ZFlat/14 136929 129855 280.8MB/s sum (48.96 %) +5.4% + BM_ZFlat/15 17172 17124 235.4MB/s man (59.36 %) +0.3% + BM_ZFlat/16 190364 171763 658.4MB/s pb (19.64 %) +10.8% + BM_ZFlat/17 567285 555190 316.6MB/s gaviota (37.72 %) +2.2% + BM_ZCord/0 193490 187031 522.1MB/s html +3.5% + BM_ZCord/1 2427537 2415315 277.2MB/s urls +0.5% + BM_ZCord/2 85378 81412 1.5GB/s jpg +4.9% + BM_ZCord/3 121898 119419 753.3MB/s pdf +2.1% + BM_ZCord/4 779564 762961 512.0MB/s html4 +2.2% + BM_ZDataBuffer/0 213820 207272 471.1MB/s html +3.2% + BM_ZDataBuffer/1 2589010 2586495 258.9MB/s urls +0.1% + BM_ZDataBuffer/2 121871 118885 1018.4MB/s jpg +2.5% + BM_ZDataBuffer/3 145382 145986 616.2MB/s pdf -0.4% + BM_ZDataBuffer/4 868117 852754 458.1MB/s html4 +1.8% + Sum of all benchmarks 33771833 33744763 +0.1% + +------------------------------------------------------------------------ +r70 | snappy.mirrorbot@gmail.com | 2013-01-06 20:21:26 +0100 (Sun, 06 Jan 2013) | 6 lines + +Adjust the Snappy open-source distribution for the changes in Google's +internal file API. + +R=sanjay + + +------------------------------------------------------------------------ +r69 | snappy.mirrorbot@gmail.com | 2013-01-04 12:54:20 +0100 (Fri, 04 Jan 2013) | 15 lines + +Change a few ORs to additions where they don't matter. This helps the compiler +use the LEA instruction more efficiently, since e.g. a + (b << 2) can be encoded +as one instruction. Even more importantly, it can constant-fold the +COPY_* enums together with the shifted negative constants, which also saves +some instructions. (We don't need it for LITERAL, since it happens to be 0.) + +I am unsure why the compiler couldn't do this itself, but the theory is that +it cannot prove that len-1 and len-4 cannot underflow/wrap, and thus can't +do the optimization safely. + +The gains are small but measurable; 0.5-1.0% over the BM_Z* benchmarks +(measured on Westmere, Sandy Bridge and Istanbul). + +R=sanjay + +------------------------------------------------------------------------ +r68 | snappy.mirrorbot@gmail.com | 2012-10-08 13:37:16 +0200 (Mon, 08 Oct 2012) | 5 lines + +Stop giving -Werror to automake, due to an incompatibility between current +versions of libtool and automake on non-GNU platforms (e.g. Mac OS X). + +R=sanjay + +------------------------------------------------------------------------ +r67 | snappy.mirrorbot@gmail.com | 2012-08-17 15:54:47 +0200 (Fri, 17 Aug 2012) | 5 lines + +Fix public issue 66: Document GetUncompressedLength better, in particular that +it leaves the source in a state that's not appropriate for RawUncompress. + +R=sanjay + +------------------------------------------------------------------------ +r66 | snappy.mirrorbot@gmail.com | 2012-07-31 13:44:44 +0200 (Tue, 31 Jul 2012) | 5 lines + +Fix public issue 64: Check for at configure time, +since MSVC seemingly does not have it. + +R=sanjay + +------------------------------------------------------------------------ +r65 | snappy.mirrorbot@gmail.com | 2012-07-04 11:34:48 +0200 (Wed, 04 Jul 2012) | 10 lines + +Handle the case where gettimeofday() goes backwards or returns the same value +twice; it could cause division by zero in the unit test framework. +(We already had one fix for this in place, but it was incomplete.) + +This could in theory happen on any system, since there are few guarantees +about gettimeofday(), but seems to only happen in practice on GNU/Hurd, where +gettimeofday() is cached and only updated ever so often. + +R=sanjay + +------------------------------------------------------------------------ +r64 | snappy.mirrorbot@gmail.com | 2012-07-04 11:28:33 +0200 (Wed, 04 Jul 2012) | 6 lines + +Mark ARMv4 as not supporting unaligned accesses (not just ARMv5 and ARMv6); +apparently Debian still targets these by default, giving us segfaults on +armel. + +R=sanjay + +------------------------------------------------------------------------ +r63 | snappy.mirrorbot@gmail.com | 2012-05-22 11:46:05 +0200 (Tue, 22 May 2012) | 5 lines + +Fix public bug #62: Remove an extraneous comma at the end of an enum list, +causing compile errors when embedded in Mozilla on OpenBSD. + +R=sanjay + +------------------------------------------------------------------------ +r62 | snappy.mirrorbot@gmail.com | 2012-05-22 11:32:50 +0200 (Tue, 22 May 2012) | 8 lines + +Snappy library no longer depends on iostream. + +Achieved by moving logging macro definitions to a test-only +header file, and by changing non-test code to use assert, +fprintf, and abort instead of LOG/CHECK macros. + +R=sesse + +------------------------------------------------------------------------ +r61 | snappy.mirrorbot@gmail.com | 2012-02-24 16:46:37 +0100 (Fri, 24 Feb 2012) | 4 lines + +Release Snappy 1.0.5. + +R=sanjay + +------------------------------------------------------------------------ +r60 | snappy.mirrorbot@gmail.com | 2012-02-23 18:00:36 +0100 (Thu, 23 Feb 2012) | 57 lines + +For 32-bit platforms, do not try to accelerate multiple neighboring +32-bit loads with a 64-bit load during compression (it's not a win). + +The main target for this optimization is ARM, but 32-bit x86 gets +a small gain, too, although there is noise in the microbenchmarks. +It's a no-op for 64-bit x86. It does not affect decompression. + +Microbenchmark results on a Cortex-A9 1GHz, using g++ 4.6.2 (from +Ubuntu/Linaro), -O2 -DNDEBUG -Wa,-march=armv7a -mtune=cortex-a9 +-mthumb-interwork, minimum 1000 iterations: + + Benchmark Time(ns) CPU(ns) Iterations + --------------------------------------------------- + BM_ZFlat/0 1158277 1160000 1000 84.2MB/s html (23.57 %) [ +4.3%] + BM_ZFlat/1 14861782 14860000 1000 45.1MB/s urls (50.89 %) [ +1.1%] + BM_ZFlat/2 393595 390000 1000 310.5MB/s jpg (99.88 %) [ +0.0%] + BM_ZFlat/3 650583 650000 1000 138.4MB/s pdf (82.13 %) [ +3.1%] + BM_ZFlat/4 4661480 4660000 1000 83.8MB/s html4 (23.55 %) [ +4.3%] + BM_ZFlat/5 491973 490000 1000 47.9MB/s cp (48.12 %) [ +2.0%] + BM_ZFlat/6 193575 192678 1038 55.2MB/s c (42.40 %) [ +9.0%] + BM_ZFlat/7 62343 62754 3187 56.5MB/s lsp (48.37 %) [ +2.6%] + BM_ZFlat/8 17708468 17710000 1000 55.5MB/s xls (41.34 %) [ -0.3%] + BM_ZFlat/9 3755345 3760000 1000 38.6MB/s txt1 (59.81 %) [ +8.2%] + BM_ZFlat/10 3324217 3320000 1000 36.0MB/s txt2 (64.07 %) [ +4.2%] + BM_ZFlat/11 10139932 10140000 1000 40.1MB/s txt3 (57.11 %) [ +6.4%] + BM_ZFlat/12 13532109 13530000 1000 34.0MB/s txt4 (68.35 %) [ +5.0%] + BM_ZFlat/13 4690847 4690000 1000 104.4MB/s bin (18.21 %) [ +4.1%] + BM_ZFlat/14 830682 830000 1000 43.9MB/s sum (51.88 %) [ +1.2%] + BM_ZFlat/15 84784 85011 2235 47.4MB/s man (59.36 %) [ +1.1%] + BM_ZFlat/16 1293254 1290000 1000 87.7MB/s pb (23.15 %) [ +2.3%] + BM_ZFlat/17 2775155 2780000 1000 63.2MB/s gaviota (38.27 %) [+12.2%] + +Core i7 in 32-bit mode (only one run and 100 iterations, though, so noisy): + + Benchmark Time(ns) CPU(ns) Iterations + --------------------------------------------------- + BM_ZFlat/0 227582 223464 3043 437.0MB/s html (23.57 %) [ +7.4%] + BM_ZFlat/1 2982430 2918455 233 229.4MB/s urls (50.89 %) [ +2.9%] + BM_ZFlat/2 46967 46658 15217 2.5GB/s jpg (99.88 %) [ +0.0%] + BM_ZFlat/3 115298 114864 5833 783.2MB/s pdf (82.13 %) [ +1.5%] + BM_ZFlat/4 913440 899743 778 434.2MB/s html4 (23.55 %) [ +0.3%] + BM_ZFlat/5 110302 108571 7000 216.1MB/s cp (48.12 %) [ +0.0%] + BM_ZFlat/6 44409 43372 15909 245.2MB/s c (42.40 %) [ +0.8%] + BM_ZFlat/7 15713 15643 46667 226.9MB/s lsp (48.37 %) [ +2.7%] + BM_ZFlat/8 2625539 2602230 269 377.4MB/s xls (41.34 %) [ +1.4%] + BM_ZFlat/9 808884 811429 875 178.8MB/s txt1 (59.81 %) [ -3.9%] + BM_ZFlat/10 709532 700000 1000 170.5MB/s txt2 (64.07 %) [ +0.0%] + BM_ZFlat/11 2177682 2162162 333 188.2MB/s txt3 (57.11 %) [ -1.4%] + BM_ZFlat/12 2849640 2840000 250 161.8MB/s txt4 (68.35 %) [ -1.4%] + BM_ZFlat/13 849760 835476 778 585.8MB/s bin (18.21 %) [ +1.2%] + BM_ZFlat/14 165940 164571 4375 221.6MB/s sum (51.88 %) [ +1.4%] + BM_ZFlat/15 20939 20571 35000 196.0MB/s man (59.36 %) [ +2.1%] + BM_ZFlat/16 239209 236544 2917 478.1MB/s pb (23.15 %) [ +4.2%] + BM_ZFlat/17 616206 610000 1000 288.2MB/s gaviota (38.27 %) [ -1.6%] + +R=sanjay + +------------------------------------------------------------------------ +r59 | snappy.mirrorbot@gmail.com | 2012-02-21 18:02:17 +0100 (Tue, 21 Feb 2012) | 107 lines + +Enable the use of unaligned loads and stores for ARM-based architectures +where they are available (ARMv7 and higher). This gives a significant +speed boost on ARM, both for compression and decompression. +It should not affect x86 at all. + +There are more changes possible to speed up ARM, but it might not be +that easy to do without hurting x86 or making the code uglier. +Also, we de not try to use NEON yet. + +Microbenchmark results on a Cortex-A9 1GHz, using g++ 4.6.2 (from Ubuntu/Linaro), +-O2 -DNDEBUG -Wa,-march=armv7a -mtune=cortex-a9 -mthumb-interwork: + +Benchmark Time(ns) CPU(ns) Iterations +--------------------------------------------------- +BM_UFlat/0 524806 529100 378 184.6MB/s html [+33.6%] +BM_UFlat/1 5139790 5200000 100 128.8MB/s urls [+28.8%] +BM_UFlat/2 86540 84166 1901 1.4GB/s jpg [ +0.6%] +BM_UFlat/3 215351 210176 904 428.0MB/s pdf [+29.8%] +BM_UFlat/4 2144490 2100000 100 186.0MB/s html4 [+33.3%] +BM_UFlat/5 194482 190000 1000 123.5MB/s cp [+36.2%] +BM_UFlat/6 91843 90175 2107 117.9MB/s c [+38.6%] +BM_UFlat/7 28535 28426 6684 124.8MB/s lsp [+34.7%] +BM_UFlat/8 9206600 9200000 100 106.7MB/s xls [+42.4%] +BM_UFlat/9 1865273 1886792 106 76.9MB/s txt1 [+32.5%] +BM_UFlat/10 1576809 1587301 126 75.2MB/s txt2 [+32.3%] +BM_UFlat/11 4968450 4900000 100 83.1MB/s txt3 [+32.7%] +BM_UFlat/12 6673970 6700000 100 68.6MB/s txt4 [+32.8%] +BM_UFlat/13 2391470 2400000 100 203.9MB/s bin [+29.2%] +BM_UFlat/14 334601 344827 522 105.8MB/s sum [+30.6%] +BM_UFlat/15 37404 38080 5252 105.9MB/s man [+33.8%] +BM_UFlat/16 535470 540540 370 209.2MB/s pb [+31.2%] +BM_UFlat/17 1875245 1886792 106 93.2MB/s gaviota [+37.8%] +BM_UValidate/0 178425 179533 1114 543.9MB/s html [ +2.7%] +BM_UValidate/1 2100450 2000000 100 334.8MB/s urls [ +5.0%] +BM_UValidate/2 1039 1044 172413 113.3GB/s jpg [ +3.4%] +BM_UValidate/3 59423 59470 3363 1.5GB/s pdf [ +7.8%] +BM_UValidate/4 760716 766283 261 509.8MB/s html4 [ +6.5%] +BM_ZFlat/0 1204632 1204819 166 81.1MB/s html (23.57 %) [+32.8%] +BM_ZFlat/1 15656190 15600000 100 42.9MB/s urls (50.89 %) [+27.6%] +BM_ZFlat/2 403336 410677 487 294.8MB/s jpg (99.88 %) [+16.5%] +BM_ZFlat/3 664073 671140 298 134.0MB/s pdf (82.13 %) [+28.4%] +BM_ZFlat/4 4961940 4900000 100 79.7MB/s html4 (23.55 %) [+30.6%] +BM_ZFlat/5 500664 501253 399 46.8MB/s cp (48.12 %) [+33.4%] +BM_ZFlat/6 217276 215982 926 49.2MB/s c (42.40 %) [+25.0%] +BM_ZFlat/7 64122 65487 3054 54.2MB/s lsp (48.37 %) [+36.1%] +BM_ZFlat/8 18045730 18000000 100 54.6MB/s xls (41.34 %) [+34.4%] +BM_ZFlat/9 4051530 4000000 100 36.3MB/s txt1 (59.81 %) [+25.0%] +BM_ZFlat/10 3451800 3500000 100 34.1MB/s txt2 (64.07 %) [+25.7%] +BM_ZFlat/11 11052340 11100000 100 36.7MB/s txt3 (57.11 %) [+24.3%] +BM_ZFlat/12 14538690 14600000 100 31.5MB/s txt4 (68.35 %) [+24.7%] +BM_ZFlat/13 5041850 5000000 100 97.9MB/s bin (18.21 %) [+32.0%] +BM_ZFlat/14 908840 909090 220 40.1MB/s sum (51.88 %) [+22.2%] +BM_ZFlat/15 86921 86206 1972 46.8MB/s man (59.36 %) [+42.2%] +BM_ZFlat/16 1312315 1315789 152 86.0MB/s pb (23.15 %) [+34.5%] +BM_ZFlat/17 3173120 3200000 100 54.9MB/s gaviota (38.27%) [+28.1%] + + +The move from 64-bit to 32-bit operations for the copies also affected 32-bit x86; +positive on the decompression side, and slightly negative on the compression side +(unless that is noise; I only ran once): + +Benchmark Time(ns) CPU(ns) Iterations +----------------------------------------------------- +BM_UFlat/0 86279 86140 7778 1.1GB/s html [ +7.5%] +BM_UFlat/1 839265 822622 778 813.9MB/s urls [ +9.4%] +BM_UFlat/2 9180 9143 87500 12.9GB/s jpg [ +1.2%] +BM_UFlat/3 35080 35000 20000 2.5GB/s pdf [+10.1%] +BM_UFlat/4 350318 345000 2000 1.1GB/s html4 [ +7.0%] +BM_UFlat/5 33808 33472 21212 701.0MB/s cp [ +9.0%] +BM_UFlat/6 15201 15214 46667 698.9MB/s c [+14.9%] +BM_UFlat/7 4652 4651 159091 762.9MB/s lsp [ +7.5%] +BM_UFlat/8 1285551 1282528 538 765.7MB/s xls [+10.7%] +BM_UFlat/9 282510 281690 2414 514.9MB/s txt1 [+13.6%] +BM_UFlat/10 243494 239286 2800 498.9MB/s txt2 [+14.4%] +BM_UFlat/11 743625 740000 1000 550.0MB/s txt3 [+14.3%] +BM_UFlat/12 999441 989717 778 464.3MB/s txt4 [+16.1%] +BM_UFlat/13 412402 410076 1707 1.2GB/s bin [ +7.3%] +BM_UFlat/14 54876 54000 10000 675.3MB/s sum [+13.0%] +BM_UFlat/15 6146 6100 100000 660.8MB/s man [+14.8%] +BM_UFlat/16 90496 90286 8750 1.2GB/s pb [ +4.0%] +BM_UFlat/17 292650 292000 2500 602.0MB/s gaviota [+18.1%] +BM_UValidate/0 49620 49699 14286 1.9GB/s html [ +0.0%] +BM_UValidate/1 501371 500000 1000 1.3GB/s urls [ +0.0%] +BM_UValidate/2 232 227 3043478 521.5GB/s jpg [ +1.3%] +BM_UValidate/3 17250 17143 43750 5.1GB/s pdf [ -1.3%] +BM_UValidate/4 198643 200000 3500 1.9GB/s html4 [ -0.9%] +BM_ZFlat/0 227128 229415 3182 425.7MB/s html (23.57 %) [ -1.4%] +BM_ZFlat/1 2970089 2960000 250 226.2MB/s urls (50.89 %) [ -1.9%] +BM_ZFlat/2 45683 44999 15556 2.6GB/s jpg (99.88 %) [ +2.2%] +BM_ZFlat/3 114661 113136 6364 795.1MB/s pdf (82.13 %) [ -1.5%] +BM_ZFlat/4 919702 914286 875 427.2MB/s html4 (23.55%) [ -1.3%] +BM_ZFlat/5 108189 108422 6364 216.4MB/s cp (48.12 %) [ -1.2%] +BM_ZFlat/6 44525 44000 15909 241.7MB/s c (42.40 %) [ -2.9%] +BM_ZFlat/7 15973 15857 46667 223.8MB/s lsp (48.37 %) [ +0.0%] +BM_ZFlat/8 2677888 2639405 269 372.1MB/s xls (41.34 %) [ -1.4%] +BM_ZFlat/9 800715 780000 1000 186.0MB/s txt1 (59.81 %) [ -0.4%] +BM_ZFlat/10 700089 700000 1000 170.5MB/s txt2 (64.07 %) [ -2.9%] +BM_ZFlat/11 2159356 2138365 318 190.3MB/s txt3 (57.11 %) [ -0.3%] +BM_ZFlat/12 2796143 2779923 259 165.3MB/s txt4 (68.35 %) [ -1.4%] +BM_ZFlat/13 856458 835476 778 585.8MB/s bin (18.21 %) [ -0.1%] +BM_ZFlat/14 166908 166857 4375 218.6MB/s sum (51.88 %) [ -1.4%] +BM_ZFlat/15 21181 20857 35000 193.3MB/s man (59.36 %) [ -0.8%] +BM_ZFlat/16 244009 239973 2917 471.3MB/s pb (23.15 %) [ -1.4%] +BM_ZFlat/17 596362 590000 1000 297.9MB/s gaviota (38.27%) [ +0.0%] + +R=sanjay + +------------------------------------------------------------------------ +r58 | snappy.mirrorbot@gmail.com | 2012-02-11 23:11:22 +0100 (Sat, 11 Feb 2012) | 9 lines + +Lower the size allocated in the "corrupted input" unit test from 256 MB +to 2 MB. This fixes issues with running the unit test on platforms with +little RAM (e.g. some ARM boards). + +Also, reactivate the 2 MB test for 64-bit platforms; there's no good +reason why it shouldn't be. + +R=sanjay + +------------------------------------------------------------------------ +r57 | snappy.mirrorbot@gmail.com | 2012-01-08 18:55:48 +0100 (Sun, 08 Jan 2012) | 2 lines + +Minor refactoring to accomodate changes in Google's internal code tree. + +------------------------------------------------------------------------ +r56 | snappy.mirrorbot@gmail.com | 2012-01-04 14:10:46 +0100 (Wed, 04 Jan 2012) | 19 lines + +Fix public issue r57: Fix most warnings with -Wall, mostly signed/unsigned +warnings. There are still some in the unit test, but the main .cc file should +be clean. We haven't enabled -Wall for the default build, since the unit test +is still not clean. + +This also fixes a real bug in the open-source implementation of +ReadFileToStringOrDie(); it would not detect errors correctly. + +I had to go through some pains to avoid performance loss as the types +were changed; I think there might still be some with 32-bit if and only if LFS +is enabled (ie., size_t is 64-bit), but for regular 32-bit and 64-bit I can't +see any losses, and I've diffed the generated GCC assembler between the old and +new code without seeing any significant choices. If anything, it's ever so +slightly faster. + +This may or may not enable compression of very large blocks (>2^32 bytes) +when size_t is 64-bit, but I haven't checked, and it is still not a supported +case. + +------------------------------------------------------------------------ +r55 | snappy.mirrorbot@gmail.com | 2012-01-04 11:46:39 +0100 (Wed, 04 Jan 2012) | 6 lines + +Add a framing format description. We do not have any implementation of this at +the current point, but there seems to be enough of a general interest in the +topic (cf. public bug #34). + +R=csilvers,sanjay + +------------------------------------------------------------------------ +r54 | snappy.mirrorbot@gmail.com | 2011-12-05 22:27:26 +0100 (Mon, 05 Dec 2011) | 81 lines + +Speed up decompression by moving the refill check to the end of the loop. + +This seems to work because in most of the branches, the compiler can evaluate +“ip_limit_ - ip” in a more efficient way than reloading ip_limit_ from memory +(either by already having the entire expression in a register, or reconstructing +it from “avail”, or something else). Memory loads, even from L1, are seemingly +costly in the big picture at the current decompression speeds. + +Microbenchmarks (64-bit, opt mode): + +Westmere (Intel Core i7): + + Benchmark Time(ns) CPU(ns) Iterations + -------------------------------------------- + BM_UFlat/0 74492 74491 187894 1.3GB/s html [ +5.9%] + BM_UFlat/1 712268 712263 19644 940.0MB/s urls [ +3.8%] + BM_UFlat/2 10591 10590 1000000 11.2GB/s jpg [ -6.8%] + BM_UFlat/3 29643 29643 469915 3.0GB/s pdf [ +7.9%] + BM_UFlat/4 304669 304667 45930 1.3GB/s html4 [ +4.8%] + BM_UFlat/5 28508 28507 490077 823.1MB/s cp [ +4.0%] + BM_UFlat/6 12415 12415 1000000 856.5MB/s c [ +8.6%] + BM_UFlat/7 3415 3415 4084723 1039.0MB/s lsp [+18.0%] + BM_UFlat/8 979569 979563 14261 1002.5MB/s xls [ +5.8%] + BM_UFlat/9 230150 230148 60934 630.2MB/s txt1 [ +5.2%] + BM_UFlat/10 197167 197166 71135 605.5MB/s txt2 [ +4.7%] + BM_UFlat/11 607394 607390 23041 670.1MB/s txt3 [ +5.6%] + BM_UFlat/12 808502 808496 17316 568.4MB/s txt4 [ +5.0%] + BM_UFlat/13 372791 372788 37564 1.3GB/s bin [ +3.3%] + BM_UFlat/14 44541 44541 313969 818.8MB/s sum [ +5.7%] + BM_UFlat/15 4833 4833 2898697 834.1MB/s man [ +4.8%] + BM_UFlat/16 79855 79855 175356 1.4GB/s pb [ +4.8%] + BM_UFlat/17 245845 245843 56838 715.0MB/s gaviota [ +5.8%] + +Clovertown (Intel Core 2): + + Benchmark Time(ns) CPU(ns) Iterations + -------------------------------------------- + BM_UFlat/0 107911 107890 100000 905.1MB/s html [ +2.2%] + BM_UFlat/1 1011237 1011041 10000 662.3MB/s urls [ +2.5%] + BM_UFlat/2 26775 26770 523089 4.4GB/s jpg [ +0.0%] + BM_UFlat/3 48103 48095 290618 1.8GB/s pdf [ +3.4%] + BM_UFlat/4 437724 437644 31937 892.6MB/s html4 [ +2.1%] + BM_UFlat/5 39607 39600 358284 592.5MB/s cp [ +2.4%] + BM_UFlat/6 18227 18224 768191 583.5MB/s c [ +2.7%] + BM_UFlat/7 5171 5170 2709437 686.4MB/s lsp [ +3.9%] + BM_UFlat/8 1560291 1559989 8970 629.5MB/s xls [ +3.6%] + BM_UFlat/9 335401 335343 41731 432.5MB/s txt1 [ +3.0%] + BM_UFlat/10 287014 286963 48758 416.0MB/s txt2 [ +2.8%] + BM_UFlat/11 888522 888356 15752 458.1MB/s txt3 [ +2.9%] + BM_UFlat/12 1186600 1186378 10000 387.3MB/s txt4 [ +3.1%] + BM_UFlat/13 572295 572188 24468 855.4MB/s bin [ +2.1%] + BM_UFlat/14 64060 64049 218401 569.4MB/s sum [ +4.1%] + BM_UFlat/15 7264 7263 1916168 555.0MB/s man [ +1.4%] + BM_UFlat/16 108853 108836 100000 1039.1MB/s pb [ +1.7%] + BM_UFlat/17 364289 364223 38419 482.6MB/s gaviota [ +4.9%] + +Barcelona (AMD Opteron): + + Benchmark Time(ns) CPU(ns) Iterations + -------------------------------------------- + BM_UFlat/0 103900 103871 100000 940.2MB/s html [ +8.3%] + BM_UFlat/1 1000435 1000107 10000 669.5MB/s urls [ +6.6%] + BM_UFlat/2 24659 24652 567362 4.8GB/s jpg [ +0.1%] + BM_UFlat/3 48206 48193 291121 1.8GB/s pdf [ +5.0%] + BM_UFlat/4 421980 421850 33174 926.0MB/s html4 [ +7.3%] + BM_UFlat/5 40368 40357 346994 581.4MB/s cp [ +8.7%] + BM_UFlat/6 19836 19830 708695 536.2MB/s c [ +8.0%] + BM_UFlat/7 6100 6098 2292774 581.9MB/s lsp [ +9.0%] + BM_UFlat/8 1693093 1692514 8261 580.2MB/s xls [ +8.0%] + BM_UFlat/9 365991 365886 38225 396.4MB/s txt1 [ +7.1%] + BM_UFlat/10 311330 311238 44950 383.6MB/s txt2 [ +7.6%] + BM_UFlat/11 975037 974737 14376 417.5MB/s txt3 [ +6.9%] + BM_UFlat/12 1303558 1303175 10000 352.6MB/s txt4 [ +7.3%] + BM_UFlat/13 517448 517290 27144 946.2MB/s bin [ +5.5%] + BM_UFlat/14 66537 66518 210352 548.3MB/s sum [ +7.5%] + BM_UFlat/15 7976 7974 1760383 505.6MB/s man [ +5.6%] + BM_UFlat/16 103121 103092 100000 1097.0MB/s pb [ +8.7%] + BM_UFlat/17 391431 391314 35733 449.2MB/s gaviota [ +6.5%] + +R=sanjay + +------------------------------------------------------------------------ +r53 | snappy.mirrorbot@gmail.com | 2011-11-23 12:14:17 +0100 (Wed, 23 Nov 2011) | 88 lines + +Speed up decompression by making the fast path for literals faster. + +We do the fast-path step as soon as possible; in fact, as soon as we know the +literal length. Since we usually hit the fast path, we can then skip the checks +for long literals and available input space (beyond what the fast path check +already does). + +Note that this changes the decompression Writer API; however, it does not +change the ABI, since writers are always templatized and as such never +cross compilation units. The new API is slightly more general, in that it +doesn't hard-code the value 16. Note that we also take care to check +for len <= 16 first, since the other two checks almost always succeed +(so we don't want to waste time checking for them until we have to). + +The improvements are most marked on Nehalem, but are generally positive +on other platforms as well. All microbenchmarks are 64-bit, opt. + +Clovertown (Core 2): + + Benchmark Time(ns) CPU(ns) Iterations + -------------------------------------------- + BM_UFlat/0 110226 110224 100000 886.0MB/s html [ +1.5%] + BM_UFlat/1 1036523 1036508 10000 646.0MB/s urls [ -0.8%] + BM_UFlat/2 26775 26775 522570 4.4GB/s jpg [ +0.0%] + BM_UFlat/3 49738 49737 280974 1.8GB/s pdf [ +0.3%] + BM_UFlat/4 446790 446792 31334 874.3MB/s html4 [ +0.8%] + BM_UFlat/5 40561 40562 350424 578.5MB/s cp [ +1.3%] + BM_UFlat/6 18722 18722 746903 568.0MB/s c [ +1.4%] + BM_UFlat/7 5373 5373 2608632 660.5MB/s lsp [ +8.3%] + BM_UFlat/8 1615716 1615718 8670 607.8MB/s xls [ +2.0%] + BM_UFlat/9 345278 345281 40481 420.1MB/s txt1 [ +1.4%] + BM_UFlat/10 294855 294855 47452 404.9MB/s txt2 [ +1.6%] + BM_UFlat/11 914263 914263 15316 445.2MB/s txt3 [ +1.1%] + BM_UFlat/12 1222694 1222691 10000 375.8MB/s txt4 [ +1.4%] + BM_UFlat/13 584495 584489 23954 837.4MB/s bin [ -0.6%] + BM_UFlat/14 66662 66662 210123 547.1MB/s sum [ +1.2%] + BM_UFlat/15 7368 7368 1881856 547.1MB/s man [ +4.0%] + BM_UFlat/16 110727 110726 100000 1021.4MB/s pb [ +2.3%] + BM_UFlat/17 382138 382141 36616 460.0MB/s gaviota [ -0.7%] + +Westmere (Core i7): + + Benchmark Time(ns) CPU(ns) Iterations + -------------------------------------------- + BM_UFlat/0 78861 78853 177703 1.2GB/s html [ +2.1%] + BM_UFlat/1 739560 739491 18912 905.4MB/s urls [ +3.4%] + BM_UFlat/2 9867 9866 1419014 12.0GB/s jpg [ +3.4%] + BM_UFlat/3 31989 31986 438385 2.7GB/s pdf [ +0.2%] + BM_UFlat/4 319406 319380 43771 1.2GB/s html4 [ +1.9%] + BM_UFlat/5 29639 29636 472862 791.7MB/s cp [ +5.2%] + BM_UFlat/6 13478 13477 1000000 789.0MB/s c [ +2.3%] + BM_UFlat/7 4030 4029 3475364 880.7MB/s lsp [ +8.7%] + BM_UFlat/8 1036585 1036492 10000 947.5MB/s xls [ +6.9%] + BM_UFlat/9 242127 242105 57838 599.1MB/s txt1 [ +3.0%] + BM_UFlat/10 206499 206480 67595 578.2MB/s txt2 [ +3.4%] + BM_UFlat/11 641635 641570 21811 634.4MB/s txt3 [ +2.4%] + BM_UFlat/12 848847 848769 16443 541.4MB/s txt4 [ +3.1%] + BM_UFlat/13 384968 384938 36366 1.2GB/s bin [ +0.3%] + BM_UFlat/14 47106 47101 297770 774.3MB/s sum [ +4.4%] + BM_UFlat/15 5063 5063 2772202 796.2MB/s man [ +7.7%] + BM_UFlat/16 83663 83656 167697 1.3GB/s pb [ +1.8%] + BM_UFlat/17 260224 260198 53823 675.6MB/s gaviota [ -0.5%] + +Barcelona (Opteron): + + Benchmark Time(ns) CPU(ns) Iterations + -------------------------------------------- + BM_UFlat/0 112490 112457 100000 868.4MB/s html [ -0.4%] + BM_UFlat/1 1066719 1066339 10000 627.9MB/s urls [ +1.0%] + BM_UFlat/2 24679 24672 563802 4.8GB/s jpg [ +0.7%] + BM_UFlat/3 50603 50589 277285 1.7GB/s pdf [ +2.6%] + BM_UFlat/4 452982 452849 30900 862.6MB/s html4 [ -0.2%] + BM_UFlat/5 43860 43848 319554 535.1MB/s cp [ +1.2%] + BM_UFlat/6 21419 21413 653573 496.6MB/s c [ +1.0%] + BM_UFlat/7 6646 6645 2105405 534.1MB/s lsp [ +0.3%] + BM_UFlat/8 1828487 1827886 7658 537.3MB/s xls [ +2.6%] + BM_UFlat/9 391824 391714 35708 370.3MB/s txt1 [ +2.2%] + BM_UFlat/10 334913 334816 41885 356.6MB/s txt2 [ +1.7%] + BM_UFlat/11 1042062 1041674 10000 390.7MB/s txt3 [ +1.1%] + BM_UFlat/12 1398902 1398456 10000 328.6MB/s txt4 [ +1.7%] + BM_UFlat/13 545706 545530 25669 897.2MB/s bin [ -0.4%] + BM_UFlat/14 71512 71505 196035 510.0MB/s sum [ +1.4%] + BM_UFlat/15 8422 8421 1665036 478.7MB/s man [ +2.6%] + BM_UFlat/16 112053 112048 100000 1009.3MB/s pb [ -0.4%] + BM_UFlat/17 416723 416713 33612 421.8MB/s gaviota [ -2.0%] + +R=sanjay + +------------------------------------------------------------------------ +r52 | snappy.mirrorbot@gmail.com | 2011-11-08 15:46:39 +0100 (Tue, 08 Nov 2011) | 5 lines + +Fix public issue #53: Update the README to the API we actually open-sourced +with. + +R=sanjay + +------------------------------------------------------------------------ +r51 | snappy.mirrorbot@gmail.com | 2011-10-05 14:27:12 +0200 (Wed, 05 Oct 2011) | 5 lines + +In the format description, use a clearer example to emphasize that varints are +stored in little-endian. Patch from Christian von Roques. + +R=csilvers + +------------------------------------------------------------------------ +r50 | snappy.mirrorbot@gmail.com | 2011-09-15 21:34:06 +0200 (Thu, 15 Sep 2011) | 4 lines + +Release Snappy 1.0.4. + +R=sanjay + +------------------------------------------------------------------------ +r49 | snappy.mirrorbot@gmail.com | 2011-09-15 11:50:05 +0200 (Thu, 15 Sep 2011) | 5 lines + +Fix public issue #50: Include generic byteswap macros. +Also include Solaris 10 and FreeBSD versions. + +R=csilvers + +------------------------------------------------------------------------ +r48 | snappy.mirrorbot@gmail.com | 2011-08-10 20:57:27 +0200 (Wed, 10 Aug 2011) | 5 lines + +Partially fix public issue 50: Remove an extra comma from the end of some +enum declarations, as it seems the Sun compiler does not like it. + +Based on patch by Travis Vitek. + +------------------------------------------------------------------------ +r47 | snappy.mirrorbot@gmail.com | 2011-08-10 20:44:16 +0200 (Wed, 10 Aug 2011) | 4 lines + +Use the right #ifdef test for sys/mman.h. + +Based on patch by Travis Vitek. + +------------------------------------------------------------------------ +r46 | snappy.mirrorbot@gmail.com | 2011-08-10 03:22:09 +0200 (Wed, 10 Aug 2011) | 6 lines + +Fix public issue #47: Small comment cleanups in the unit test. + +Originally based on a patch by Patrick Pelletier. + +R=sanjay + +------------------------------------------------------------------------ +r45 | snappy.mirrorbot@gmail.com | 2011-08-10 03:14:43 +0200 (Wed, 10 Aug 2011) | 8 lines + +Fix public issue #46: Format description said "3-byte offset" +instead of "4-byte offset" for the longest copies. + +Also fix an inconsistency in the heading for section 2.2.3. +Both patches by Patrick Pelletier. + +R=csilvers + +------------------------------------------------------------------------ +r44 | snappy.mirrorbot@gmail.com | 2011-06-28 13:40:25 +0200 (Tue, 28 Jun 2011) | 8 lines + +Fix public issue #44: Make the definition and declaration of CompressFragment +identical, even regarding cv-qualifiers. + +This is required to work around a bug in the Solaris Studio C++ compiler +(it does not properly disregard cv-qualifiers when doing name mangling). + +R=sanjay + +------------------------------------------------------------------------ +r43 | snappy.mirrorbot@gmail.com | 2011-06-04 12:19:05 +0200 (Sat, 04 Jun 2011) | 7 lines + +Correct an inaccuracy in the Snappy format description. +(I stumbled into this when changing the way we decompress literals.) + +R=csilvers + +Revision created by MOE tool push_codebase. + +------------------------------------------------------------------------ +r42 | snappy.mirrorbot@gmail.com | 2011-06-03 22:53:06 +0200 (Fri, 03 Jun 2011) | 50 lines + +Speed up decompression by removing a fast-path attempt. + +Whenever we try to enter a copy fast-path, there is a certain cost in checking +that all the preconditions are in place, but it's normally offset by the fact +that we can usually take the cheaper path. However, in a certain path we've +already established that "avail < literal_length", which usually means that +either the available space is small, or the literal is big. Both will disqualify +us from taking the fast path, and thus we take the hit from the precondition +checking without gaining much from having a fast path. Thus, simply don't try +the fast path in this situation -- we're already on a slow path anyway +(one where we need to refill more data from the reader). + +I'm a bit surprised at how much this gained; it could be that this path is +more common than I thought, or that the simpler structure somehow makes the +compiler happier. I haven't looked at the assembler, but it's a win across +the board on both Core 2, Core i7 and Opteron, at least for the cases we +typically care about. The gains seem to be the largest on Core i7, though. +Results from my Core i7 workstation: + + + Benchmark Time(ns) CPU(ns) Iterations + --------------------------------------------------- + BM_UFlat/0 73337 73091 190996 1.3GB/s html [ +1.7%] + BM_UFlat/1 696379 693501 20173 965.5MB/s urls [ +2.7%] + BM_UFlat/2 9765 9734 1472135 12.1GB/s jpg [ +0.7%] + BM_UFlat/3 29720 29621 472973 3.0GB/s pdf [ +1.8%] + BM_UFlat/4 294636 293834 47782 1.3GB/s html4 [ +2.3%] + BM_UFlat/5 28399 28320 494700 828.5MB/s cp [ +3.5%] + BM_UFlat/6 12795 12760 1000000 833.3MB/s c [ +1.2%] + BM_UFlat/7 3984 3973 3526448 893.2MB/s lsp [ +5.7%] + BM_UFlat/8 991996 989322 14141 992.6MB/s xls [ +3.3%] + BM_UFlat/9 228620 227835 61404 636.6MB/s txt1 [ +4.0%] + BM_UFlat/10 197114 196494 72165 607.5MB/s txt2 [ +3.5%] + BM_UFlat/11 605240 603437 23217 674.4MB/s txt3 [ +3.7%] + BM_UFlat/12 804157 802016 17456 573.0MB/s txt4 [ +3.9%] + BM_UFlat/13 347860 346998 40346 1.4GB/s bin [ +1.2%] + BM_UFlat/14 44684 44559 315315 818.4MB/s sum [ +2.3%] + BM_UFlat/15 5120 5106 2739726 789.4MB/s man [ +3.3%] + BM_UFlat/16 76591 76355 183486 1.4GB/s pb [ +2.8%] + BM_UFlat/17 238564 237828 58824 739.1MB/s gaviota [ +1.6%] + BM_UValidate/0 42194 42060 333333 2.3GB/s html [ -0.1%] + BM_UValidate/1 433182 432005 32407 1.5GB/s urls [ -0.1%] + BM_UValidate/2 197 196 71428571 603.3GB/s jpg [ +0.5%] + BM_UValidate/3 14494 14462 972222 6.1GB/s pdf [ +0.5%] + BM_UValidate/4 168444 167836 83832 2.3GB/s html4 [ +0.1%] + +R=jeff + +Revision created by MOE tool push_codebase. + +------------------------------------------------------------------------ +r41 | snappy.mirrorbot@gmail.com | 2011-06-03 22:47:14 +0200 (Fri, 03 Jun 2011) | 43 lines + +Speed up decompression by not needing a lookup table for literal items. + +Looking up into and decoding the values from char_table has long shown up as a +hotspot in the decompressor. While it turns out that it's hard to make a more +efficient decoder for the copy ops, the literals are simple enough that we can +decode them without needing a table lookup. (This means that 1/4 of the table +is now unused, although that in itself doesn't buy us anything.) + +The gains are small, but definitely present; some tests win as much as 10%, +but 1-4% is more typical. These results are from Core i7, in 64-bit mode; +Core 2 and Opteron show similar results. (I've run with more iterations +than unusual to make sure the smaller gains don't drown entirely in noise.) + + Benchmark Time(ns) CPU(ns) Iterations + --------------------------------------------------- + BM_UFlat/0 74665 74428 182055 1.3GB/s html [ +3.1%] + BM_UFlat/1 714106 711997 19663 940.4MB/s urls [ +4.4%] + BM_UFlat/2 9820 9789 1427115 12.1GB/s jpg [ -1.2%] + BM_UFlat/3 30461 30380 465116 2.9GB/s pdf [ +0.8%] + BM_UFlat/4 301445 300568 46512 1.3GB/s html4 [ +2.2%] + BM_UFlat/5 29338 29263 479452 801.8MB/s cp [ +1.6%] + BM_UFlat/6 13004 12970 1000000 819.9MB/s c [ +2.1%] + BM_UFlat/7 4180 4168 3349282 851.4MB/s lsp [ +1.3%] + BM_UFlat/8 1026149 1024000 10000 959.0MB/s xls [+10.7%] + BM_UFlat/9 237441 236830 59072 612.4MB/s txt1 [ +0.3%] + BM_UFlat/10 203966 203298 69307 587.2MB/s txt2 [ +0.8%] + BM_UFlat/11 627230 625000 22400 651.2MB/s txt3 [ +0.7%] + BM_UFlat/12 836188 833979 16787 551.0MB/s txt4 [ +1.3%] + BM_UFlat/13 351904 350750 39886 1.4GB/s bin [ +3.8%] + BM_UFlat/14 45685 45562 308370 800.4MB/s sum [ +5.9%] + BM_UFlat/15 5286 5270 2656546 764.9MB/s man [ +1.5%] + BM_UFlat/16 78774 78544 178117 1.4GB/s pb [ +4.3%] + BM_UFlat/17 242270 241345 58091 728.3MB/s gaviota [ +1.2%] + BM_UValidate/0 42149 42000 333333 2.3GB/s html [ -3.0%] + BM_UValidate/1 432741 431303 32483 1.5GB/s urls [ +7.8%] + BM_UValidate/2 198 197 71428571 600.7GB/s jpg [+16.8%] + BM_UValidate/3 14560 14521 965517 6.1GB/s pdf [ -4.1%] + BM_UValidate/4 169065 168671 83832 2.3GB/s html4 [ -2.9%] + +R=jeff + +Revision created by MOE tool push_codebase. + +------------------------------------------------------------------------ +r40 | snappy.mirrorbot@gmail.com | 2011-06-03 00:57:41 +0200 (Fri, 03 Jun 2011) | 2 lines + +Release Snappy 1.0.3. + +------------------------------------------------------------------------ +r39 | snappy.mirrorbot@gmail.com | 2011-06-02 20:06:54 +0200 (Thu, 02 Jun 2011) | 11 lines + +Remove an unneeded goto in the decompressor; it turns out that the +state of ip_ after decompression (or attempted decompresion) is +completely irrelevant, so we don't need the trailer. + +Performance is, as expected, mostly flat -- there's a curious ~3-5% +loss in the "lsp" test, but that test case is so short it is hard to say +anything definitive about why (most likely, it's some sort of +unrelated effect). + +R=jeff + +------------------------------------------------------------------------ +r38 | snappy.mirrorbot@gmail.com | 2011-06-02 19:59:40 +0200 (Thu, 02 Jun 2011) | 52 lines + +Speed up decompression by caching ip_. + +It is seemingly hard for the compiler to understand that ip_, the current input +pointer into the compressed data stream, can not alias on anything else, and +thus using it directly will incur memory traffic as it cannot be kept in a +register. The code already knew about this and cached it into a local +variable, but since Step() only decoded one tag, it had to move ip_ back into +place between every tag. This seems to have cost us a significant amount of +performance, so changing Step() into a function that decodes as much as it can +before it saves ip_ back and returns. (Note that Step() was already inlined, +so it is not the manual inlining that buys the performance here.) + +The wins are about 3-6% for Core 2, 6-13% on Core i7 and 5-12% on Opteron +(for plain array-to-array decompression, in 64-bit opt mode). + +There is a tiny difference in the behavior here; if an invalid literal is +encountered (ie., the writer refuses the Append() operation), ip_ will now +point to the byte past the tag byte, instead of where the literal was +originally thought to end. However, we don't use ip_ for anything after +DecompressAllTags() has returned, so this should not change external behavior +in any way. + +Microbenchmark results for Core i7, 64-bit (Opteron results are similar): + +Benchmark Time(ns) CPU(ns) Iterations +--------------------------------------------------- +BM_UFlat/0 79134 79110 8835 1.2GB/s html [ +6.2%] +BM_UFlat/1 786126 786096 891 851.8MB/s urls [+10.0%] +BM_UFlat/2 9948 9948 69125 11.9GB/s jpg [ -1.3%] +BM_UFlat/3 31999 31998 21898 2.7GB/s pdf [ +6.5%] +BM_UFlat/4 318909 318829 2204 1.2GB/s html4 [ +6.5%] +BM_UFlat/5 31384 31390 22363 747.5MB/s cp [ +9.2%] +BM_UFlat/6 14037 14034 49858 757.7MB/s c [+10.6%] +BM_UFlat/7 4612 4612 151395 769.5MB/s lsp [ +9.5%] +BM_UFlat/8 1203174 1203007 582 816.3MB/s xls [+19.3%] +BM_UFlat/9 253869 253955 2757 571.1MB/s txt1 [+11.4%] +BM_UFlat/10 219292 219290 3194 544.4MB/s txt2 [+12.1%] +BM_UFlat/11 672135 672131 1000 605.5MB/s txt3 [+11.2%] +BM_UFlat/12 902512 902492 776 509.2MB/s txt4 [+12.5%] +BM_UFlat/13 372110 371998 1881 1.3GB/s bin [ +5.8%] +BM_UFlat/14 50407 50407 10000 723.5MB/s sum [+13.5%] +BM_UFlat/15 5699 5701 100000 707.2MB/s man [+12.4%] +BM_UFlat/16 83448 83424 8383 1.3GB/s pb [ +5.7%] +BM_UFlat/17 256958 256963 2723 684.1MB/s gaviota [ +7.9%] +BM_UValidate/0 42795 42796 16351 2.2GB/s html [+25.8%] +BM_UValidate/1 490672 490622 1427 1.3GB/s urls [+22.7%] +BM_UValidate/2 237 237 2950297 499.0GB/s jpg [+24.9%] +BM_UValidate/3 14610 14611 47901 6.0GB/s pdf [+26.8%] +BM_UValidate/4 171973 171990 4071 2.2GB/s html4 [+25.7%] + + + +------------------------------------------------------------------------ +r37 | snappy.mirrorbot@gmail.com | 2011-05-17 10:48:25 +0200 (Tue, 17 May 2011) | 10 lines + + +Fix the numbering of the headlines in the Snappy format description. + +R=csilvers +DELTA=4 (0 added, 0 deleted, 4 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1906 + +------------------------------------------------------------------------ +r36 | snappy.mirrorbot@gmail.com | 2011-05-16 10:59:18 +0200 (Mon, 16 May 2011) | 12 lines + + +Fix public issue #32: Add compressed format documentation for Snappy. +This text is new, but an earlier version from Zeev Tarantov was used +as reference. + +R=csilvers +DELTA=112 (111 added, 0 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1867 + +------------------------------------------------------------------------ +r35 | snappy.mirrorbot@gmail.com | 2011-05-09 23:29:02 +0200 (Mon, 09 May 2011) | 12 lines + + +Fix public issue #39: Pick out the median runs based on CPU time, +not real time. Also, use nth_element instead of sort, since we +only need one element. + +R=csilvers +DELTA=5 (3 added, 0 deleted, 2 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1799 + +------------------------------------------------------------------------ +r34 | snappy.mirrorbot@gmail.com | 2011-05-09 23:28:45 +0200 (Mon, 09 May 2011) | 19 lines + + +Fix public issue #38: Make the microbenchmark framework handle +properly cases where gettimeofday() can stand return the same +result twice (as sometimes on GNU/Hurd) or go backwards +(as when the user adjusts the clock). We avoid a division-by-zero, +and put a lower bound on the number of iterations -- the same +amount as we use to calibrate. + +We should probably use CLOCK_MONOTONIC for platforms that support +it, to be robust against clock adjustments; we already use Windows' +monotonic timers. However, that's for a later changelist. + +R=csilvers +DELTA=7 (5 added, 0 deleted, 2 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1798 + +------------------------------------------------------------------------ +r33 | snappy.mirrorbot@gmail.com | 2011-05-04 01:22:52 +0200 (Wed, 04 May 2011) | 11 lines + + +Fix public issue #37: Only link snappy_unittest against -lz and other autodetected +libraries, not libsnappy.so (which doesn't need any such dependency). + +R=csilvers +DELTA=20 (14 added, 0 deleted, 6 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1710 + +------------------------------------------------------------------------ +r32 | snappy.mirrorbot@gmail.com | 2011-05-04 01:22:33 +0200 (Wed, 04 May 2011) | 11 lines + + +Release Snappy 1.0.2, to get the license change and various other fixes into +a release. + +R=csilvers +DELTA=239 (236 added, 0 deleted, 3 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1709 + +------------------------------------------------------------------------ +r31 | snappy.mirrorbot@gmail.com | 2011-04-26 14:34:55 +0200 (Tue, 26 Apr 2011) | 15 lines + + +Fix public issue #30: Stop using gettimeofday() altogether on Win32, +as MSVC doesn't include it. Replace with QueryPerformanceCounter(), +which is monotonic and probably reasonably high-resolution. +(Some machines have traditionally had bugs in QPC, but they should +be relatively rare these days, and there's really no much better +alternative that I know of.) + +R=csilvers +DELTA=74 (55 added, 19 deleted, 0 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1556 + +------------------------------------------------------------------------ +r30 | snappy.mirrorbot@gmail.com | 2011-04-26 14:34:37 +0200 (Tue, 26 Apr 2011) | 11 lines + + +Fix public issue #31: Don't reset PATH in autogen.sh; instead, do the trickery +we need for our own build system internally. + +R=csilvers +DELTA=16 (13 added, 1 deleted, 2 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1555 + +------------------------------------------------------------------------ +r29 | snappy.mirrorbot@gmail.com | 2011-04-16 00:55:56 +0200 (Sat, 16 Apr 2011) | 12 lines + + +When including , define WIN32_LEAN_AND_MEAN first, +so we won't pull in macro definitions of things like min() and max(), +which can conflict with . + +R=csilvers +DELTA=1 (1 added, 0 deleted, 0 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1485 + +------------------------------------------------------------------------ +r28 | snappy.mirrorbot@gmail.com | 2011-04-11 11:07:01 +0200 (Mon, 11 Apr 2011) | 15 lines + + +Fix public issue #29: Write CPU timing code for Windows, based on GetProcessTimes() +instead of getursage(). + +I thought I'd already committed this patch, so that the 1.0.1 release already +would have a Windows-compatible snappy_unittest, but I'd seemingly deleted it +instead, so this is a reconstruction. + +R=csilvers +DELTA=43 (39 added, 3 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1295 + +------------------------------------------------------------------------ +r27 | snappy.mirrorbot@gmail.com | 2011-04-08 11:51:53 +0200 (Fri, 08 Apr 2011) | 22 lines + + +Include C bindings of Snappy, contributed by Martin Gieseking. + +I've made a few changes since Martin's version; mostly style nits, but also +a semantic change -- most functions that return bool in the C++ version now +return an enum, to better match typical C (and zlib) semantics. + +I've kept the copyright notice, since Martin is obviously the author here; +he has signed the contributor license agreement, though, so this should not +hinder Google's use in the future. + +We'll need to update the libtool version number to match the added interface, +but as of http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +I'm going to wait until public release. + +R=csilvers +DELTA=238 (233 added, 0 deleted, 5 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1294 + +------------------------------------------------------------------------ +r26 | snappy.mirrorbot@gmail.com | 2011-04-07 18:36:43 +0200 (Thu, 07 Apr 2011) | 13 lines + + +Replace geo.protodata with a newer version. + +The data compresses/decompresses slightly faster than the old data, and has +similar density. + +R=lookingbill +DELTA=1 (0 added, 0 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1288 + +------------------------------------------------------------------------ +r25 | snappy.mirrorbot@gmail.com | 2011-03-30 22:27:53 +0200 (Wed, 30 Mar 2011) | 12 lines + + +Fix public issue #27: Add HAVE_CONFIG_H tests around the config.h +inclusion in snappy-stubs-internal.h, which eases compiling outside the +automake/autoconf framework. + +R=csilvers +DELTA=5 (4 added, 1 deleted, 0 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1152 + +------------------------------------------------------------------------ +r24 | snappy.mirrorbot@gmail.com | 2011-03-30 22:27:39 +0200 (Wed, 30 Mar 2011) | 13 lines + + +Fix public issue #26: Take memory allocation and reallocation entirely out of the +Measure() loop. This gives all algorithms a small speed boost, except Snappy which +already didn't do reallocation (so the measurements were slightly biased in its +favor). + +R=csilvers +DELTA=92 (69 added, 9 deleted, 14 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1151 + +------------------------------------------------------------------------ +r23 | snappy.mirrorbot@gmail.com | 2011-03-30 22:25:09 +0200 (Wed, 30 Mar 2011) | 18 lines + + +Renamed "namespace zippy" to "namespace snappy" to reduce +the differences from the opensource code. Will make it easier +in the future to mix-and-match third-party code that uses +snappy with google code. + +Currently, csearch shows that the only external user of +"namespace zippy" is some bigtable code that accesses +a TEST variable, which is temporarily kept in the zippy +namespace. + +R=sesse +DELTA=123 (18 added, 3 deleted, 102 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1150 + +------------------------------------------------------------------------ +r22 | snappy.mirrorbot@gmail.com | 2011-03-29 00:17:04 +0200 (Tue, 29 Mar 2011) | 11 lines + + +Put back the final few lines of what was truncated during the +license header change. + +R=csilvers +DELTA=5 (4 added, 0 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1094 + +------------------------------------------------------------------------ +r21 | snappy.mirrorbot@gmail.com | 2011-03-26 03:34:34 +0100 (Sat, 26 Mar 2011) | 20 lines + + +Change on 2011-03-25 19:18:00-07:00 by sesse + + Replace the Apache 2.0 license header by the BSD-type license header; + somehow a lot of the files were missed in the last round. + + R=dannyb,csilvers + DELTA=147 (74 added, 2 deleted, 71 changed) + +Change on 2011-03-25 19:25:07-07:00 by sesse + + Unbreak the build; the relicensing removed a bit too much (only comments + were intended, but I also accidentially removed some of the top lines of + the actual source). + + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1072 + +------------------------------------------------------------------------ +r20 | snappy.mirrorbot@gmail.com | 2011-03-25 17:14:41 +0100 (Fri, 25 Mar 2011) | 10 lines + + +Change Snappy from the Apache 2.0 to a BSD-type license. + +R=dannyb +DELTA=328 (80 added, 184 deleted, 64 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1061 + +------------------------------------------------------------------------ +r19 | snappy.mirrorbot@gmail.com | 2011-03-25 01:39:01 +0100 (Fri, 25 Mar 2011) | 11 lines + + +Release Snappy 1.0.1, to soup up all the various small changes +that have been made since release. + +R=csilvers +DELTA=266 (260 added, 0 deleted, 6 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1057 + +------------------------------------------------------------------------ +r18 | snappy.mirrorbot@gmail.com | 2011-03-24 20:15:54 +0100 (Thu, 24 Mar 2011) | 11 lines + + +Fix a microbenchmark crash on mingw32; seemingly %lld is not universally +supported on Windows, and %I64d is recommended instead. + +R=csilvers +DELTA=6 (5 added, 0 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1034 + +------------------------------------------------------------------------ +r17 | snappy.mirrorbot@gmail.com | 2011-03-24 20:15:27 +0100 (Thu, 24 Mar 2011) | 13 lines + + +Fix public issue #19: Fix unit test when Google Test is installed but the +gflags package isn't (Google Test is not properly initialized). + +Patch by Martin Gieseking. + +R=csilvers +DELTA=2 (1 added, 0 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1033 + +------------------------------------------------------------------------ +r16 | snappy.mirrorbot@gmail.com | 2011-03-24 20:13:57 +0100 (Thu, 24 Mar 2011) | 15 lines + + +Make the unit test work on systems without mmap(). This is required for, +among others, Windows support. For Windows in specific, we could have used +CreateFileMapping/MapViewOfFile, but this should at least get us a bit closer +to compiling, and is of course also relevant for embedded systems with no MMU. + +(Part 2/2) + +R=csilvers +DELTA=15 (12 added, 3 deleted, 0 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1032 + +------------------------------------------------------------------------ +r15 | snappy.mirrorbot@gmail.com | 2011-03-24 20:12:27 +0100 (Thu, 24 Mar 2011) | 15 lines + + +Make the unit test work on systems without mmap(). This is required for, +among others, Windows support. For Windows in specific, we could have used +CreateFileMapping/MapViewOfFile, but this should at least get us a bit closer +to compiling, and is of course also relevant for embedded systems with no MMU. + +(Part 1/2) + +R=csilvers +DELTA=9 (8 added, 0 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1031 + +------------------------------------------------------------------------ +r14 | snappy.mirrorbot@gmail.com | 2011-03-24 00:17:36 +0100 (Thu, 24 Mar 2011) | 14 lines + + +Fix public issue #12: Don't keep autogenerated auto* files in Subversion; +it causes problems with others sending patches etc.. + +We can't get this 100% hermetic anyhow, due to files like lt~obsolete.m4, +so we can just as well go cleanly in the other direction. + +R=csilvers +DELTA=21038 (0 added, 21036 deleted, 2 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=1012 + +------------------------------------------------------------------------ +r13 | snappy.mirrorbot@gmail.com | 2011-03-23 18:50:49 +0100 (Wed, 23 Mar 2011) | 11 lines + + +Fix public issue tracker bug #3: Call AC_SUBST([LIBTOOL_DEPS]), or the rule +to rebuild libtool in Makefile.am won't work. + +R=csilvers +DELTA=1 (1 added, 0 deleted, 0 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=997 + +------------------------------------------------------------------------ +r12 | snappy.mirrorbot@gmail.com | 2011-03-23 12:16:39 +0100 (Wed, 23 Mar 2011) | 11 lines + + +Fix public issue #10: Don't add GTEST_CPPFLAGS to snappy_unittest_CXXFLAGS; +it's not needed (CPPFLAGS are always included when compiling). + +R=csilvers +DELTA=1 (0 added, 1 deleted, 0 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=994 + +------------------------------------------------------------------------ +r11 | snappy.mirrorbot@gmail.com | 2011-03-23 12:16:18 +0100 (Wed, 23 Mar 2011) | 11 lines + + +Fix public issue #9: Add -Wall -Werror to automake flags. +(This concerns automake itself, not the C++ compiler.) + +R=csilvers +DELTA=4 (3 added, 0 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=993 + +------------------------------------------------------------------------ +r10 | snappy.mirrorbot@gmail.com | 2011-03-23 12:13:37 +0100 (Wed, 23 Mar 2011) | 10 lines + + +Fix a typo in the Snappy README file. + +R=csilvers +DELTA=1 (0 added, 0 deleted, 1 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=992 + +------------------------------------------------------------------------ +r9 | snappy.mirrorbot@gmail.com | 2011-03-23 12:13:13 +0100 (Wed, 23 Mar 2011) | 11 lines + + +Fix public issue #6: Add a --with-gflags for disabling gflags autodetection +and using a manually given setting (use/don't use) instead. + +R=csilvers +DELTA=16 (13 added, 0 deleted, 3 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=991 + +------------------------------------------------------------------------ +r8 | snappy.mirrorbot@gmail.com | 2011-03-23 12:12:44 +0100 (Wed, 23 Mar 2011) | 12 lines + + +Fix public issue #5: Replace the EXTRA_LIBSNAPPY_LDFLAGS setup with something +slightly more standard, that also doesn't leak libtool command-line into +configure.ac. + +R=csilvers +DELTA=7 (0 added, 4 deleted, 3 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=990 + +------------------------------------------------------------------------ +r7 | snappy.mirrorbot@gmail.com | 2011-03-23 12:12:22 +0100 (Wed, 23 Mar 2011) | 10 lines + + +Fix public issue #4: Properly quote all macro arguments in configure.ac. + +R=csilvers +DELTA=16 (0 added, 0 deleted, 16 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=989 + +------------------------------------------------------------------------ +r6 | snappy.mirrorbot@gmail.com | 2011-03-23 12:11:54 +0100 (Wed, 23 Mar 2011) | 11 lines + + +Fix public issue #7: Don't use internal variables named ac_*, as those belong +to autoconf's namespace. + +R=csilvers +DELTA=6 (0 added, 0 deleted, 6 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=988 + +------------------------------------------------------------------------ +r5 | snappy.mirrorbot@gmail.com | 2011-03-23 12:11:09 +0100 (Wed, 23 Mar 2011) | 10 lines + + +Add missing licensing headers to a few files. (Part 2/2.) + +R=csilvers +DELTA=12 (12 added, 0 deleted, 0 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=987 + +------------------------------------------------------------------------ +r4 | snappy.mirrorbot@gmail.com | 2011-03-23 12:10:39 +0100 (Wed, 23 Mar 2011) | 10 lines + + +Add mising licensing headers to a few files. (Part 1/2.) + +R=csilvers +DELTA=24 (24 added, 0 deleted, 0 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=986 + +------------------------------------------------------------------------ +r3 | snappy.mirrorbot@gmail.com | 2011-03-23 12:10:04 +0100 (Wed, 23 Mar 2011) | 11 lines + + +Use the correct license file for the Apache 2.0 license; +spotted by Florian Weimer. + +R=csilvers +DELTA=202 (174 added, 0 deleted, 28 changed) + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION=985 + +------------------------------------------------------------------------ +r2 | snappy.mirrorbot@gmail.com | 2011-03-18 18:14:15 +0100 (Fri, 18 Mar 2011) | 6 lines + + + + +Revision created by MOE tool push_codebase. +MOE_MIGRATION= + +------------------------------------------------------------------------ +r1 | sesse@google.com | 2011-03-18 18:13:52 +0100 (Fri, 18 Mar 2011) | 2 lines + +Create trunk directory. + +------------------------------------------------------------------------ diff --git a/chromium/third_party/snappy/src/Makefile.am b/chromium/third_party/snappy/src/Makefile.am new file mode 100644 index 00000000000..f17b2e35362 --- /dev/null +++ b/chromium/third_party/snappy/src/Makefile.am @@ -0,0 +1,23 @@ +ACLOCAL_AMFLAGS = -I m4 + +# Library. +lib_LTLIBRARIES = libsnappy.la +libsnappy_la_SOURCES = snappy.cc snappy-sinksource.cc snappy-stubs-internal.cc snappy-c.cc +libsnappy_la_LDFLAGS = -version-info $(SNAPPY_LTVERSION) + +include_HEADERS = snappy.h snappy-sinksource.h snappy-stubs-public.h snappy-c.h +noinst_HEADERS = snappy-internal.h snappy-stubs-internal.h snappy-test.h + +# Unit tests and benchmarks. +snappy_unittest_CPPFLAGS = $(gflags_CFLAGS) $(GTEST_CPPFLAGS) +snappy_unittest_SOURCES = snappy_unittest.cc snappy-test.cc +snappy_unittest_LDFLAGS = $(GTEST_LDFLAGS) +snappy_unittest_LDADD = libsnappy.la $(UNITTEST_LIBS) $(gflags_LIBS) $(GTEST_LIBS) +TESTS = snappy_unittest +noinst_PROGRAMS = $(TESTS) + +EXTRA_DIST = autogen.sh testdata/alice29.txt testdata/asyoulik.txt testdata/baddata1.snappy testdata/baddata2.snappy testdata/baddata3.snappy testdata/cp.html testdata/fields.c testdata/geo.protodata testdata/grammar.lsp testdata/house.jpg testdata/html testdata/html_x_4 testdata/kennedy.xls testdata/kppkn.gtb testdata/lcet10.txt testdata/mapreduce-osdi-1.pdf testdata/plrabn12.txt testdata/ptt5 testdata/sum testdata/urls.10K testdata/xargs.1 +dist_doc_DATA = ChangeLog COPYING INSTALL NEWS README format_description.txt framing_format.txt + +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck diff --git a/chromium/third_party/snappy/src/NEWS b/chromium/third_party/snappy/src/NEWS new file mode 100644 index 00000000000..ab9bf90a320 --- /dev/null +++ b/chromium/third_party/snappy/src/NEWS @@ -0,0 +1,104 @@ +Snappy v1.1.0, January 18th 2013: + + * Snappy now uses 64 kB block size instead of 32 kB. On average, + this means it compresses about 3% denser (more so for some + inputs), at the same or better speeds. + + * libsnappy no longer depends on iostream. + + * Some small performance improvements in compression on x86 + (0.5–1%). + + * Various portability fixes for ARM-based platforms, for MSVC, + and for GNU/Hurd. + + +Snappy v1.0.5, February 24th 2012: + + * More speed improvements. Exactly how big will depend on + the architecture: + + - 3–10% faster decompression for the base case (x86-64). + + - ARMv7 and higher can now use unaligned accesses, + and will see about 30% faster decompression and + 20–40% faster compression. + + - 32-bit platforms (ARM and 32-bit x86) will see 2–5% + faster compression. + + These are all cumulative (e.g., ARM gets all three speedups). + + * Fixed an issue where the unit test would crash on system + with less than 256 MB address space available, + e.g. some embedded platforms. + + * Added a framing format description, for use over e.g. HTTP, + or for a command-line compressor. We do not have any + implementations of this at the current point, but there seems + to be enough of a general interest in the topic. + Also make the format description slightly clearer. + + * Remove some compile-time warnings in -Wall + (mostly signed/unsigned comparisons), for easier embedding + into projects that use -Wall -Werror. + + +Snappy v1.0.4, September 15th 2011: + + * Speeded up the decompressor somewhat; typically about 2–8% + for Core i7, in 64-bit mode (comparable for Opteron). + Somewhat more for some tests, almost no gain for others. + + * Make Snappy compile on certain platforms it didn't before + (Solaris with SunPro C++, HP-UX, AIX). + + * Correct some minor errors in the format description. + + +Snappy v1.0.3, June 2nd 2011: + + * Speeded up the decompressor somewhat; about 3-6% for Core 2, + 6-13% for Core i7, and 5-12% for Opteron (all in 64-bit mode). + + * Added compressed format documentation. This text is new, + but an earlier version from Zeev Tarantov was used as reference. + + * Only link snappy_unittest against -lz and other autodetected + libraries, not libsnappy.so (which doesn't need any such dependency). + + * Fixed some display issues in the microbenchmarks, one of which would + frequently make the test crash on GNU/Hurd. + + +Snappy v1.0.2, April 29th 2011: + + * Relicense to a BSD-type license. + + * Added C bindings, contributed by Martin Gieseking. + + * More Win32 fixes, in particular for MSVC. + + * Replace geo.protodata with a newer version. + + * Fix timing inaccuracies in the unit test when comparing Snappy + to other algorithms. + + +Snappy v1.0.1, March 25th 2011: + +This is a maintenance release, mostly containing minor fixes. +There is no new functionality. The most important fixes include: + + * The COPYING file and all licensing headers now correctly state that + Snappy is licensed under the Apache 2.0 license. + + * snappy_unittest should now compile natively under Windows, + as well as on embedded systems with no mmap(). + + * Various autotools nits have been fixed. + + +Snappy v1.0, March 17th 2011: + + * Initial version. diff --git a/chromium/third_party/snappy/src/README b/chromium/third_party/snappy/src/README new file mode 100644 index 00000000000..3bc8888f991 --- /dev/null +++ b/chromium/third_party/snappy/src/README @@ -0,0 +1,135 @@ +Snappy, a fast compressor/decompressor. + + +Introduction +============ + +Snappy is a compression/decompression library. It does not aim for maximum +compression, or compatibility with any other compression library; instead, +it aims for very high speeds and reasonable compression. For instance, +compared to the fastest mode of zlib, Snappy is an order of magnitude faster +for most inputs, but the resulting compressed files are anywhere from 20% to +100% bigger. (For more information, see "Performance", below.) + +Snappy has the following properties: + + * Fast: Compression speeds at 250 MB/sec and beyond, with no assembler code. + See "Performance" below. + * Stable: Over the last few years, Snappy has compressed and decompressed + petabytes of data in Google's production environment. The Snappy bitstream + format is stable and will not change between versions. + * Robust: The Snappy decompressor is designed not to crash in the face of + corrupted or malicious input. + * Free and open source software: Snappy is licensed under a BSD-type license. + For more information, see the included COPYING file. + +Snappy has previously been called "Zippy" in some Google presentations +and the like. + + +Performance +=========== + +Snappy is intended to be fast. On a single core of a Core i7 processor +in 64-bit mode, it compresses at about 250 MB/sec or more and decompresses at +about 500 MB/sec or more. (These numbers are for the slowest inputs in our +benchmark suite; others are much faster.) In our tests, Snappy usually +is faster than algorithms in the same class (e.g. LZO, LZF, FastLZ, QuickLZ, +etc.) while achieving comparable compression ratios. + +Typical compression ratios (based on the benchmark suite) are about 1.5-1.7x +for plain text, about 2-4x for HTML, and of course 1.0x for JPEGs, PNGs and +other already-compressed data. Similar numbers for zlib in its fastest mode +are 2.6-2.8x, 3-7x and 1.0x, respectively. More sophisticated algorithms are +capable of achieving yet higher compression rates, although usually at the +expense of speed. Of course, compression ratio will vary significantly with +the input. + +Although Snappy should be fairly portable, it is primarily optimized +for 64-bit x86-compatible processors, and may run slower in other environments. +In particular: + + - Snappy uses 64-bit operations in several places to process more data at + once than would otherwise be possible. + - Snappy assumes unaligned 32- and 64-bit loads and stores are cheap. + On some platforms, these must be emulated with single-byte loads + and stores, which is much slower. + - Snappy assumes little-endian throughout, and needs to byte-swap data in + several places if running on a big-endian platform. + +Experience has shown that even heavily tuned code can be improved. +Performance optimizations, whether for 64-bit x86 or other platforms, +are of course most welcome; see "Contact", below. + + +Usage +===== + +Note that Snappy, both the implementation and the main interface, +is written in C++. However, several third-party bindings to other languages +are available; see the Google Code page at http://code.google.com/p/snappy/ +for more information. Also, if you want to use Snappy from C code, you can +use the included C bindings in snappy-c.h. + +To use Snappy from your own C++ program, include the file "snappy.h" from +your calling file, and link against the compiled library. + +There are many ways to call Snappy, but the simplest possible is + + snappy::Compress(input.data(), input.size(), &output); + +and similarly + + snappy::Uncompress(input.data(), input.size(), &output); + +where "input" and "output" are both instances of std::string. + +There are other interfaces that are more flexible in various ways, including +support for custom (non-array) input sources. See the header file for more +information. + + +Tests and benchmarks +==================== + +When you compile Snappy, snappy_unittest is compiled in addition to the +library itself. You do not need it to use the compressor from your own library, +but it contains several useful components for Snappy development. + +First of all, it contains unit tests, verifying correctness on your machine in +various scenarios. If you want to change or optimize Snappy, please run the +tests to verify you have not broken anything. Note that if you have the +Google Test library installed, unit test behavior (especially failures) will be +significantly more user-friendly. You can find Google Test at + + http://code.google.com/p/googletest/ + +You probably also want the gflags library for handling of command-line flags; +you can find it at + + http://code.google.com/p/google-gflags/ + +In addition to the unit tests, snappy contains microbenchmarks used to +tune compression and decompression performance. These are automatically run +before the unit tests, but you can disable them using the flag +--run_microbenchmarks=false if you have gflags installed (otherwise you will +need to edit the source). + +Finally, snappy can benchmark Snappy against a few other compression libraries +(zlib, LZO, LZF, FastLZ and QuickLZ), if they were detected at configure time. +To benchmark using a given file, give the compression algorithm you want to test +Snappy against (e.g. --zlib) and then a list of one or more file names on the +command line. The testdata/ directory contains the files used by the +microbenchmark, which should provide a reasonably balanced starting point for +benchmarking. (Note that baddata[1-3].snappy are not intended as benchmarks; they +are used to verify correctness in the presence of corrupted data in the unit +test.) + + +Contact +======= + +Snappy is distributed through Google Code. For the latest version, a bug tracker, +and other information, see + + http://code.google.com/p/snappy/ diff --git a/chromium/third_party/snappy/src/autogen.sh b/chromium/third_party/snappy/src/autogen.sh new file mode 100755 index 00000000000..9d0ebe93f42 --- /dev/null +++ b/chromium/third_party/snappy/src/autogen.sh @@ -0,0 +1,7 @@ +#! /bin/sh -e +rm -rf autom4te.cache +aclocal -I m4 +autoheader +libtoolize --copy +automake --add-missing --copy +autoconf diff --git a/chromium/third_party/snappy/src/configure.ac b/chromium/third_party/snappy/src/configure.ac new file mode 100644 index 00000000000..e06f0be99d6 --- /dev/null +++ b/chromium/third_party/snappy/src/configure.ac @@ -0,0 +1,126 @@ +m4_define([snappy_major], [1]) +m4_define([snappy_minor], [1]) +m4_define([snappy_patchlevel], [0]) + +# Libtool shared library interface versions (current:revision:age) +# Update this value for every release! (A:B:C will map to foo.so.(A-C).C.B) +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +m4_define([snappy_ltversion], [2:4:1]) + +AC_INIT([snappy], [snappy_major.snappy_minor.snappy_patchlevel]) +AC_CONFIG_MACRO_DIR([m4]) + +# These are flags passed to automake (though they look like gcc flags!) +AM_INIT_AUTOMAKE([-Wall]) + +LT_INIT +AC_SUBST([LIBTOOL_DEPS]) +AC_PROG_CXX +AC_LANG([C++]) +AC_C_BIGENDIAN +AC_CHECK_HEADERS([stdint.h stddef.h sys/mman.h sys/resource.h windows.h byteswap.h sys/byteswap.h sys/endian.h sys/time.h]) + +# Don't use AC_FUNC_MMAP, as it checks for mappings of already-mapped memory, +# which we don't need (and does not exist on Windows). +AC_CHECK_FUNC([mmap]) + +GTEST_LIB_CHECK([], [true], [true # Ignore; we can live without it.]) + +AC_ARG_WITH([gflags], + [AS_HELP_STRING( + [--with-gflags], + [use Google Flags package to enhance the unit test @<:@default=check@:>@])], + [], + [with_gflags=check]) + +if test "x$with_gflags" != "xno"; then + PKG_CHECK_MODULES( + [gflags], + [libgflags], + [AC_DEFINE([HAVE_GFLAGS], [1], [Use the gflags package for command-line parsing.])], + [if test "x$with_gflags" != "xcheck"; then + AC_MSG_FAILURE([--with-gflags was given, but test for gflags failed]) + fi]) +fi + +# See if we have __builtin_expect. +# TODO: Use AC_CACHE. +AC_MSG_CHECKING([if the compiler supports __builtin_expect]) + +AC_TRY_COMPILE(, [ + return __builtin_expect(1, 1) ? 1 : 0 +], [ + snappy_have_builtin_expect=yes + AC_MSG_RESULT([yes]) +], [ + snappy_have_builtin_expect=no + AC_MSG_RESULT([no]) +]) +if test x$snappy_have_builtin_expect = xyes ; then + AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.]) +fi + +# See if we have working count-trailing-zeros intrinsics. +# TODO: Use AC_CACHE. +AC_MSG_CHECKING([if the compiler supports __builtin_ctzll]) + +AC_TRY_COMPILE(, [ + return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0 +], [ + snappy_have_builtin_ctz=yes + AC_MSG_RESULT([yes]) +], [ + snappy_have_builtin_ctz=no + AC_MSG_RESULT([no]) +]) +if test x$snappy_have_builtin_ctz = xyes ; then + AC_DEFINE([HAVE_BUILTIN_CTZ], [1], [Define to 1 if the compiler supports __builtin_ctz and friends.]) +fi + +# Other compression libraries; the unit test can use these for comparison +# if they are available. If they are not found, just ignore. +UNITTEST_LIBS="" +AC_DEFUN([CHECK_EXT_COMPRESSION_LIB], [ + AH_CHECK_LIB([$1]) + AC_CHECK_LIB( + [$1], + [$2], + [ + AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1)) + UNITTEST_LIBS="-l$1 $UNITTEST_LIBS" + ], + [true] + ) +]) +CHECK_EXT_COMPRESSION_LIB([z], [zlibVersion]) +CHECK_EXT_COMPRESSION_LIB([lzo2], [lzo1x_1_15_compress]) +CHECK_EXT_COMPRESSION_LIB([lzf], [lzf_compress]) +CHECK_EXT_COMPRESSION_LIB([fastlz], [fastlz_compress]) +CHECK_EXT_COMPRESSION_LIB([quicklz], [qlz_compress]) +AC_SUBST([UNITTEST_LIBS]) + +# These are used by snappy-stubs-public.h.in. +if test "$ac_cv_header_stdint_h" = "yes"; then + AC_SUBST([ac_cv_have_stdint_h], [1]) +else + AC_SUBST([ac_cv_have_stdint_h], [0]) +fi +if test "$ac_cv_header_stddef_h" = "yes"; then + AC_SUBST([ac_cv_have_stddef_h], [1]) +else + AC_SUBST([ac_cv_have_stddef_h], [0]) +fi + +# Export the version to snappy-stubs-public.h. +SNAPPY_MAJOR="snappy_major" +SNAPPY_MINOR="snappy_minor" +SNAPPY_PATCHLEVEL="snappy_patchlevel" + +AC_SUBST([SNAPPY_MAJOR]) +AC_SUBST([SNAPPY_MINOR]) +AC_SUBST([SNAPPY_PATCHLEVEL]) +AC_SUBST([SNAPPY_LTVERSION], snappy_ltversion) + +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile snappy-stubs-public.h]) +AC_OUTPUT diff --git a/chromium/third_party/snappy/src/format_description.txt b/chromium/third_party/snappy/src/format_description.txt new file mode 100644 index 00000000000..20db66c1f26 --- /dev/null +++ b/chromium/third_party/snappy/src/format_description.txt @@ -0,0 +1,110 @@ +Snappy compressed format description +Last revised: 2011-10-05 + + +This is not a formal specification, but should suffice to explain most +relevant parts of how the Snappy format works. It is originally based on +text by Zeev Tarantov. + +Snappy is a LZ77-type compressor with a fixed, byte-oriented encoding. +There is no entropy encoder backend nor framing layer -- the latter is +assumed to be handled by other parts of the system. + +This document only describes the format, not how the Snappy compressor nor +decompressor actually works. The correctness of the decompressor should not +depend on implementation details of the compressor, and vice versa. + + +1. Preamble + +The stream starts with the uncompressed length (up to a maximum of 2^32 - 1), +stored as a little-endian varint. Varints consist of a series of bytes, +where the lower 7 bits are data and the upper bit is set iff there are +more bytes to be read. In other words, an uncompressed length of 64 would +be stored as 0x40, and an uncompressed length of 2097150 (0x1FFFFE) +would be stored as 0xFE 0xFF 0x7F. + + +2. The compressed stream itself + +There are two types of elements in a Snappy stream: Literals and +copies (backreferences). There is no restriction on the order of elements, +except that the stream naturally cannot start with a copy. (Having +two literals in a row is never optimal from a compression point of +view, but nevertheless fully permitted.) Each element starts with a tag byte, +and the lower two bits of this tag byte signal what type of element will +follow: + + 00: Literal + 01: Copy with 1-byte offset + 10: Copy with 2-byte offset + 11: Copy with 4-byte offset + +The interpretation of the upper six bits are element-dependent. + + +2.1. Literals (00) + +Literals are uncompressed data stored directly in the byte stream. +The literal length is stored differently depending on the length +of the literal: + + - For literals up to and including 60 bytes in length, the upper + six bits of the tag byte contain (len-1). The literal follows + immediately thereafter in the bytestream. + - For longer literals, the (len-1) value is stored after the tag byte, + little-endian. The upper six bits of the tag byte describe how + many bytes are used for the length; 60, 61, 62 or 63 for + 1-4 bytes, respectively. The literal itself follows after the + length. + + +2.2. Copies + +Copies are references back into previous decompressed data, telling +the decompressor to reuse data it has previously decoded. +They encode two values: The _offset_, saying how many bytes back +from the current position to read, and the _length_, how many bytes +to copy. Offsets of zero can be encoded, but are not legal; +similarly, it is possible to encode backreferences that would +go past the end of the block (offset > current decompressed position), +which is also nonsensical and thus not allowed. + +As in most LZ77-based compressors, the length can be larger than the offset, +yielding a form of run-length encoding (RLE). For instance, +"xababab" could be encoded as + + + +Note that since the current Snappy compressor works in 32 kB +blocks and does not do matching across blocks, it will never produce +a bitstream with offsets larger than about 32768. However, the +decompressor should not rely on this, as it may change in the future. + +There are several different kinds of copy elements, depending on +the amount of bytes to be copied (length), and how far back the +data to be copied is (offset). + + +2.2.1. Copy with 1-byte offset (01) + +These elements can encode lengths between [4..11] bytes and offsets +between [0..2047] bytes. (len-4) occupies three bits and is stored +in bits [2..4] of the tag byte. The offset occupies 11 bits, of which the +upper three are stored in the upper three bits ([5..7]) of the tag byte, +and the lower eight are stored in a byte following the tag byte. + + +2.2.2. Copy with 2-byte offset (10) + +These elements can encode lengths between [1..64] and offsets from +[0..65535]. (len-1) occupies six bits and is stored in the upper +six bits ([2..7]) of the tag byte. The offset is stored as a +little-endian 16-bit integer in the two bytes following the tag byte. + + +2.2.3. Copy with 4-byte offset (11) + +These are like the copies with 2-byte offsets (see previous subsection), +except that the offset is stored as a 32-bit integer instead of a +16-bit integer (and thus will occupy four bytes). diff --git a/chromium/third_party/snappy/src/framing_format.txt b/chromium/third_party/snappy/src/framing_format.txt new file mode 100644 index 00000000000..32b1e597d84 --- /dev/null +++ b/chromium/third_party/snappy/src/framing_format.txt @@ -0,0 +1,124 @@ +Snappy framing format description +Last revised: 2013-01-05 + +This format decribes a framing format for Snappy, allowing compressing to +files or streams that can then more easily be decompressed without having +to hold the entire stream in memory. It also provides data checksums to +help verify integrity. It does not provide metadata checksums, so it does +not protect against e.g. all forms of truncations. + +Implementation of the framing format is optional for Snappy compressors and +decompressor; it is not part of the Snappy core specification. + + +1. General structure + +The file consists solely of chunks, lying back-to-back with no padding +in between. Each chunk consists first a single byte of chunk identifier, +then a three-byte little-endian length of the chunk in bytes (from 0 to +16777215, inclusive), and then the data if any. The four bytes of chunk +header is not counted in the data length. + +The different chunk types are listed below. The first chunk must always +be the stream identifier chunk (see section 4.1, below). The stream +ends when the file ends -- there is no explicit end-of-file marker. + + +2. File type identification + +The following identifiers for this format are recommended where appropriate. +However, note that none have been registered officially, so this is only to +be taken as a guideline. We use "Snappy framed" to distinguish between this +format and raw Snappy data. + + File extension: .sz + MIME type: application/x-snappy-framed + HTTP Content-Encoding: x-snappy-framed + + +3. Checksum format + +Some chunks have data protected by a checksum (the ones that do will say so +explicitly). The checksums are always masked CRC-32Cs. + +A description of CRC-32C can be found in RFC 3720, section 12.1, with +examples in section B.4. + +Checksums are not stored directly, but masked, as checksumming data and +then its own checksum can be problematic. The masking is the same as used +in Apache Hadoop: Rotate the checksum by 15 bits, then add the constant +0xa282ead8 (using wraparound as normal for unsigned integers). This is +equivalent to the following C code: + + uint32_t mask_checksum(uint32_t x) { + return ((x >> 15) | (x << 17)) + 0xa282ead8; + } + +Note that the masking is reversible. + +The checksum is always stored as a four bytes long integer, in little-endian. + + +4. Chunk types + +The currently supported chunk types are described below. The list may +be extended in the future. + + +4.1. Stream identifier (chunk type 0xff) + +The stream identifier is always the first element in the stream. +It is exactly six bytes long and contains "sNaPpY" in ASCII. This means that +a valid Snappy framed stream always starts with the bytes + + 0xff 0x06 0x00 0x00 0x73 0x4e 0x61 0x50 0x70 0x59 + +The stream identifier chunk can come multiple times in the stream besides +the first; if such a chunk shows up, it should simply be ignored, assuming +it has the right length and contents. This allows for easy concatenation of +compressed files without the need for re-framing. + + +4.2. Compressed data (chunk type 0x00) + +Compressed data chunks contain a normal Snappy compressed bitstream; +see the compressed format specification. The compressed data is preceded by +the CRC-32C (see section 3) of the _uncompressed_ data. + +Note that the data portion of the chunk, i.e., the compressed contents, +can be at most 16777211 bytes (2^24 - 1, minus the checksum). +However, we place an additional restriction that the uncompressed data +in a chunk must be no longer than 65536 bytes. This allows consumers to +easily use small fixed-size buffers. + + +4.3. Uncompressed data (chunk type 0x01) + +Uncompressed data chunks allow a compressor to send uncompressed, +raw data; this is useful if, for instance, uncompressible or +near-incompressible data is detected, and faster decompression is desired. + +As in the compressed chunks, the data is preceded by its own masked +CRC-32C (see section 3). + +An uncompressed data chunk, like compressed data chunks, should contain +no more than 65536 data bytes, so the maximum legal chunk length with the +checksum is 65540. + + +4.4. Reserved unskippable chunks (chunk types 0x02-0x7f) + +These are reserved for future expansion. A decoder that sees such a chunk +should immediately return an error, as it must assume it cannot decode the +stream correctly. + +Future versions of this specification may define meanings for these chunks. + + +4.5. Reserved skippable chunks (chunk types 0x80-0xfe) + +These are also reserved for future expansion, but unlike the chunks +described in 4.4, a decoder seeing these must skip them and continue +decoding. + +Future versions of this specification may define meanings for these chunks. diff --git a/chromium/third_party/snappy/src/m4/gtest.m4 b/chromium/third_party/snappy/src/m4/gtest.m4 new file mode 100644 index 00000000000..98e61f9624b --- /dev/null +++ b/chromium/third_party/snappy/src/m4/gtest.m4 @@ -0,0 +1,74 @@ +dnl GTEST_LIB_CHECK([minimum version [, +dnl action if found [,action if not found]]]) +dnl +dnl Check for the presence of the Google Test library, optionally at a minimum +dnl version, and indicate a viable version with the HAVE_GTEST flag. It defines +dnl standard variables for substitution including GTEST_CPPFLAGS, +dnl GTEST_CXXFLAGS, GTEST_LDFLAGS, and GTEST_LIBS. It also defines +dnl GTEST_VERSION as the version of Google Test found. Finally, it provides +dnl optional custom action slots in the event GTEST is found or not. +AC_DEFUN([GTEST_LIB_CHECK], +[ +dnl Provide a flag to enable or disable Google Test usage. +AC_ARG_ENABLE([gtest], + [AS_HELP_STRING([--enable-gtest], + [Enable tests using the Google C++ Testing Framework. + (Default is enabled.)])], + [], + [enable_gtest=]) +AC_ARG_VAR([GTEST_CONFIG], + [The exact path of Google Test's 'gtest-config' script.]) +AC_ARG_VAR([GTEST_CPPFLAGS], + [C-like preprocessor flags for Google Test.]) +AC_ARG_VAR([GTEST_CXXFLAGS], + [C++ compile flags for Google Test.]) +AC_ARG_VAR([GTEST_LDFLAGS], + [Linker path and option flags for Google Test.]) +AC_ARG_VAR([GTEST_LIBS], + [Library linking flags for Google Test.]) +AC_ARG_VAR([GTEST_VERSION], + [The version of Google Test available.]) +HAVE_GTEST="no" +AS_IF([test "x${enable_gtest}" != "xno"], + [AC_MSG_CHECKING([for 'gtest-config']) + AS_IF([test "x${enable_gtest}" = "xyes"], + [AS_IF([test -x "${enable_gtest}/scripts/gtest-config"], + [GTEST_CONFIG="${enable_gtest}/scripts/gtest-config"], + [GTEST_CONFIG="${enable_gtest}/bin/gtest-config"]) + AS_IF([test -x "${GTEST_CONFIG}"], [], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([dnl +Unable to locate either a built or installed Google Test. +The specific location '${enable_gtest}' was provided for a built or installed +Google Test, but no 'gtest-config' script could be found at this location.]) + ])], + [AC_PATH_PROG([GTEST_CONFIG], [gtest-config])]) + AS_IF([test -x "${GTEST_CONFIG}"], + [AC_MSG_RESULT([${GTEST_CONFIG}]) + m4_ifval([$1], + [_gtest_min_version="--min-version=$1" + AC_MSG_CHECKING([for Google Test at least version >= $1])], + [_gtest_min_version="--min-version=0" + AC_MSG_CHECKING([for Google Test])]) + AS_IF([${GTEST_CONFIG} ${_gtest_min_version}], + [AC_MSG_RESULT([yes]) + HAVE_GTEST='yes'], + [AC_MSG_RESULT([no])])], + [AC_MSG_RESULT([no])]) + AS_IF([test "x${HAVE_GTEST}" = "xyes"], + [GTEST_CPPFLAGS=`${GTEST_CONFIG} --cppflags` + GTEST_CXXFLAGS=`${GTEST_CONFIG} --cxxflags` + GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags` + GTEST_LIBS=`${GTEST_CONFIG} --libs` + GTEST_VERSION=`${GTEST_CONFIG} --version` + AC_DEFINE([HAVE_GTEST],[1],[Defined when Google Test is available.])], + [AS_IF([test "x${enable_gtest}" = "xyes"], + [AC_MSG_ERROR([dnl +Google Test was enabled, but no viable version could be found.]) + ])])]) +AC_SUBST([HAVE_GTEST]) +AM_CONDITIONAL([HAVE_GTEST],[test "x$HAVE_GTEST" = "xyes"]) +AS_IF([test "x$HAVE_GTEST" = "xyes"], + [m4_ifval([$2], [$2])], + [m4_ifval([$3], [$3])]) +]) diff --git a/chromium/third_party/snappy/src/snappy-c.cc b/chromium/third_party/snappy/src/snappy-c.cc new file mode 100644 index 00000000000..473a0b09786 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-c.cc @@ -0,0 +1,90 @@ +// Copyright 2011 Martin Gieseking . +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "snappy.h" +#include "snappy-c.h" + +extern "C" { + +snappy_status snappy_compress(const char* input, + size_t input_length, + char* compressed, + size_t *compressed_length) { + if (*compressed_length < snappy_max_compressed_length(input_length)) { + return SNAPPY_BUFFER_TOO_SMALL; + } + snappy::RawCompress(input, input_length, compressed, compressed_length); + return SNAPPY_OK; +} + +snappy_status snappy_uncompress(const char* compressed, + size_t compressed_length, + char* uncompressed, + size_t* uncompressed_length) { + size_t real_uncompressed_length; + if (!snappy::GetUncompressedLength(compressed, + compressed_length, + &real_uncompressed_length)) { + return SNAPPY_INVALID_INPUT; + } + if (*uncompressed_length < real_uncompressed_length) { + return SNAPPY_BUFFER_TOO_SMALL; + } + if (!snappy::RawUncompress(compressed, compressed_length, uncompressed)) { + return SNAPPY_INVALID_INPUT; + } + *uncompressed_length = real_uncompressed_length; + return SNAPPY_OK; +} + +size_t snappy_max_compressed_length(size_t source_length) { + return snappy::MaxCompressedLength(source_length); +} + +snappy_status snappy_uncompressed_length(const char *compressed, + size_t compressed_length, + size_t *result) { + if (snappy::GetUncompressedLength(compressed, + compressed_length, + result)) { + return SNAPPY_OK; + } else { + return SNAPPY_INVALID_INPUT; + } +} + +snappy_status snappy_validate_compressed_buffer(const char *compressed, + size_t compressed_length) { + if (snappy::IsValidCompressedBuffer(compressed, compressed_length)) { + return SNAPPY_OK; + } else { + return SNAPPY_INVALID_INPUT; + } +} + +} // extern "C" diff --git a/chromium/third_party/snappy/src/snappy-c.h b/chromium/third_party/snappy/src/snappy-c.h new file mode 100644 index 00000000000..c6c2a860a47 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-c.h @@ -0,0 +1,138 @@ +/* + * Copyright 2011 Martin Gieseking . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Plain C interface (a wrapper around the C++ implementation). + */ + +#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_C_H_ +#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_C_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* + * Return values; see the documentation for each function to know + * what each can return. + */ +typedef enum { + SNAPPY_OK = 0, + SNAPPY_INVALID_INPUT = 1, + SNAPPY_BUFFER_TOO_SMALL = 2 +} snappy_status; + +/* + * Takes the data stored in "input[0..input_length-1]" and stores + * it in the array pointed to by "compressed". + * + * signals the space available in "compressed". + * If it is not at least equal to "snappy_max_compressed_length(input_length)", + * SNAPPY_BUFFER_TOO_SMALL is returned. After successful compression, + * contains the true length of the compressed output, + * and SNAPPY_OK is returned. + * + * Example: + * size_t output_length = snappy_max_compressed_length(input_length); + * char* output = (char*)malloc(output_length); + * if (snappy_compress(input, input_length, output, &output_length) + * == SNAPPY_OK) { + * ... Process(output, output_length) ... + * } + * free(output); + */ +snappy_status snappy_compress(const char* input, + size_t input_length, + char* compressed, + size_t* compressed_length); + +/* + * Given data in "compressed[0..compressed_length-1]" generated by + * calling the snappy_compress routine, this routine stores + * the uncompressed data to + * uncompressed[0..uncompressed_length-1]. + * Returns failure (a value not equal to SNAPPY_OK) if the message + * is corrupted and could not be decrypted. + * + * signals the space available in "uncompressed". + * If it is not at least equal to the value returned by + * snappy_uncompressed_length for this stream, SNAPPY_BUFFER_TOO_SMALL + * is returned. After successful decompression, + * contains the true length of the decompressed output. + * + * Example: + * size_t output_length; + * if (snappy_uncompressed_length(input, input_length, &output_length) + * != SNAPPY_OK) { + * ... fail ... + * } + * char* output = (char*)malloc(output_length); + * if (snappy_uncompress(input, input_length, output, &output_length) + * == SNAPPY_OK) { + * ... Process(output, output_length) ... + * } + * free(output); + */ +snappy_status snappy_uncompress(const char* compressed, + size_t compressed_length, + char* uncompressed, + size_t* uncompressed_length); + +/* + * Returns the maximal size of the compressed representation of + * input data that is "source_length" bytes in length. + */ +size_t snappy_max_compressed_length(size_t source_length); + +/* + * REQUIRES: "compressed[]" was produced by snappy_compress() + * Returns SNAPPY_OK and stores the length of the uncompressed data in + * *result normally. Returns SNAPPY_INVALID_INPUT on parsing error. + * This operation takes O(1) time. + */ +snappy_status snappy_uncompressed_length(const char* compressed, + size_t compressed_length, + size_t* result); + +/* + * Check if the contents of "compressed[]" can be uncompressed successfully. + * Does not return the uncompressed data; if so, returns SNAPPY_OK, + * or if not, returns SNAPPY_INVALID_INPUT. + * Takes time proportional to compressed_length, but is usually at least a + * factor of four faster than actual decompression. + */ +snappy_status snappy_validate_compressed_buffer(const char* compressed, + size_t compressed_length); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* UTIL_SNAPPY_OPENSOURCE_SNAPPY_C_H_ */ diff --git a/chromium/third_party/snappy/src/snappy-internal.h b/chromium/third_party/snappy/src/snappy-internal.h new file mode 100644 index 00000000000..c99d33130b1 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-internal.h @@ -0,0 +1,150 @@ +// Copyright 2008 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Internals shared between the Snappy implementation and its unittest. + +#ifndef UTIL_SNAPPY_SNAPPY_INTERNAL_H_ +#define UTIL_SNAPPY_SNAPPY_INTERNAL_H_ + +#include "snappy-stubs-internal.h" + +namespace snappy { +namespace internal { + +class WorkingMemory { + public: + WorkingMemory() : large_table_(NULL) { } + ~WorkingMemory() { delete[] large_table_; } + + // Allocates and clears a hash table using memory in "*this", + // stores the number of buckets in "*table_size" and returns a pointer to + // the base of the hash table. + uint16* GetHashTable(size_t input_size, int* table_size); + + private: + uint16 small_table_[1<<10]; // 2KB + uint16* large_table_; // Allocated only when needed + + DISALLOW_COPY_AND_ASSIGN(WorkingMemory); +}; + +// Flat array compression that does not emit the "uncompressed length" +// prefix. Compresses "input" string to the "*op" buffer. +// +// REQUIRES: "input_length <= kBlockSize" +// REQUIRES: "op" points to an array of memory that is at least +// "MaxCompressedLength(input_length)" in size. +// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero. +// REQUIRES: "table_size" is a power of two +// +// Returns an "end" pointer into "op" buffer. +// "end - op" is the compressed size of "input". +char* CompressFragment(const char* input, + size_t input_length, + char* op, + uint16* table, + const int table_size); + +// Return the largest n such that +// +// s1[0,n-1] == s2[0,n-1] +// and n <= (s2_limit - s2). +// +// Does not read *s2_limit or beyond. +// Does not read *(s1 + (s2_limit - s2)) or beyond. +// Requires that s2_limit >= s2. +// +// Separate implementation for x86_64, for speed. Uses the fact that +// x86_64 is little endian. +#if defined(ARCH_K8) +static inline int FindMatchLength(const char* s1, + const char* s2, + const char* s2_limit) { + assert(s2_limit >= s2); + int matched = 0; + + // Find out how long the match is. We loop over the data 64 bits at a + // time until we find a 64-bit block that doesn't match; then we find + // the first non-matching bit and use that to calculate the total + // length of the match. + while (PREDICT_TRUE(s2 <= s2_limit - 8)) { + if (PREDICT_FALSE(UNALIGNED_LOAD64(s2) == UNALIGNED_LOAD64(s1 + matched))) { + s2 += 8; + matched += 8; + } else { + // On current (mid-2008) Opteron models there is a 3% more + // efficient code sequence to find the first non-matching byte. + // However, what follows is ~10% better on Intel Core 2 and newer, + // and we expect AMD's bsf instruction to improve. + uint64 x = UNALIGNED_LOAD64(s2) ^ UNALIGNED_LOAD64(s1 + matched); + int matching_bits = Bits::FindLSBSetNonZero64(x); + matched += matching_bits >> 3; + return matched; + } + } + while (PREDICT_TRUE(s2 < s2_limit)) { + if (PREDICT_TRUE(s1[matched] == *s2)) { + ++s2; + ++matched; + } else { + return matched; + } + } + return matched; +} +#else +static inline int FindMatchLength(const char* s1, + const char* s2, + const char* s2_limit) { + // Implementation based on the x86-64 version, above. + assert(s2_limit >= s2); + int matched = 0; + + while (s2 <= s2_limit - 4 && + UNALIGNED_LOAD32(s2) == UNALIGNED_LOAD32(s1 + matched)) { + s2 += 4; + matched += 4; + } + if (LittleEndian::IsLittleEndian() && s2 <= s2_limit - 4) { + uint32 x = UNALIGNED_LOAD32(s2) ^ UNALIGNED_LOAD32(s1 + matched); + int matching_bits = Bits::FindLSBSetNonZero(x); + matched += matching_bits >> 3; + } else { + while ((s2 < s2_limit) && (s1[matched] == *s2)) { + ++s2; + ++matched; + } + } + return matched; +} +#endif + +} // end namespace internal +} // end namespace snappy + +#endif // UTIL_SNAPPY_SNAPPY_INTERNAL_H_ diff --git a/chromium/third_party/snappy/src/snappy-sinksource.cc b/chromium/third_party/snappy/src/snappy-sinksource.cc new file mode 100644 index 00000000000..5844552cb7e --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-sinksource.cc @@ -0,0 +1,71 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "snappy-sinksource.h" + +namespace snappy { + +Source::~Source() { } + +Sink::~Sink() { } + +char* Sink::GetAppendBuffer(size_t length, char* scratch) { + return scratch; +} + +ByteArraySource::~ByteArraySource() { } + +size_t ByteArraySource::Available() const { return left_; } + +const char* ByteArraySource::Peek(size_t* len) { + *len = left_; + return ptr_; +} + +void ByteArraySource::Skip(size_t n) { + left_ -= n; + ptr_ += n; +} + +UncheckedByteArraySink::~UncheckedByteArraySink() { } + +void UncheckedByteArraySink::Append(const char* data, size_t n) { + // Do no copying if the caller filled in the result of GetAppendBuffer() + if (data != dest_) { + memcpy(dest_, data, n); + } + dest_ += n; +} + +char* UncheckedByteArraySink::GetAppendBuffer(size_t len, char* scratch) { + return dest_; +} + +} diff --git a/chromium/third_party/snappy/src/snappy-sinksource.h b/chromium/third_party/snappy/src/snappy-sinksource.h new file mode 100644 index 00000000000..faabfa1e6f1 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-sinksource.h @@ -0,0 +1,137 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_ +#define UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_ + +#include + + +namespace snappy { + +// A Sink is an interface that consumes a sequence of bytes. +class Sink { + public: + Sink() { } + virtual ~Sink(); + + // Append "bytes[0,n-1]" to this. + virtual void Append(const char* bytes, size_t n) = 0; + + // Returns a writable buffer of the specified length for appending. + // May return a pointer to the caller-owned scratch buffer which + // must have at least the indicated length. The returned buffer is + // only valid until the next operation on this Sink. + // + // After writing at most "length" bytes, call Append() with the + // pointer returned from this function and the number of bytes + // written. Many Append() implementations will avoid copying + // bytes if this function returned an internal buffer. + // + // If a non-scratch buffer is returned, the caller may only pass a + // prefix of it to Append(). That is, it is not correct to pass an + // interior pointer of the returned array to Append(). + // + // The default implementation always returns the scratch buffer. + virtual char* GetAppendBuffer(size_t length, char* scratch); + + + private: + // No copying + Sink(const Sink&); + void operator=(const Sink&); +}; + +// A Source is an interface that yields a sequence of bytes +class Source { + public: + Source() { } + virtual ~Source(); + + // Return the number of bytes left to read from the source + virtual size_t Available() const = 0; + + // Peek at the next flat region of the source. Does not reposition + // the source. The returned region is empty iff Available()==0. + // + // Returns a pointer to the beginning of the region and store its + // length in *len. + // + // The returned region is valid until the next call to Skip() or + // until this object is destroyed, whichever occurs first. + // + // The returned region may be larger than Available() (for example + // if this ByteSource is a view on a substring of a larger source). + // The caller is responsible for ensuring that it only reads the + // Available() bytes. + virtual const char* Peek(size_t* len) = 0; + + // Skip the next n bytes. Invalidates any buffer returned by + // a previous call to Peek(). + // REQUIRES: Available() >= n + virtual void Skip(size_t n) = 0; + + private: + // No copying + Source(const Source&); + void operator=(const Source&); +}; + +// A Source implementation that yields the contents of a flat array +class ByteArraySource : public Source { + public: + ByteArraySource(const char* p, size_t n) : ptr_(p), left_(n) { } + virtual ~ByteArraySource(); + virtual size_t Available() const; + virtual const char* Peek(size_t* len); + virtual void Skip(size_t n); + private: + const char* ptr_; + size_t left_; +}; + +// A Sink implementation that writes to a flat array without any bound checks. +class UncheckedByteArraySink : public Sink { + public: + explicit UncheckedByteArraySink(char* dest) : dest_(dest) { } + virtual ~UncheckedByteArraySink(); + virtual void Append(const char* data, size_t n); + virtual char* GetAppendBuffer(size_t len, char* scratch); + + // Return the current output pointer so that a caller can see how + // many bytes were produced. + // Note: this is not a Sink method. + char* CurrentDestination() const { return dest_; } + private: + char* dest_; +}; + + +} + +#endif // UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_ diff --git a/chromium/third_party/snappy/src/snappy-stubs-internal.cc b/chromium/third_party/snappy/src/snappy-stubs-internal.cc new file mode 100644 index 00000000000..6ed334371f1 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-stubs-internal.cc @@ -0,0 +1,42 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#include "snappy-stubs-internal.h" + +namespace snappy { + +void Varint::Append32(string* s, uint32 value) { + char buf[Varint::kMax32]; + const char* p = Varint::Encode32(buf, value); + s->append(buf, p - buf); +} + +} // namespace snappy diff --git a/chromium/third_party/snappy/src/snappy-stubs-internal.h b/chromium/third_party/snappy/src/snappy-stubs-internal.h new file mode 100644 index 00000000000..12393b6289e --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-stubs-internal.h @@ -0,0 +1,491 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various stubs for the open-source version of Snappy. + +#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ +#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include + +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#include "snappy-stubs-public.h" + +#if defined(__x86_64__) + +// Enable 64-bit optimized versions of some routines. +#define ARCH_K8 1 + +#endif + +// Needed by OS X, among others. +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif + +// Pull in std::min, std::ostream, and the likes. This is safe because this +// header file is never used from any public header files. +using namespace std; + +// The size of an array, if known at compile-time. +// Will give unexpected results if used on a pointer. +// We undefine it first, since some compilers already have a definition. +#ifdef ARRAYSIZE +#undef ARRAYSIZE +#endif +#define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a))) + +// Static prediction hints. +#ifdef HAVE_BUILTIN_EXPECT +#define PREDICT_FALSE(x) (__builtin_expect(x, 0)) +#define PREDICT_TRUE(x) (__builtin_expect(!!(x), 1)) +#else +#define PREDICT_FALSE(x) x +#define PREDICT_TRUE(x) x +#endif + +// This is only used for recomputing the tag byte table used during +// decompression; for simplicity we just remove it from the open-source +// version (anyone who wants to regenerate it can just do the call +// themselves within main()). +#define DEFINE_bool(flag_name, default_value, description) \ + bool FLAGS_ ## flag_name = default_value +#define DECLARE_bool(flag_name) \ + extern bool FLAGS_ ## flag_name + +namespace snappy { + +static const uint32 kuint32max = static_cast(0xFFFFFFFF); +static const int64 kint64max = static_cast(0x7FFFFFFFFFFFFFFFLL); + +// Potentially unaligned loads and stores. + +// x86 and PowerPC can simply do these loads and stores native. + +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) + +#define UNALIGNED_LOAD16(_p) (*reinterpret_cast(_p)) +#define UNALIGNED_LOAD32(_p) (*reinterpret_cast(_p)) +#define UNALIGNED_LOAD64(_p) (*reinterpret_cast(_p)) + +#define UNALIGNED_STORE16(_p, _val) (*reinterpret_cast(_p) = (_val)) +#define UNALIGNED_STORE32(_p, _val) (*reinterpret_cast(_p) = (_val)) +#define UNALIGNED_STORE64(_p, _val) (*reinterpret_cast(_p) = (_val)) + +// ARMv7 and newer support native unaligned accesses, but only of 16-bit +// and 32-bit values (not 64-bit); older versions either raise a fatal signal, +// do an unaligned read and rotate the words around a bit, or do the reads very +// slowly (trip through kernel mode). There's no simple #define that says just +// “ARMv7 or higher”, so we have to filter away all ARMv5 and ARMv6 +// sub-architectures. +// +// This is a mess, but there's not much we can do about it. + +#elif defined(__arm__) && \ + !defined(__ARM_ARCH_4__) && \ + !defined(__ARM_ARCH_4T__) && \ + !defined(__ARM_ARCH_5__) && \ + !defined(__ARM_ARCH_5T__) && \ + !defined(__ARM_ARCH_5TE__) && \ + !defined(__ARM_ARCH_5TEJ__) && \ + !defined(__ARM_ARCH_6__) && \ + !defined(__ARM_ARCH_6J__) && \ + !defined(__ARM_ARCH_6K__) && \ + !defined(__ARM_ARCH_6Z__) && \ + !defined(__ARM_ARCH_6ZK__) && \ + !defined(__ARM_ARCH_6T2__) + +#define UNALIGNED_LOAD16(_p) (*reinterpret_cast(_p)) +#define UNALIGNED_LOAD32(_p) (*reinterpret_cast(_p)) + +#define UNALIGNED_STORE16(_p, _val) (*reinterpret_cast(_p) = (_val)) +#define UNALIGNED_STORE32(_p, _val) (*reinterpret_cast(_p) = (_val)) + +// TODO(user): NEON supports unaligned 64-bit loads and stores. +// See if that would be more efficient on platforms supporting it, +// at least for copies. + +inline uint64 UNALIGNED_LOAD64(const void *p) { + uint64 t; + memcpy(&t, p, sizeof t); + return t; +} + +inline void UNALIGNED_STORE64(void *p, uint64 v) { + memcpy(p, &v, sizeof v); +} + +#else + +// These functions are provided for architectures that don't support +// unaligned loads and stores. + +inline uint16 UNALIGNED_LOAD16(const void *p) { + uint16 t; + memcpy(&t, p, sizeof t); + return t; +} + +inline uint32 UNALIGNED_LOAD32(const void *p) { + uint32 t; + memcpy(&t, p, sizeof t); + return t; +} + +inline uint64 UNALIGNED_LOAD64(const void *p) { + uint64 t; + memcpy(&t, p, sizeof t); + return t; +} + +inline void UNALIGNED_STORE16(void *p, uint16 v) { + memcpy(p, &v, sizeof v); +} + +inline void UNALIGNED_STORE32(void *p, uint32 v) { + memcpy(p, &v, sizeof v); +} + +inline void UNALIGNED_STORE64(void *p, uint64 v) { + memcpy(p, &v, sizeof v); +} + +#endif + +// This can be more efficient than UNALIGNED_LOAD64 + UNALIGNED_STORE64 +// on some platforms, in particular ARM. +inline void UnalignedCopy64(const void *src, void *dst) { + if (sizeof(void *) == 8) { + UNALIGNED_STORE64(dst, UNALIGNED_LOAD64(src)); + } else { + const char *src_char = reinterpret_cast(src); + char *dst_char = reinterpret_cast(dst); + + UNALIGNED_STORE32(dst_char, UNALIGNED_LOAD32(src_char)); + UNALIGNED_STORE32(dst_char + 4, UNALIGNED_LOAD32(src_char + 4)); + } +} + +// The following guarantees declaration of the byte swap functions. +#ifdef WORDS_BIGENDIAN + +#ifdef HAVE_SYS_BYTEORDER_H +#include +#endif + +#ifdef HAVE_SYS_ENDIAN_H +#include +#endif + +#ifdef _MSC_VER +#include +#define bswap_16(x) _byteswap_ushort(x) +#define bswap_32(x) _byteswap_ulong(x) +#define bswap_64(x) _byteswap_uint64(x) + +#elif defined(__APPLE__) +// Mac OS X / Darwin features +#include +#define bswap_16(x) OSSwapInt16(x) +#define bswap_32(x) OSSwapInt32(x) +#define bswap_64(x) OSSwapInt64(x) + +#elif defined(HAVE_BYTESWAP_H) +#include + +#elif defined(bswap32) +// FreeBSD defines bswap{16,32,64} in (already #included). +#define bswap_16(x) bswap16(x) +#define bswap_32(x) bswap32(x) +#define bswap_64(x) bswap64(x) + +#elif defined(BSWAP_64) +// Solaris 10 defines BSWAP_{16,32,64} in (already #included). +#define bswap_16(x) BSWAP_16(x) +#define bswap_32(x) BSWAP_32(x) +#define bswap_64(x) BSWAP_64(x) + +#else + +inline uint16 bswap_16(uint16 x) { + return (x << 8) | (x >> 8); +} + +inline uint32 bswap_32(uint32 x) { + x = ((x & 0xff00ff00UL) >> 8) | ((x & 0x00ff00ffUL) << 8); + return (x >> 16) | (x << 16); +} + +inline uint64 bswap_64(uint64 x) { + x = ((x & 0xff00ff00ff00ff00ULL) >> 8) | ((x & 0x00ff00ff00ff00ffULL) << 8); + x = ((x & 0xffff0000ffff0000ULL) >> 16) | ((x & 0x0000ffff0000ffffULL) << 16); + return (x >> 32) | (x << 32); +} + +#endif + +#endif // WORDS_BIGENDIAN + +// Convert to little-endian storage, opposite of network format. +// Convert x from host to little endian: x = LittleEndian.FromHost(x); +// convert x from little endian to host: x = LittleEndian.ToHost(x); +// +// Store values into unaligned memory converting to little endian order: +// LittleEndian.Store16(p, x); +// +// Load unaligned values stored in little endian converting to host order: +// x = LittleEndian.Load16(p); +class LittleEndian { + public: + // Conversion functions. +#ifdef WORDS_BIGENDIAN + + static uint16 FromHost16(uint16 x) { return bswap_16(x); } + static uint16 ToHost16(uint16 x) { return bswap_16(x); } + + static uint32 FromHost32(uint32 x) { return bswap_32(x); } + static uint32 ToHost32(uint32 x) { return bswap_32(x); } + + static bool IsLittleEndian() { return false; } + +#else // !defined(WORDS_BIGENDIAN) + + static uint16 FromHost16(uint16 x) { return x; } + static uint16 ToHost16(uint16 x) { return x; } + + static uint32 FromHost32(uint32 x) { return x; } + static uint32 ToHost32(uint32 x) { return x; } + + static bool IsLittleEndian() { return true; } + +#endif // !defined(WORDS_BIGENDIAN) + + // Functions to do unaligned loads and stores in little-endian order. + static uint16 Load16(const void *p) { + return ToHost16(UNALIGNED_LOAD16(p)); + } + + static void Store16(void *p, uint16 v) { + UNALIGNED_STORE16(p, FromHost16(v)); + } + + static uint32 Load32(const void *p) { + return ToHost32(UNALIGNED_LOAD32(p)); + } + + static void Store32(void *p, uint32 v) { + UNALIGNED_STORE32(p, FromHost32(v)); + } +}; + +// Some bit-manipulation functions. +class Bits { + public: + // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. + static int Log2Floor(uint32 n); + + // Return the first set least / most significant bit, 0-indexed. Returns an + // undefined value if n == 0. FindLSBSetNonZero() is similar to ffs() except + // that it's 0-indexed. + static int FindLSBSetNonZero(uint32 n); + static int FindLSBSetNonZero64(uint64 n); + + private: + DISALLOW_COPY_AND_ASSIGN(Bits); +}; + +#ifdef HAVE_BUILTIN_CTZ + +inline int Bits::Log2Floor(uint32 n) { + return n == 0 ? -1 : 31 ^ __builtin_clz(n); +} + +inline int Bits::FindLSBSetNonZero(uint32 n) { + return __builtin_ctz(n); +} + +inline int Bits::FindLSBSetNonZero64(uint64 n) { + return __builtin_ctzll(n); +} + +#else // Portable versions. + +inline int Bits::Log2Floor(uint32 n) { + if (n == 0) + return -1; + int log = 0; + uint32 value = n; + for (int i = 4; i >= 0; --i) { + int shift = (1 << i); + uint32 x = value >> shift; + if (x != 0) { + value = x; + log += shift; + } + } + assert(value == 1); + return log; +} + +inline int Bits::FindLSBSetNonZero(uint32 n) { + int rc = 31; + for (int i = 4, shift = 1 << 4; i >= 0; --i) { + const uint32 x = n << shift; + if (x != 0) { + n = x; + rc -= shift; + } + shift >>= 1; + } + return rc; +} + +// FindLSBSetNonZero64() is defined in terms of FindLSBSetNonZero(). +inline int Bits::FindLSBSetNonZero64(uint64 n) { + const uint32 bottombits = static_cast(n); + if (bottombits == 0) { + // Bottom bits are zero, so scan in top bits + return 32 + FindLSBSetNonZero(static_cast(n >> 32)); + } else { + return FindLSBSetNonZero(bottombits); + } +} + +#endif // End portable versions. + +// Variable-length integer encoding. +class Varint { + public: + // Maximum lengths of varint encoding of uint32. + static const int kMax32 = 5; + + // Attempts to parse a varint32 from a prefix of the bytes in [ptr,limit-1]. + // Never reads a character at or beyond limit. If a valid/terminated varint32 + // was found in the range, stores it in *OUTPUT and returns a pointer just + // past the last byte of the varint32. Else returns NULL. On success, + // "result <= limit". + static const char* Parse32WithLimit(const char* ptr, const char* limit, + uint32* OUTPUT); + + // REQUIRES "ptr" points to a buffer of length sufficient to hold "v". + // EFFECTS Encodes "v" into "ptr" and returns a pointer to the + // byte just past the last encoded byte. + static char* Encode32(char* ptr, uint32 v); + + // EFFECTS Appends the varint representation of "value" to "*s". + static void Append32(string* s, uint32 value); +}; + +inline const char* Varint::Parse32WithLimit(const char* p, + const char* l, + uint32* OUTPUT) { + const unsigned char* ptr = reinterpret_cast(p); + const unsigned char* limit = reinterpret_cast(l); + uint32 b, result; + if (ptr >= limit) return NULL; + b = *(ptr++); result = b & 127; if (b < 128) goto done; + if (ptr >= limit) return NULL; + b = *(ptr++); result |= (b & 127) << 7; if (b < 128) goto done; + if (ptr >= limit) return NULL; + b = *(ptr++); result |= (b & 127) << 14; if (b < 128) goto done; + if (ptr >= limit) return NULL; + b = *(ptr++); result |= (b & 127) << 21; if (b < 128) goto done; + if (ptr >= limit) return NULL; + b = *(ptr++); result |= (b & 127) << 28; if (b < 16) goto done; + return NULL; // Value is too long to be a varint32 + done: + *OUTPUT = result; + return reinterpret_cast(ptr); +} + +inline char* Varint::Encode32(char* sptr, uint32 v) { + // Operate on characters as unsigneds + unsigned char* ptr = reinterpret_cast(sptr); + static const int B = 128; + if (v < (1<<7)) { + *(ptr++) = v; + } else if (v < (1<<14)) { + *(ptr++) = v | B; + *(ptr++) = v>>7; + } else if (v < (1<<21)) { + *(ptr++) = v | B; + *(ptr++) = (v>>7) | B; + *(ptr++) = v>>14; + } else if (v < (1<<28)) { + *(ptr++) = v | B; + *(ptr++) = (v>>7) | B; + *(ptr++) = (v>>14) | B; + *(ptr++) = v>>21; + } else { + *(ptr++) = v | B; + *(ptr++) = (v>>7) | B; + *(ptr++) = (v>>14) | B; + *(ptr++) = (v>>21) | B; + *(ptr++) = v>>28; + } + return reinterpret_cast(ptr); +} + +// If you know the internal layout of the std::string in use, you can +// replace this function with one that resizes the string without +// filling the new space with zeros (if applicable) -- +// it will be non-portable but faster. +inline void STLStringResizeUninitialized(string* s, size_t new_size) { + s->resize(new_size); +} + +// Return a mutable char* pointing to a string's internal buffer, +// which may not be null-terminated. Writing through this pointer will +// modify the string. +// +// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the +// next call to a string method that invalidates iterators. +// +// As of 2006-04, there is no standard-blessed way of getting a +// mutable reference to a string's internal buffer. However, issue 530 +// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-defects.html#530) +// proposes this as the method. It will officially be part of the standard +// for C++0x. This should already work on all current implementations. +inline char* string_as_array(string* str) { + return str->empty() ? NULL : &*str->begin(); +} + +} // namespace snappy + +#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ diff --git a/chromium/third_party/snappy/src/snappy-stubs-public.h.in b/chromium/third_party/snappy/src/snappy-stubs-public.h.in new file mode 100644 index 00000000000..f0babcbe5b2 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-stubs-public.h.in @@ -0,0 +1,85 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// Author: sesse@google.com (Steinar H. Gunderson) +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various type stubs for the open-source version of Snappy. +// +// This file cannot include config.h, as it is included from snappy.h, +// which is a public header. Instead, snappy-stubs-public.h is generated by +// from snappy-stubs-public.h.in at configure time. + +#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ +#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ + +#if @ac_cv_have_stdint_h@ +#include +#endif + +#if @ac_cv_have_stddef_h@ +#include +#endif + +#define SNAPPY_MAJOR @SNAPPY_MAJOR@ +#define SNAPPY_MINOR @SNAPPY_MINOR@ +#define SNAPPY_PATCHLEVEL @SNAPPY_PATCHLEVEL@ +#define SNAPPY_VERSION \ + ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) + +#include + +namespace snappy { + +#if @ac_cv_have_stdint_h@ +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#else +typedef signed char int8; +typedef unsigned char uint8; +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned int uint32; +typedef long long int64; +typedef unsigned long long uint64; +#endif + +typedef std::string string; + +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) + +} // namespace snappy + +#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ diff --git a/chromium/third_party/snappy/src/snappy-test.cc b/chromium/third_party/snappy/src/snappy-test.cc new file mode 100644 index 00000000000..46194109e0e --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-test.cc @@ -0,0 +1,606 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various stubs for the unit tests for the open-source version of Snappy. + +#include "snappy-test.h" + +#ifdef HAVE_WINDOWS_H +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#include + +DEFINE_bool(run_microbenchmarks, true, + "Run microbenchmarks before doing anything else."); + +namespace snappy { + +string ReadTestDataFile(const string& base, size_t size_limit) { + string contents; + const char* srcdir = getenv("srcdir"); // This is set by Automake. + string prefix; + if (srcdir) { + prefix = string(srcdir) + "/"; + } + file::GetContents(prefix + "testdata/" + base, &contents, file::Defaults() + ).CheckSuccess(); + if (size_limit > 0) { + contents = contents.substr(0, size_limit); + } + return contents; +} + +string ReadTestDataFile(const string& base) { + return ReadTestDataFile(base, 0); +} + +string StringPrintf(const char* format, ...) { + char buf[4096]; + va_list ap; + va_start(ap, format); + vsnprintf(buf, sizeof(buf), format, ap); + va_end(ap); + return buf; +} + +bool benchmark_running = false; +int64 benchmark_real_time_us = 0; +int64 benchmark_cpu_time_us = 0; +string *benchmark_label = NULL; +int64 benchmark_bytes_processed = 0; + +void ResetBenchmarkTiming() { + benchmark_real_time_us = 0; + benchmark_cpu_time_us = 0; +} + +#ifdef WIN32 +LARGE_INTEGER benchmark_start_real; +FILETIME benchmark_start_cpu; +#else // WIN32 +struct timeval benchmark_start_real; +struct rusage benchmark_start_cpu; +#endif // WIN32 + +void StartBenchmarkTiming() { +#ifdef WIN32 + QueryPerformanceCounter(&benchmark_start_real); + FILETIME dummy; + CHECK(GetProcessTimes( + GetCurrentProcess(), &dummy, &dummy, &dummy, &benchmark_start_cpu)); +#else + gettimeofday(&benchmark_start_real, NULL); + if (getrusage(RUSAGE_SELF, &benchmark_start_cpu) == -1) { + perror("getrusage(RUSAGE_SELF)"); + exit(1); + } +#endif + benchmark_running = true; +} + +void StopBenchmarkTiming() { + if (!benchmark_running) { + return; + } + +#ifdef WIN32 + LARGE_INTEGER benchmark_stop_real; + LARGE_INTEGER benchmark_frequency; + QueryPerformanceCounter(&benchmark_stop_real); + QueryPerformanceFrequency(&benchmark_frequency); + + double elapsed_real = static_cast( + benchmark_stop_real.QuadPart - benchmark_start_real.QuadPart) / + benchmark_frequency.QuadPart; + benchmark_real_time_us += elapsed_real * 1e6 + 0.5; + + FILETIME benchmark_stop_cpu, dummy; + CHECK(GetProcessTimes( + GetCurrentProcess(), &dummy, &dummy, &dummy, &benchmark_stop_cpu)); + + ULARGE_INTEGER start_ulargeint; + start_ulargeint.LowPart = benchmark_start_cpu.dwLowDateTime; + start_ulargeint.HighPart = benchmark_start_cpu.dwHighDateTime; + + ULARGE_INTEGER stop_ulargeint; + stop_ulargeint.LowPart = benchmark_stop_cpu.dwLowDateTime; + stop_ulargeint.HighPart = benchmark_stop_cpu.dwHighDateTime; + + benchmark_cpu_time_us += + (stop_ulargeint.QuadPart - start_ulargeint.QuadPart + 5) / 10; +#else // WIN32 + struct timeval benchmark_stop_real; + gettimeofday(&benchmark_stop_real, NULL); + benchmark_real_time_us += + 1000000 * (benchmark_stop_real.tv_sec - benchmark_start_real.tv_sec); + benchmark_real_time_us += + (benchmark_stop_real.tv_usec - benchmark_start_real.tv_usec); + + struct rusage benchmark_stop_cpu; + if (getrusage(RUSAGE_SELF, &benchmark_stop_cpu) == -1) { + perror("getrusage(RUSAGE_SELF)"); + exit(1); + } + benchmark_cpu_time_us += 1000000 * (benchmark_stop_cpu.ru_utime.tv_sec - + benchmark_start_cpu.ru_utime.tv_sec); + benchmark_cpu_time_us += (benchmark_stop_cpu.ru_utime.tv_usec - + benchmark_start_cpu.ru_utime.tv_usec); +#endif // WIN32 + + benchmark_running = false; +} + +void SetBenchmarkLabel(const string& str) { + if (benchmark_label) { + delete benchmark_label; + } + benchmark_label = new string(str); +} + +void SetBenchmarkBytesProcessed(int64 bytes) { + benchmark_bytes_processed = bytes; +} + +struct BenchmarkRun { + int64 real_time_us; + int64 cpu_time_us; +}; + +struct BenchmarkCompareCPUTime { + bool operator() (const BenchmarkRun& a, const BenchmarkRun& b) const { + return a.cpu_time_us < b.cpu_time_us; + } +}; + +void Benchmark::Run() { + for (int test_case_num = start_; test_case_num <= stop_; ++test_case_num) { + // Run a few iterations first to find out approximately how fast + // the benchmark is. + const int kCalibrateIterations = 100; + ResetBenchmarkTiming(); + StartBenchmarkTiming(); + (*function_)(kCalibrateIterations, test_case_num); + StopBenchmarkTiming(); + + // Let each test case run for about 200ms, but at least as many + // as we used to calibrate. + // Run five times and pick the median. + const int kNumRuns = 5; + const int kMedianPos = kNumRuns / 2; + int num_iterations = 0; + if (benchmark_real_time_us > 0) { + num_iterations = 200000 * kCalibrateIterations / benchmark_real_time_us; + } + num_iterations = max(num_iterations, kCalibrateIterations); + BenchmarkRun benchmark_runs[kNumRuns]; + + for (int run = 0; run < kNumRuns; ++run) { + ResetBenchmarkTiming(); + StartBenchmarkTiming(); + (*function_)(num_iterations, test_case_num); + StopBenchmarkTiming(); + + benchmark_runs[run].real_time_us = benchmark_real_time_us; + benchmark_runs[run].cpu_time_us = benchmark_cpu_time_us; + } + + string heading = StringPrintf("%s/%d", name_.c_str(), test_case_num); + string human_readable_speed; + + nth_element(benchmark_runs, + benchmark_runs + kMedianPos, + benchmark_runs + kNumRuns, + BenchmarkCompareCPUTime()); + int64 real_time_us = benchmark_runs[kMedianPos].real_time_us; + int64 cpu_time_us = benchmark_runs[kMedianPos].cpu_time_us; + if (cpu_time_us <= 0) { + human_readable_speed = "?"; + } else { + int64 bytes_per_second = + benchmark_bytes_processed * 1000000 / cpu_time_us; + if (bytes_per_second < 1024) { + human_readable_speed = StringPrintf("%dB/s", bytes_per_second); + } else if (bytes_per_second < 1024 * 1024) { + human_readable_speed = StringPrintf( + "%.1fkB/s", bytes_per_second / 1024.0f); + } else if (bytes_per_second < 1024 * 1024 * 1024) { + human_readable_speed = StringPrintf( + "%.1fMB/s", bytes_per_second / (1024.0f * 1024.0f)); + } else { + human_readable_speed = StringPrintf( + "%.1fGB/s", bytes_per_second / (1024.0f * 1024.0f * 1024.0f)); + } + } + + fprintf(stderr, +#ifdef WIN32 + "%-18s %10I64d %10I64d %10d %s %s\n", +#else + "%-18s %10lld %10lld %10d %s %s\n", +#endif + heading.c_str(), + static_cast(real_time_us * 1000 / num_iterations), + static_cast(cpu_time_us * 1000 / num_iterations), + num_iterations, + human_readable_speed.c_str(), + benchmark_label->c_str()); + } +} + +#ifdef HAVE_LIBZ + +ZLib::ZLib() + : comp_init_(false), + uncomp_init_(false) { + Reinit(); +} + +ZLib::~ZLib() { + if (comp_init_) { deflateEnd(&comp_stream_); } + if (uncomp_init_) { inflateEnd(&uncomp_stream_); } +} + +void ZLib::Reinit() { + compression_level_ = Z_DEFAULT_COMPRESSION; + window_bits_ = MAX_WBITS; + mem_level_ = 8; // DEF_MEM_LEVEL + if (comp_init_) { + deflateEnd(&comp_stream_); + comp_init_ = false; + } + if (uncomp_init_) { + inflateEnd(&uncomp_stream_); + uncomp_init_ = false; + } + first_chunk_ = true; +} + +void ZLib::Reset() { + first_chunk_ = true; +} + +// --------- COMPRESS MODE + +// Initialization method to be called if we hit an error while +// compressing. On hitting an error, call this method before returning +// the error. +void ZLib::CompressErrorInit() { + deflateEnd(&comp_stream_); + comp_init_ = false; + Reset(); +} + +int ZLib::DeflateInit() { + return deflateInit2(&comp_stream_, + compression_level_, + Z_DEFLATED, + window_bits_, + mem_level_, + Z_DEFAULT_STRATEGY); +} + +int ZLib::CompressInit(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen) { + int err; + + comp_stream_.next_in = (Bytef*)source; + comp_stream_.avail_in = (uInt)*sourceLen; + if ((uLong)comp_stream_.avail_in != *sourceLen) return Z_BUF_ERROR; + comp_stream_.next_out = dest; + comp_stream_.avail_out = (uInt)*destLen; + if ((uLong)comp_stream_.avail_out != *destLen) return Z_BUF_ERROR; + + if ( !first_chunk_ ) // only need to set up stream the first time through + return Z_OK; + + if (comp_init_) { // we've already initted it + err = deflateReset(&comp_stream_); + if (err != Z_OK) { + LOG(WARNING) << "ERROR: Can't reset compress object; creating a new one"; + deflateEnd(&comp_stream_); + comp_init_ = false; + } + } + if (!comp_init_) { // first use + comp_stream_.zalloc = (alloc_func)0; + comp_stream_.zfree = (free_func)0; + comp_stream_.opaque = (voidpf)0; + err = DeflateInit(); + if (err != Z_OK) return err; + comp_init_ = true; + } + return Z_OK; +} + +// In a perfect world we'd always have the full buffer to compress +// when the time came, and we could just call Compress(). Alas, we +// want to do chunked compression on our webserver. In this +// application, we compress the header, send it off, then compress the +// results, send them off, then compress the footer. Thus we need to +// use the chunked compression features of zlib. +int ZLib::CompressAtMostOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen, + int flush_mode) { // Z_FULL_FLUSH or Z_FINISH + int err; + + if ( (err=CompressInit(dest, destLen, source, sourceLen)) != Z_OK ) + return err; + + // This is used to figure out how many bytes we wrote *this chunk* + int compressed_size = comp_stream_.total_out; + + // Some setup happens only for the first chunk we compress in a run + if ( first_chunk_ ) { + first_chunk_ = false; + } + + // flush_mode is Z_FINISH for all mode, Z_SYNC_FLUSH for incremental + // compression. + err = deflate(&comp_stream_, flush_mode); + + *sourceLen = comp_stream_.avail_in; + + if ((err == Z_STREAM_END || err == Z_OK) + && comp_stream_.avail_in == 0 + && comp_stream_.avail_out != 0 ) { + // we processed everything ok and the output buffer was large enough. + ; + } else if (err == Z_STREAM_END && comp_stream_.avail_in > 0) { + return Z_BUF_ERROR; // should never happen + } else if (err != Z_OK && err != Z_STREAM_END && err != Z_BUF_ERROR) { + // an error happened + CompressErrorInit(); + return err; + } else if (comp_stream_.avail_out == 0) { // not enough space + err = Z_BUF_ERROR; + } + + assert(err == Z_OK || err == Z_STREAM_END || err == Z_BUF_ERROR); + if (err == Z_STREAM_END) + err = Z_OK; + + // update the crc and other metadata + compressed_size = comp_stream_.total_out - compressed_size; // delta + *destLen = compressed_size; + + return err; +} + +int ZLib::CompressChunkOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int flush_mode) { // Z_FULL_FLUSH or Z_FINISH + const int ret = + CompressAtMostOrAll(dest, destLen, source, &sourceLen, flush_mode); + if (ret == Z_BUF_ERROR) + CompressErrorInit(); + return ret; +} + +// This routine only initializes the compression stream once. Thereafter, it +// just does a deflateReset on the stream, which should be faster. +int ZLib::Compress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen) { + int err; + if ( (err=CompressChunkOrAll(dest, destLen, source, sourceLen, + Z_FINISH)) != Z_OK ) + return err; + Reset(); // reset for next call to Compress + + return Z_OK; +} + + +// --------- UNCOMPRESS MODE + +int ZLib::InflateInit() { + return inflateInit2(&uncomp_stream_, MAX_WBITS); +} + +// Initialization method to be called if we hit an error while +// uncompressing. On hitting an error, call this method before +// returning the error. +void ZLib::UncompressErrorInit() { + inflateEnd(&uncomp_stream_); + uncomp_init_ = false; + Reset(); +} + +int ZLib::UncompressInit(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen) { + int err; + + uncomp_stream_.next_in = (Bytef*)source; + uncomp_stream_.avail_in = (uInt)*sourceLen; + // Check for source > 64K on 16-bit machine: + if ((uLong)uncomp_stream_.avail_in != *sourceLen) return Z_BUF_ERROR; + + uncomp_stream_.next_out = dest; + uncomp_stream_.avail_out = (uInt)*destLen; + if ((uLong)uncomp_stream_.avail_out != *destLen) return Z_BUF_ERROR; + + if ( !first_chunk_ ) // only need to set up stream the first time through + return Z_OK; + + if (uncomp_init_) { // we've already initted it + err = inflateReset(&uncomp_stream_); + if (err != Z_OK) { + LOG(WARNING) + << "ERROR: Can't reset uncompress object; creating a new one"; + UncompressErrorInit(); + } + } + if (!uncomp_init_) { + uncomp_stream_.zalloc = (alloc_func)0; + uncomp_stream_.zfree = (free_func)0; + uncomp_stream_.opaque = (voidpf)0; + err = InflateInit(); + if (err != Z_OK) return err; + uncomp_init_ = true; + } + return Z_OK; +} + +// If you compressed your data a chunk at a time, with CompressChunk, +// you can uncompress it a chunk at a time with UncompressChunk. +// Only difference bewteen chunked and unchunked uncompression +// is the flush mode we use: Z_SYNC_FLUSH (chunked) or Z_FINISH (unchunked). +int ZLib::UncompressAtMostOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen, + int flush_mode) { // Z_SYNC_FLUSH or Z_FINISH + int err = Z_OK; + + if ( (err=UncompressInit(dest, destLen, source, sourceLen)) != Z_OK ) { + LOG(WARNING) << "UncompressInit: Error: " << err << " SourceLen: " + << *sourceLen; + return err; + } + + // This is used to figure out how many output bytes we wrote *this chunk*: + const uLong old_total_out = uncomp_stream_.total_out; + + // This is used to figure out how many input bytes we read *this chunk*: + const uLong old_total_in = uncomp_stream_.total_in; + + // Some setup happens only for the first chunk we compress in a run + if ( first_chunk_ ) { + first_chunk_ = false; // so we don't do this again + + // For the first chunk *only* (to avoid infinite troubles), we let + // there be no actual data to uncompress. This sometimes triggers + // when the input is only the gzip header, say. + if ( *sourceLen == 0 ) { + *destLen = 0; + return Z_OK; + } + } + + // We'll uncompress as much as we can. If we end OK great, otherwise + // if we get an error that seems to be the gzip footer, we store the + // gzip footer and return OK, otherwise we return the error. + + // flush_mode is Z_SYNC_FLUSH for chunked mode, Z_FINISH for all mode. + err = inflate(&uncomp_stream_, flush_mode); + + // Figure out how many bytes of the input zlib slurped up: + const uLong bytes_read = uncomp_stream_.total_in - old_total_in; + CHECK_LE(source + bytes_read, source + *sourceLen); + *sourceLen = uncomp_stream_.avail_in; + + if ((err == Z_STREAM_END || err == Z_OK) // everything went ok + && uncomp_stream_.avail_in == 0) { // and we read it all + ; + } else if (err == Z_STREAM_END && uncomp_stream_.avail_in > 0) { + LOG(WARNING) + << "UncompressChunkOrAll: Received some extra data, bytes total: " + << uncomp_stream_.avail_in << " bytes: " + << string(reinterpret_cast(uncomp_stream_.next_in), + min(int(uncomp_stream_.avail_in), 20)); + UncompressErrorInit(); + return Z_DATA_ERROR; // what's the extra data for? + } else if (err != Z_OK && err != Z_STREAM_END && err != Z_BUF_ERROR) { + // an error happened + LOG(WARNING) << "UncompressChunkOrAll: Error: " << err + << " avail_out: " << uncomp_stream_.avail_out; + UncompressErrorInit(); + return err; + } else if (uncomp_stream_.avail_out == 0) { + err = Z_BUF_ERROR; + } + + assert(err == Z_OK || err == Z_BUF_ERROR || err == Z_STREAM_END); + if (err == Z_STREAM_END) + err = Z_OK; + + *destLen = uncomp_stream_.total_out - old_total_out; // size for this call + + return err; +} + +int ZLib::UncompressChunkOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int flush_mode) { // Z_SYNC_FLUSH or Z_FINISH + const int ret = + UncompressAtMostOrAll(dest, destLen, source, &sourceLen, flush_mode); + if (ret == Z_BUF_ERROR) + UncompressErrorInit(); + return ret; +} + +int ZLib::UncompressAtMost(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen) { + return UncompressAtMostOrAll(dest, destLen, source, sourceLen, Z_SYNC_FLUSH); +} + +// We make sure we've uncompressed everything, that is, the current +// uncompress stream is at a compressed-buffer-EOF boundary. In gzip +// mode, we also check the gzip footer to make sure we pass the gzip +// consistency checks. We RETURN true iff both types of checks pass. +bool ZLib::UncompressChunkDone() { + assert(!first_chunk_ && uncomp_init_); + // Make sure we're at the end-of-compressed-data point. This means + // if we call inflate with Z_FINISH we won't consume any input or + // write any output + Bytef dummyin, dummyout; + uLongf dummylen = 0; + if ( UncompressChunkOrAll(&dummyout, &dummylen, &dummyin, 0, Z_FINISH) + != Z_OK ) { + return false; + } + + // Make sure that when we exit, we can start a new round of chunks later + Reset(); + + return true; +} + +// Uncompresses the source buffer into the destination buffer. +// The destination buffer must be long enough to hold the entire +// decompressed contents. +// +// We only initialize the uncomp_stream once. Thereafter, we use +// inflateReset, which should be faster. +// +// Returns Z_OK on success, otherwise, it returns a zlib error code. +int ZLib::Uncompress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen) { + int err; + if ( (err=UncompressChunkOrAll(dest, destLen, source, sourceLen, + Z_FINISH)) != Z_OK ) { + Reset(); // let us try to compress again + return err; + } + if ( !UncompressChunkDone() ) // calls Reset() + return Z_DATA_ERROR; + return Z_OK; // stream_end is ok +} + +#endif // HAVE_LIBZ + +} // namespace snappy diff --git a/chromium/third_party/snappy/src/snappy-test.h b/chromium/third_party/snappy/src/snappy-test.h new file mode 100644 index 00000000000..f7ba79ede0b --- /dev/null +++ b/chromium/third_party/snappy/src/snappy-test.h @@ -0,0 +1,580 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various stubs for the unit tests for the open-source version of Snappy. + +#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_ +#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_ + +#include +#include + +#include "snappy-stubs-internal.h" + +#include +#include + +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#ifdef HAVE_WINDOWS_H +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#include + +#ifdef HAVE_GTEST + +#include +#undef TYPED_TEST +#define TYPED_TEST TEST +#define INIT_GTEST(argc, argv) ::testing::InitGoogleTest(argc, *argv) + +#else + +// Stubs for if the user doesn't have Google Test installed. + +#define TEST(test_case, test_subcase) \ + void Test_ ## test_case ## _ ## test_subcase() +#define INIT_GTEST(argc, argv) + +#define TYPED_TEST TEST +#define EXPECT_EQ CHECK_EQ +#define EXPECT_NE CHECK_NE +#define EXPECT_FALSE(cond) CHECK(!(cond)) + +#endif + +#ifdef HAVE_GFLAGS + +#include + +// This is tricky; both gflags and Google Test want to look at the command line +// arguments. Google Test seems to be the most happy with unknown arguments, +// though, so we call it first and hope for the best. +#define InitGoogle(argv0, argc, argv, remove_flags) \ + INIT_GTEST(argc, argv); \ + google::ParseCommandLineFlags(argc, argv, remove_flags); + +#else + +// If we don't have the gflags package installed, these can only be +// changed at compile time. +#define DEFINE_int32(flag_name, default_value, description) \ + static int FLAGS_ ## flag_name = default_value; + +#define InitGoogle(argv0, argc, argv, remove_flags) \ + INIT_GTEST(argc, argv) + +#endif + +#ifdef HAVE_LIBZ +#include "zlib.h" +#endif + +#ifdef HAVE_LIBLZO2 +#include "lzo/lzo1x.h" +#endif + +#ifdef HAVE_LIBLZF +extern "C" { +#include "lzf.h" +} +#endif + +#ifdef HAVE_LIBFASTLZ +#include "fastlz.h" +#endif + +#ifdef HAVE_LIBQUICKLZ +#include "quicklz.h" +#endif + +namespace { + +namespace File { + void Init() { } +} // namespace File + +namespace file { + int Defaults() { } + + class DummyStatus { + public: + void CheckSuccess() { } + }; + + DummyStatus GetContents(const string& filename, string* data, int unused) { + FILE* fp = fopen(filename.c_str(), "rb"); + if (fp == NULL) { + perror(filename.c_str()); + exit(1); + } + + data->clear(); + while (!feof(fp)) { + char buf[4096]; + size_t ret = fread(buf, 1, 4096, fp); + if (ret == 0 && ferror(fp)) { + perror("fread"); + exit(1); + } + data->append(string(buf, ret)); + } + + fclose(fp); + } + + DummyStatus SetContents(const string& filename, + const string& str, + int unused) { + FILE* fp = fopen(filename.c_str(), "wb"); + if (fp == NULL) { + perror(filename.c_str()); + exit(1); + } + + int ret = fwrite(str.data(), str.size(), 1, fp); + if (ret != 1) { + perror("fwrite"); + exit(1); + } + + fclose(fp); + } +} // namespace file + +} // namespace + +namespace snappy { + +#define FLAGS_test_random_seed 301 +typedef string TypeParam; + +void Test_CorruptedTest_VerifyCorrupted(); +void Test_Snappy_SimpleTests(); +void Test_Snappy_MaxBlowup(); +void Test_Snappy_RandomData(); +void Test_Snappy_FourByteOffset(); +void Test_SnappyCorruption_TruncatedVarint(); +void Test_SnappyCorruption_UnterminatedVarint(); +void Test_Snappy_ReadPastEndOfBuffer(); +void Test_Snappy_FindMatchLength(); +void Test_Snappy_FindMatchLengthRandom(); + +string ReadTestDataFile(const string& base, size_t size_limit); + +string ReadTestDataFile(const string& base); + +// A sprintf() variant that returns a std::string. +// Not safe for general use due to truncation issues. +string StringPrintf(const char* format, ...); + +// A simple, non-cryptographically-secure random generator. +class ACMRandom { + public: + explicit ACMRandom(uint32 seed) : seed_(seed) {} + + int32 Next(); + + int32 Uniform(int32 n) { + return Next() % n; + } + uint8 Rand8() { + return static_cast((Next() >> 1) & 0x000000ff); + } + bool OneIn(int X) { return Uniform(X) == 0; } + + // Skewed: pick "base" uniformly from range [0,max_log] and then + // return "base" random bits. The effect is to pick a number in the + // range [0,2^max_log-1] with bias towards smaller numbers. + int32 Skewed(int max_log); + + private: + static const uint32 M = 2147483647L; // 2^31-1 + uint32 seed_; +}; + +inline int32 ACMRandom::Next() { + static const uint64 A = 16807; // bits 14, 8, 7, 5, 2, 1, 0 + // We are computing + // seed_ = (seed_ * A) % M, where M = 2^31-1 + // + // seed_ must not be zero or M, or else all subsequent computed values + // will be zero or M respectively. For all other values, seed_ will end + // up cycling through every number in [1,M-1] + uint64 product = seed_ * A; + + // Compute (product % M) using the fact that ((x << 31) % M) == x. + seed_ = (product >> 31) + (product & M); + // The first reduction may overflow by 1 bit, so we may need to repeat. + // mod == M is not possible; using > allows the faster sign-bit-based test. + if (seed_ > M) { + seed_ -= M; + } + return seed_; +} + +inline int32 ACMRandom::Skewed(int max_log) { + const int32 base = (Next() - 1) % (max_log+1); + return (Next() - 1) & ((1u << base)-1); +} + +// A wall-time clock. This stub is not super-accurate, nor resistant to the +// system time changing. +class CycleTimer { + public: + CycleTimer() : real_time_us_(0) {} + + void Start() { +#ifdef WIN32 + QueryPerformanceCounter(&start_); +#else + gettimeofday(&start_, NULL); +#endif + } + + void Stop() { +#ifdef WIN32 + LARGE_INTEGER stop; + LARGE_INTEGER frequency; + QueryPerformanceCounter(&stop); + QueryPerformanceFrequency(&frequency); + + double elapsed = static_cast(stop.QuadPart - start_.QuadPart) / + frequency.QuadPart; + real_time_us_ += elapsed * 1e6 + 0.5; +#else + struct timeval stop; + gettimeofday(&stop, NULL); + + real_time_us_ += 1000000 * (stop.tv_sec - start_.tv_sec); + real_time_us_ += (stop.tv_usec - start_.tv_usec); +#endif + } + + double Get() { + return real_time_us_ * 1e-6; + } + + private: + int64 real_time_us_; +#ifdef WIN32 + LARGE_INTEGER start_; +#else + struct timeval start_; +#endif +}; + +// Minimalistic microbenchmark framework. + +typedef void (*BenchmarkFunction)(int, int); + +class Benchmark { + public: + Benchmark(const string& name, BenchmarkFunction function) : + name_(name), function_(function) {} + + Benchmark* DenseRange(int start, int stop) { + start_ = start; + stop_ = stop; + return this; + } + + void Run(); + + private: + const string name_; + const BenchmarkFunction function_; + int start_, stop_; +}; +#define BENCHMARK(benchmark_name) \ + Benchmark* Benchmark_ ## benchmark_name = \ + (new Benchmark(#benchmark_name, benchmark_name)) + +extern Benchmark* Benchmark_BM_UFlat; +extern Benchmark* Benchmark_BM_UValidate; +extern Benchmark* Benchmark_BM_ZFlat; + +void ResetBenchmarkTiming(); +void StartBenchmarkTiming(); +void StopBenchmarkTiming(); +void SetBenchmarkLabel(const string& str); +void SetBenchmarkBytesProcessed(int64 bytes); + +#ifdef HAVE_LIBZ + +// Object-oriented wrapper around zlib. +class ZLib { + public: + ZLib(); + ~ZLib(); + + // Wipe a ZLib object to a virgin state. This differs from Reset() + // in that it also breaks any state. + void Reinit(); + + // Call this to make a zlib buffer as good as new. Here's the only + // case where they differ: + // CompressChunk(a); CompressChunk(b); CompressChunkDone(); vs + // CompressChunk(a); Reset(); CompressChunk(b); CompressChunkDone(); + // You'll want to use Reset(), then, when you interrupt a compress + // (or uncompress) in the middle of a chunk and want to start over. + void Reset(); + + // According to the zlib manual, when you Compress, the destination + // buffer must have size at least src + .1%*src + 12. This function + // helps you calculate that. Augment this to account for a potential + // gzip header and footer, plus a few bytes of slack. + static int MinCompressbufSize(int uncompress_size) { + return uncompress_size + uncompress_size/1000 + 40; + } + + // Compresses the source buffer into the destination buffer. + // sourceLen is the byte length of the source buffer. + // Upon entry, destLen is the total size of the destination buffer, + // which must be of size at least MinCompressbufSize(sourceLen). + // Upon exit, destLen is the actual size of the compressed buffer. + // + // This function can be used to compress a whole file at once if the + // input file is mmap'ed. + // + // Returns Z_OK if success, Z_MEM_ERROR if there was not + // enough memory, Z_BUF_ERROR if there was not enough room in the + // output buffer. Note that if the output buffer is exactly the same + // size as the compressed result, we still return Z_BUF_ERROR. + // (check CL#1936076) + int Compress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); + + // Uncompresses the source buffer into the destination buffer. + // The destination buffer must be long enough to hold the entire + // decompressed contents. + // + // Returns Z_OK on success, otherwise, it returns a zlib error code. + int Uncompress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); + + // Uncompress data one chunk at a time -- ie you can call this + // more than once. To get this to work you need to call per-chunk + // and "done" routines. + // + // Returns Z_OK if success, Z_MEM_ERROR if there was not + // enough memory, Z_BUF_ERROR if there was not enough room in the + // output buffer. + + int UncompressAtMost(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); + + // Checks gzip footer information, as needed. Mostly this just + // makes sure the checksums match. Whenever you call this, it + // will assume the last 8 bytes from the previous UncompressChunk + // call are the footer. Returns true iff everything looks ok. + bool UncompressChunkDone(); + + private: + int InflateInit(); // sets up the zlib inflate structure + int DeflateInit(); // sets up the zlib deflate structure + + // These init the zlib data structures for compressing/uncompressing + int CompressInit(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); + int UncompressInit(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); + // Initialization method to be called if we hit an error while + // uncompressing. On hitting an error, call this method before + // returning the error. + void UncompressErrorInit(); + + // Helper function for Compress + int CompressChunkOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int flush_mode); + int CompressAtMostOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen, + int flush_mode); + + // Likewise for UncompressAndUncompressChunk + int UncompressChunkOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int flush_mode); + + int UncompressAtMostOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen, + int flush_mode); + + // Initialization method to be called if we hit an error while + // compressing. On hitting an error, call this method before + // returning the error. + void CompressErrorInit(); + + int compression_level_; // compression level + int window_bits_; // log base 2 of the window size used in compression + int mem_level_; // specifies the amount of memory to be used by + // compressor (1-9) + z_stream comp_stream_; // Zlib stream data structure + bool comp_init_; // True if we have initialized comp_stream_ + z_stream uncomp_stream_; // Zlib stream data structure + bool uncomp_init_; // True if we have initialized uncomp_stream_ + + // These are used only with chunked compression. + bool first_chunk_; // true if we need to emit headers with this chunk +}; + +#endif // HAVE_LIBZ + +} // namespace snappy + +DECLARE_bool(run_microbenchmarks); + +static void RunSpecifiedBenchmarks() { + if (!FLAGS_run_microbenchmarks) { + return; + } + + fprintf(stderr, "Running microbenchmarks.\n"); +#ifndef NDEBUG + fprintf(stderr, "WARNING: Compiled with assertions enabled, will be slow.\n"); +#endif +#ifndef __OPTIMIZE__ + fprintf(stderr, "WARNING: Compiled without optimization, will be slow.\n"); +#endif + fprintf(stderr, "Benchmark Time(ns) CPU(ns) Iterations\n"); + fprintf(stderr, "---------------------------------------------------\n"); + + snappy::Benchmark_BM_UFlat->Run(); + snappy::Benchmark_BM_UValidate->Run(); + snappy::Benchmark_BM_ZFlat->Run(); + + fprintf(stderr, "\n"); +} + +#ifndef HAVE_GTEST + +static inline int RUN_ALL_TESTS() { + fprintf(stderr, "Running correctness tests.\n"); + snappy::Test_CorruptedTest_VerifyCorrupted(); + snappy::Test_Snappy_SimpleTests(); + snappy::Test_Snappy_MaxBlowup(); + snappy::Test_Snappy_RandomData(); + snappy::Test_Snappy_FourByteOffset(); + snappy::Test_SnappyCorruption_TruncatedVarint(); + snappy::Test_SnappyCorruption_UnterminatedVarint(); + snappy::Test_Snappy_ReadPastEndOfBuffer(); + snappy::Test_Snappy_FindMatchLength(); + snappy::Test_Snappy_FindMatchLengthRandom(); + fprintf(stderr, "All tests passed.\n"); + + return 0; +} + +#endif // HAVE_GTEST + +// For main(). +namespace snappy { + +static void CompressFile(const char* fname); +static void UncompressFile(const char* fname); +static void MeasureFile(const char* fname); + +// Logging. + +#define LOG(level) LogMessage() +#define VLOG(level) true ? (void)0 : \ + snappy::LogMessageVoidify() & snappy::LogMessage() + +class LogMessage { + public: + LogMessage() { } + ~LogMessage() { + cerr << endl; + } + + LogMessage& operator<<(const std::string& msg) { + cerr << msg; + return *this; + } + LogMessage& operator<<(int x) { + cerr << x; + return *this; + } +}; + +// Asserts, both versions activated in debug mode only, +// and ones that are always active. + +#define CRASH_UNLESS(condition) \ + PREDICT_TRUE(condition) ? (void)0 : \ + snappy::LogMessageVoidify() & snappy::LogMessageCrash() + +class LogMessageCrash : public LogMessage { + public: + LogMessageCrash() { } + ~LogMessageCrash() { + cerr << endl; + abort(); + } +}; + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". + +class LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(const LogMessage&) { } +}; + +#define CHECK(cond) CRASH_UNLESS(cond) +#define CHECK_LE(a, b) CRASH_UNLESS((a) <= (b)) +#define CHECK_GE(a, b) CRASH_UNLESS((a) >= (b)) +#define CHECK_EQ(a, b) CRASH_UNLESS((a) == (b)) +#define CHECK_NE(a, b) CRASH_UNLESS((a) != (b)) +#define CHECK_LT(a, b) CRASH_UNLESS((a) < (b)) +#define CHECK_GT(a, b) CRASH_UNLESS((a) > (b)) + +} // namespace + +using snappy::CompressFile; +using snappy::UncompressFile; +using snappy::MeasureFile; + +#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_ diff --git a/chromium/third_party/snappy/src/snappy.cc b/chromium/third_party/snappy/src/snappy.cc new file mode 100644 index 00000000000..1230321f651 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy.cc @@ -0,0 +1,1119 @@ +// Copyright 2005 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "snappy.h" +#include "snappy-internal.h" +#include "snappy-sinksource.h" + +#include + +#include +#include +#include + + +namespace snappy { + +// Any hash function will produce a valid compressed bitstream, but a good +// hash function reduces the number of collisions and thus yields better +// compression for compressible input, and more speed for incompressible +// input. Of course, it doesn't hurt if the hash function is reasonably fast +// either, as it gets called a lot. +static inline uint32 HashBytes(uint32 bytes, int shift) { + uint32 kMul = 0x1e35a7bd; + return (bytes * kMul) >> shift; +} +static inline uint32 Hash(const char* p, int shift) { + return HashBytes(UNALIGNED_LOAD32(p), shift); +} + +size_t MaxCompressedLength(size_t source_len) { + // Compressed data can be defined as: + // compressed := item* literal* + // item := literal* copy + // + // The trailing literal sequence has a space blowup of at most 62/60 + // since a literal of length 60 needs one tag byte + one extra byte + // for length information. + // + // Item blowup is trickier to measure. Suppose the "copy" op copies + // 4 bytes of data. Because of a special check in the encoding code, + // we produce a 4-byte copy only if the offset is < 65536. Therefore + // the copy op takes 3 bytes to encode, and this type of item leads + // to at most the 62/60 blowup for representing literals. + // + // Suppose the "copy" op copies 5 bytes of data. If the offset is big + // enough, it will take 5 bytes to encode the copy op. Therefore the + // worst case here is a one-byte literal followed by a five-byte copy. + // I.e., 6 bytes of input turn into 7 bytes of "compressed" data. + // + // This last factor dominates the blowup, so the final estimate is: + return 32 + source_len + source_len/6; +} + +enum { + LITERAL = 0, + COPY_1_BYTE_OFFSET = 1, // 3 bit length + 3 bits of offset in opcode + COPY_2_BYTE_OFFSET = 2, + COPY_4_BYTE_OFFSET = 3 +}; + +// Copy "len" bytes from "src" to "op", one byte at a time. Used for +// handling COPY operations where the input and output regions may +// overlap. For example, suppose: +// src == "ab" +// op == src + 2 +// len == 20 +// After IncrementalCopy(src, op, len), the result will have +// eleven copies of "ab" +// ababababababababababab +// Note that this does not match the semantics of either memcpy() +// or memmove(). +static inline void IncrementalCopy(const char* src, char* op, int len) { + assert(len > 0); + do { + *op++ = *src++; + } while (--len > 0); +} + +// Equivalent to IncrementalCopy except that it can write up to ten extra +// bytes after the end of the copy, and that it is faster. +// +// The main part of this loop is a simple copy of eight bytes at a time until +// we've copied (at least) the requested amount of bytes. However, if op and +// src are less than eight bytes apart (indicating a repeating pattern of +// length < 8), we first need to expand the pattern in order to get the correct +// results. For instance, if the buffer looks like this, with the eight-byte +// and patterns marked as intervals: +// +// abxxxxxxxxxxxx +// [------] src +// [------] op +// +// a single eight-byte copy from to will repeat the pattern once, +// after which we can move two bytes without moving : +// +// ababxxxxxxxxxx +// [------] src +// [------] op +// +// and repeat the exercise until the two no longer overlap. +// +// This allows us to do very well in the special case of one single byte +// repeated many times, without taking a big hit for more general cases. +// +// The worst case of extra writing past the end of the match occurs when +// op - src == 1 and len == 1; the last copy will read from byte positions +// [0..7] and write to [4..11], whereas it was only supposed to write to +// position 1. Thus, ten excess bytes. + +namespace { + +const int kMaxIncrementCopyOverflow = 10; + +} // namespace + +static inline void IncrementalCopyFastPath(const char* src, char* op, int len) { + while (op - src < 8) { + UnalignedCopy64(src, op); + len -= op - src; + op += op - src; + } + while (len > 0) { + UnalignedCopy64(src, op); + src += 8; + op += 8; + len -= 8; + } +} + +static inline char* EmitLiteral(char* op, + const char* literal, + int len, + bool allow_fast_path) { + int n = len - 1; // Zero-length literals are disallowed + if (n < 60) { + // Fits in tag byte + *op++ = LITERAL | (n << 2); + + // The vast majority of copies are below 16 bytes, for which a + // call to memcpy is overkill. This fast path can sometimes + // copy up to 15 bytes too much, but that is okay in the + // main loop, since we have a bit to go on for both sides: + // + // - The input will always have kInputMarginBytes = 15 extra + // available bytes, as long as we're in the main loop, and + // if not, allow_fast_path = false. + // - The output will always have 32 spare bytes (see + // MaxCompressedLength). + if (allow_fast_path && len <= 16) { + UnalignedCopy64(literal, op); + UnalignedCopy64(literal + 8, op + 8); + return op + len; + } + } else { + // Encode in upcoming bytes + char* base = op; + int count = 0; + op++; + while (n > 0) { + *op++ = n & 0xff; + n >>= 8; + count++; + } + assert(count >= 1); + assert(count <= 4); + *base = LITERAL | ((59+count) << 2); + } + memcpy(op, literal, len); + return op + len; +} + +static inline char* EmitCopyLessThan64(char* op, size_t offset, int len) { + assert(len <= 64); + assert(len >= 4); + assert(offset < 65536); + + if ((len < 12) && (offset < 2048)) { + size_t len_minus_4 = len - 4; + assert(len_minus_4 < 8); // Must fit in 3 bits + *op++ = COPY_1_BYTE_OFFSET + ((len_minus_4) << 2) + ((offset >> 8) << 5); + *op++ = offset & 0xff; + } else { + *op++ = COPY_2_BYTE_OFFSET + ((len-1) << 2); + LittleEndian::Store16(op, offset); + op += 2; + } + return op; +} + +static inline char* EmitCopy(char* op, size_t offset, int len) { + // Emit 64 byte copies but make sure to keep at least four bytes reserved + while (len >= 68) { + op = EmitCopyLessThan64(op, offset, 64); + len -= 64; + } + + // Emit an extra 60 byte copy if have too much data to fit in one copy + if (len > 64) { + op = EmitCopyLessThan64(op, offset, 60); + len -= 60; + } + + // Emit remainder + op = EmitCopyLessThan64(op, offset, len); + return op; +} + + +bool GetUncompressedLength(const char* start, size_t n, size_t* result) { + uint32 v = 0; + const char* limit = start + n; + if (Varint::Parse32WithLimit(start, limit, &v) != NULL) { + *result = v; + return true; + } else { + return false; + } +} + +namespace internal { +uint16* WorkingMemory::GetHashTable(size_t input_size, int* table_size) { + // Use smaller hash table when input.size() is smaller, since we + // fill the table, incurring O(hash table size) overhead for + // compression, and if the input is short, we won't need that + // many hash table entries anyway. + assert(kMaxHashTableSize >= 256); + size_t htsize = 256; + while (htsize < kMaxHashTableSize && htsize < input_size) { + htsize <<= 1; + } + + uint16* table; + if (htsize <= ARRAYSIZE(small_table_)) { + table = small_table_; + } else { + if (large_table_ == NULL) { + large_table_ = new uint16[kMaxHashTableSize]; + } + table = large_table_; + } + + *table_size = htsize; + memset(table, 0, htsize * sizeof(*table)); + return table; +} +} // end namespace internal + +// For 0 <= offset <= 4, GetUint32AtOffset(GetEightBytesAt(p), offset) will +// equal UNALIGNED_LOAD32(p + offset). Motivation: On x86-64 hardware we have +// empirically found that overlapping loads such as +// UNALIGNED_LOAD32(p) ... UNALIGNED_LOAD32(p+1) ... UNALIGNED_LOAD32(p+2) +// are slower than UNALIGNED_LOAD64(p) followed by shifts and casts to uint32. +// +// We have different versions for 64- and 32-bit; ideally we would avoid the +// two functions and just inline the UNALIGNED_LOAD64 call into +// GetUint32AtOffset, but GCC (at least not as of 4.6) is seemingly not clever +// enough to avoid loading the value multiple times then. For 64-bit, the load +// is done when GetEightBytesAt() is called, whereas for 32-bit, the load is +// done at GetUint32AtOffset() time. + +#ifdef ARCH_K8 + +typedef uint64 EightBytesReference; + +static inline EightBytesReference GetEightBytesAt(const char* ptr) { + return UNALIGNED_LOAD64(ptr); +} + +static inline uint32 GetUint32AtOffset(uint64 v, int offset) { + assert(offset >= 0); + assert(offset <= 4); + return v >> (LittleEndian::IsLittleEndian() ? 8 * offset : 32 - 8 * offset); +} + +#else + +typedef const char* EightBytesReference; + +static inline EightBytesReference GetEightBytesAt(const char* ptr) { + return ptr; +} + +static inline uint32 GetUint32AtOffset(const char* v, int offset) { + assert(offset >= 0); + assert(offset <= 4); + return UNALIGNED_LOAD32(v + offset); +} + +#endif + +// Flat array compression that does not emit the "uncompressed length" +// prefix. Compresses "input" string to the "*op" buffer. +// +// REQUIRES: "input" is at most "kBlockSize" bytes long. +// REQUIRES: "op" points to an array of memory that is at least +// "MaxCompressedLength(input.size())" in size. +// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero. +// REQUIRES: "table_size" is a power of two +// +// Returns an "end" pointer into "op" buffer. +// "end - op" is the compressed size of "input". +namespace internal { +char* CompressFragment(const char* input, + size_t input_size, + char* op, + uint16* table, + const int table_size) { + // "ip" is the input pointer, and "op" is the output pointer. + const char* ip = input; + assert(input_size <= kBlockSize); + assert((table_size & (table_size - 1)) == 0); // table must be power of two + const int shift = 32 - Bits::Log2Floor(table_size); + assert(static_cast(kuint32max >> shift) == table_size - 1); + const char* ip_end = input + input_size; + const char* base_ip = ip; + // Bytes in [next_emit, ip) will be emitted as literal bytes. Or + // [next_emit, ip_end) after the main loop. + const char* next_emit = ip; + + const size_t kInputMarginBytes = 15; + if (PREDICT_TRUE(input_size >= kInputMarginBytes)) { + const char* ip_limit = input + input_size - kInputMarginBytes; + + for (uint32 next_hash = Hash(++ip, shift); ; ) { + assert(next_emit < ip); + // The body of this loop calls EmitLiteral once and then EmitCopy one or + // more times. (The exception is that when we're close to exhausting + // the input we goto emit_remainder.) + // + // In the first iteration of this loop we're just starting, so + // there's nothing to copy, so calling EmitLiteral once is + // necessary. And we only start a new iteration when the + // current iteration has determined that a call to EmitLiteral will + // precede the next call to EmitCopy (if any). + // + // Step 1: Scan forward in the input looking for a 4-byte-long match. + // If we get close to exhausting the input then goto emit_remainder. + // + // Heuristic match skipping: If 32 bytes are scanned with no matches + // found, start looking only at every other byte. If 32 more bytes are + // scanned, look at every third byte, etc.. When a match is found, + // immediately go back to looking at every byte. This is a small loss + // (~5% performance, ~0.1% density) for compressible data due to more + // bookkeeping, but for non-compressible data (such as JPEG) it's a huge + // win since the compressor quickly "realizes" the data is incompressible + // and doesn't bother looking for matches everywhere. + // + // The "skip" variable keeps track of how many bytes there are since the + // last match; dividing it by 32 (ie. right-shifting by five) gives the + // number of bytes to move ahead for each iteration. + uint32 skip = 32; + + const char* next_ip = ip; + const char* candidate; + do { + ip = next_ip; + uint32 hash = next_hash; + assert(hash == Hash(ip, shift)); + uint32 bytes_between_hash_lookups = skip++ >> 5; + next_ip = ip + bytes_between_hash_lookups; + if (PREDICT_FALSE(next_ip > ip_limit)) { + goto emit_remainder; + } + next_hash = Hash(next_ip, shift); + candidate = base_ip + table[hash]; + assert(candidate >= base_ip); + assert(candidate < ip); + + table[hash] = ip - base_ip; + } while (PREDICT_TRUE(UNALIGNED_LOAD32(ip) != + UNALIGNED_LOAD32(candidate))); + + // Step 2: A 4-byte match has been found. We'll later see if more + // than 4 bytes match. But, prior to the match, input + // bytes [next_emit, ip) are unmatched. Emit them as "literal bytes." + assert(next_emit + 16 <= ip_end); + op = EmitLiteral(op, next_emit, ip - next_emit, true); + + // Step 3: Call EmitCopy, and then see if another EmitCopy could + // be our next move. Repeat until we find no match for the + // input immediately after what was consumed by the last EmitCopy call. + // + // If we exit this loop normally then we need to call EmitLiteral next, + // though we don't yet know how big the literal will be. We handle that + // by proceeding to the next iteration of the main loop. We also can exit + // this loop via goto if we get close to exhausting the input. + EightBytesReference input_bytes; + uint32 candidate_bytes = 0; + + do { + // We have a 4-byte match at ip, and no need to emit any + // "literal bytes" prior to ip. + const char* base = ip; + int matched = 4 + FindMatchLength(candidate + 4, ip + 4, ip_end); + ip += matched; + size_t offset = base - candidate; + assert(0 == memcmp(base, candidate, matched)); + op = EmitCopy(op, offset, matched); + // We could immediately start working at ip now, but to improve + // compression we first update table[Hash(ip - 1, ...)]. + const char* insert_tail = ip - 1; + next_emit = ip; + if (PREDICT_FALSE(ip >= ip_limit)) { + goto emit_remainder; + } + input_bytes = GetEightBytesAt(insert_tail); + uint32 prev_hash = HashBytes(GetUint32AtOffset(input_bytes, 0), shift); + table[prev_hash] = ip - base_ip - 1; + uint32 cur_hash = HashBytes(GetUint32AtOffset(input_bytes, 1), shift); + candidate = base_ip + table[cur_hash]; + candidate_bytes = UNALIGNED_LOAD32(candidate); + table[cur_hash] = ip - base_ip; + } while (GetUint32AtOffset(input_bytes, 1) == candidate_bytes); + + next_hash = HashBytes(GetUint32AtOffset(input_bytes, 2), shift); + ++ip; + } + } + + emit_remainder: + // Emit the remaining bytes as a literal + if (next_emit < ip_end) { + op = EmitLiteral(op, next_emit, ip_end - next_emit, false); + } + + return op; +} +} // end namespace internal + +// Signature of output types needed by decompression code. +// The decompression code is templatized on a type that obeys this +// signature so that we do not pay virtual function call overhead in +// the middle of a tight decompression loop. +// +// class DecompressionWriter { +// public: +// // Called before decompression +// void SetExpectedLength(size_t length); +// +// // Called after decompression +// bool CheckLength() const; +// +// // Called repeatedly during decompression +// bool Append(const char* ip, size_t length); +// bool AppendFromSelf(uint32 offset, size_t length); +// +// // The difference between TryFastAppend and Append is that TryFastAppend +// // is allowed to read up to bytes from the input buffer, +// // whereas Append is allowed to read . +// // +// // Also, TryFastAppend is allowed to return false, declining the append, +// // without it being a fatal error -- just "return false" would be +// // a perfectly legal implementation of TryFastAppend. The intention +// // is for TryFastAppend to allow a fast path in the common case of +// // a small append. +// // +// // NOTE(user): TryFastAppend must always return decline (return false) +// // if is 61 or more, as in this case the literal length is not +// // decoded fully. In practice, this should not be a big problem, +// // as it is unlikely that one would implement a fast path accepting +// // this much data. +// bool TryFastAppend(const char* ip, size_t available, size_t length); +// }; + +// ----------------------------------------------------------------------- +// Lookup table for decompression code. Generated by ComputeTable() below. +// ----------------------------------------------------------------------- + +// Mapping from i in range [0,4] to a mask to extract the bottom 8*i bits +static const uint32 wordmask[] = { + 0u, 0xffu, 0xffffu, 0xffffffu, 0xffffffffu +}; + +// Data stored per entry in lookup table: +// Range Bits-used Description +// ------------------------------------ +// 1..64 0..7 Literal/copy length encoded in opcode byte +// 0..7 8..10 Copy offset encoded in opcode byte / 256 +// 0..4 11..13 Extra bytes after opcode +// +// We use eight bits for the length even though 7 would have sufficed +// because of efficiency reasons: +// (1) Extracting a byte is faster than a bit-field +// (2) It properly aligns copy offset so we do not need a <<8 +static const uint16 char_table[256] = { + 0x0001, 0x0804, 0x1001, 0x2001, 0x0002, 0x0805, 0x1002, 0x2002, + 0x0003, 0x0806, 0x1003, 0x2003, 0x0004, 0x0807, 0x1004, 0x2004, + 0x0005, 0x0808, 0x1005, 0x2005, 0x0006, 0x0809, 0x1006, 0x2006, + 0x0007, 0x080a, 0x1007, 0x2007, 0x0008, 0x080b, 0x1008, 0x2008, + 0x0009, 0x0904, 0x1009, 0x2009, 0x000a, 0x0905, 0x100a, 0x200a, + 0x000b, 0x0906, 0x100b, 0x200b, 0x000c, 0x0907, 0x100c, 0x200c, + 0x000d, 0x0908, 0x100d, 0x200d, 0x000e, 0x0909, 0x100e, 0x200e, + 0x000f, 0x090a, 0x100f, 0x200f, 0x0010, 0x090b, 0x1010, 0x2010, + 0x0011, 0x0a04, 0x1011, 0x2011, 0x0012, 0x0a05, 0x1012, 0x2012, + 0x0013, 0x0a06, 0x1013, 0x2013, 0x0014, 0x0a07, 0x1014, 0x2014, + 0x0015, 0x0a08, 0x1015, 0x2015, 0x0016, 0x0a09, 0x1016, 0x2016, + 0x0017, 0x0a0a, 0x1017, 0x2017, 0x0018, 0x0a0b, 0x1018, 0x2018, + 0x0019, 0x0b04, 0x1019, 0x2019, 0x001a, 0x0b05, 0x101a, 0x201a, + 0x001b, 0x0b06, 0x101b, 0x201b, 0x001c, 0x0b07, 0x101c, 0x201c, + 0x001d, 0x0b08, 0x101d, 0x201d, 0x001e, 0x0b09, 0x101e, 0x201e, + 0x001f, 0x0b0a, 0x101f, 0x201f, 0x0020, 0x0b0b, 0x1020, 0x2020, + 0x0021, 0x0c04, 0x1021, 0x2021, 0x0022, 0x0c05, 0x1022, 0x2022, + 0x0023, 0x0c06, 0x1023, 0x2023, 0x0024, 0x0c07, 0x1024, 0x2024, + 0x0025, 0x0c08, 0x1025, 0x2025, 0x0026, 0x0c09, 0x1026, 0x2026, + 0x0027, 0x0c0a, 0x1027, 0x2027, 0x0028, 0x0c0b, 0x1028, 0x2028, + 0x0029, 0x0d04, 0x1029, 0x2029, 0x002a, 0x0d05, 0x102a, 0x202a, + 0x002b, 0x0d06, 0x102b, 0x202b, 0x002c, 0x0d07, 0x102c, 0x202c, + 0x002d, 0x0d08, 0x102d, 0x202d, 0x002e, 0x0d09, 0x102e, 0x202e, + 0x002f, 0x0d0a, 0x102f, 0x202f, 0x0030, 0x0d0b, 0x1030, 0x2030, + 0x0031, 0x0e04, 0x1031, 0x2031, 0x0032, 0x0e05, 0x1032, 0x2032, + 0x0033, 0x0e06, 0x1033, 0x2033, 0x0034, 0x0e07, 0x1034, 0x2034, + 0x0035, 0x0e08, 0x1035, 0x2035, 0x0036, 0x0e09, 0x1036, 0x2036, + 0x0037, 0x0e0a, 0x1037, 0x2037, 0x0038, 0x0e0b, 0x1038, 0x2038, + 0x0039, 0x0f04, 0x1039, 0x2039, 0x003a, 0x0f05, 0x103a, 0x203a, + 0x003b, 0x0f06, 0x103b, 0x203b, 0x003c, 0x0f07, 0x103c, 0x203c, + 0x0801, 0x0f08, 0x103d, 0x203d, 0x1001, 0x0f09, 0x103e, 0x203e, + 0x1801, 0x0f0a, 0x103f, 0x203f, 0x2001, 0x0f0b, 0x1040, 0x2040 +}; + +// In debug mode, allow optional computation of the table at startup. +// Also, check that the decompression table is correct. +#ifndef NDEBUG +DEFINE_bool(snappy_dump_decompression_table, false, + "If true, we print the decompression table at startup."); + +static uint16 MakeEntry(unsigned int extra, + unsigned int len, + unsigned int copy_offset) { + // Check that all of the fields fit within the allocated space + assert(extra == (extra & 0x7)); // At most 3 bits + assert(copy_offset == (copy_offset & 0x7)); // At most 3 bits + assert(len == (len & 0x7f)); // At most 7 bits + return len | (copy_offset << 8) | (extra << 11); +} + +static void ComputeTable() { + uint16 dst[256]; + + // Place invalid entries in all places to detect missing initialization + int assigned = 0; + for (int i = 0; i < 256; i++) { + dst[i] = 0xffff; + } + + // Small LITERAL entries. We store (len-1) in the top 6 bits. + for (unsigned int len = 1; len <= 60; len++) { + dst[LITERAL | ((len-1) << 2)] = MakeEntry(0, len, 0); + assigned++; + } + + // Large LITERAL entries. We use 60..63 in the high 6 bits to + // encode the number of bytes of length info that follow the opcode. + for (unsigned int extra_bytes = 1; extra_bytes <= 4; extra_bytes++) { + // We set the length field in the lookup table to 1 because extra + // bytes encode len-1. + dst[LITERAL | ((extra_bytes+59) << 2)] = MakeEntry(extra_bytes, 1, 0); + assigned++; + } + + // COPY_1_BYTE_OFFSET. + // + // The tag byte in the compressed data stores len-4 in 3 bits, and + // offset/256 in 5 bits. offset%256 is stored in the next byte. + // + // This format is used for length in range [4..11] and offset in + // range [0..2047] + for (unsigned int len = 4; len < 12; len++) { + for (unsigned int offset = 0; offset < 2048; offset += 256) { + dst[COPY_1_BYTE_OFFSET | ((len-4)<<2) | ((offset>>8)<<5)] = + MakeEntry(1, len, offset>>8); + assigned++; + } + } + + // COPY_2_BYTE_OFFSET. + // Tag contains len-1 in top 6 bits, and offset in next two bytes. + for (unsigned int len = 1; len <= 64; len++) { + dst[COPY_2_BYTE_OFFSET | ((len-1)<<2)] = MakeEntry(2, len, 0); + assigned++; + } + + // COPY_4_BYTE_OFFSET. + // Tag contents len-1 in top 6 bits, and offset in next four bytes. + for (unsigned int len = 1; len <= 64; len++) { + dst[COPY_4_BYTE_OFFSET | ((len-1)<<2)] = MakeEntry(4, len, 0); + assigned++; + } + + // Check that each entry was initialized exactly once. + if (assigned != 256) { + fprintf(stderr, "ComputeTable: assigned only %d of 256\n", assigned); + abort(); + } + for (int i = 0; i < 256; i++) { + if (dst[i] == 0xffff) { + fprintf(stderr, "ComputeTable: did not assign byte %d\n", i); + abort(); + } + } + + if (FLAGS_snappy_dump_decompression_table) { + printf("static const uint16 char_table[256] = {\n "); + for (int i = 0; i < 256; i++) { + printf("0x%04x%s", + dst[i], + ((i == 255) ? "\n" : (((i%8) == 7) ? ",\n " : ", "))); + } + printf("};\n"); + } + + // Check that computed table matched recorded table + for (int i = 0; i < 256; i++) { + if (dst[i] != char_table[i]) { + fprintf(stderr, "ComputeTable: byte %d: computed (%x), expect (%x)\n", + i, static_cast(dst[i]), static_cast(char_table[i])); + abort(); + } + } +} +#endif /* !NDEBUG */ + +// Helper class for decompression +class SnappyDecompressor { + private: + Source* reader_; // Underlying source of bytes to decompress + const char* ip_; // Points to next buffered byte + const char* ip_limit_; // Points just past buffered bytes + uint32 peeked_; // Bytes peeked from reader (need to skip) + bool eof_; // Hit end of input without an error? + char scratch_[5]; // Temporary buffer for PeekFast() boundaries + + // Ensure that all of the tag metadata for the next tag is available + // in [ip_..ip_limit_-1]. Also ensures that [ip,ip+4] is readable even + // if (ip_limit_ - ip_ < 5). + // + // Returns true on success, false on error or end of input. + bool RefillTag(); + + public: + explicit SnappyDecompressor(Source* reader) + : reader_(reader), + ip_(NULL), + ip_limit_(NULL), + peeked_(0), + eof_(false) { + } + + ~SnappyDecompressor() { + // Advance past any bytes we peeked at from the reader + reader_->Skip(peeked_); + } + + // Returns true iff we have hit the end of the input without an error. + bool eof() const { + return eof_; + } + + // Read the uncompressed length stored at the start of the compressed data. + // On succcess, stores the length in *result and returns true. + // On failure, returns false. + bool ReadUncompressedLength(uint32* result) { + assert(ip_ == NULL); // Must not have read anything yet + // Length is encoded in 1..5 bytes + *result = 0; + uint32 shift = 0; + while (true) { + if (shift >= 32) return false; + size_t n; + const char* ip = reader_->Peek(&n); + if (n == 0) return false; + const unsigned char c = *(reinterpret_cast(ip)); + reader_->Skip(1); + *result |= static_cast(c & 0x7f) << shift; + if (c < 128) { + break; + } + shift += 7; + } + return true; + } + + // Process the next item found in the input. + // Returns true if successful, false on error or end of input. + template + void DecompressAllTags(Writer* writer) { + const char* ip = ip_; + + // We could have put this refill fragment only at the beginning of the loop. + // However, duplicating it at the end of each branch gives the compiler more + // scope to optimize the expression based on the local + // context, which overall increases speed. + #define MAYBE_REFILL() \ + if (ip_limit_ - ip < 5) { \ + ip_ = ip; \ + if (!RefillTag()) return; \ + ip = ip_; \ + } + + MAYBE_REFILL(); + for ( ;; ) { + const unsigned char c = *(reinterpret_cast(ip++)); + + if ((c & 0x3) == LITERAL) { + size_t literal_length = (c >> 2) + 1u; + if (writer->TryFastAppend(ip, ip_limit_ - ip, literal_length)) { + assert(literal_length < 61); + ip += literal_length; + MAYBE_REFILL(); + continue; + } + if (PREDICT_FALSE(literal_length >= 61)) { + // Long literal. + const size_t literal_length_length = literal_length - 60; + literal_length = + (LittleEndian::Load32(ip) & wordmask[literal_length_length]) + 1; + ip += literal_length_length; + } + + size_t avail = ip_limit_ - ip; + while (avail < literal_length) { + if (!writer->Append(ip, avail)) return; + literal_length -= avail; + reader_->Skip(peeked_); + size_t n; + ip = reader_->Peek(&n); + avail = n; + peeked_ = avail; + if (avail == 0) return; // Premature end of input + ip_limit_ = ip + avail; + } + if (!writer->Append(ip, literal_length)) { + return; + } + ip += literal_length; + MAYBE_REFILL(); + } else { + const uint32 entry = char_table[c]; + const uint32 trailer = LittleEndian::Load32(ip) & wordmask[entry >> 11]; + const uint32 length = entry & 0xff; + ip += entry >> 11; + + // copy_offset/256 is encoded in bits 8..10. By just fetching + // those bits, we get copy_offset (since the bit-field starts at + // bit 8). + const uint32 copy_offset = entry & 0x700; + if (!writer->AppendFromSelf(copy_offset + trailer, length)) { + return; + } + MAYBE_REFILL(); + } + } + +#undef MAYBE_REFILL + } +}; + +bool SnappyDecompressor::RefillTag() { + const char* ip = ip_; + if (ip == ip_limit_) { + // Fetch a new fragment from the reader + reader_->Skip(peeked_); // All peeked bytes are used up + size_t n; + ip = reader_->Peek(&n); + peeked_ = n; + if (n == 0) { + eof_ = true; + return false; + } + ip_limit_ = ip + n; + } + + // Read the tag character + assert(ip < ip_limit_); + const unsigned char c = *(reinterpret_cast(ip)); + const uint32 entry = char_table[c]; + const uint32 needed = (entry >> 11) + 1; // +1 byte for 'c' + assert(needed <= sizeof(scratch_)); + + // Read more bytes from reader if needed + uint32 nbuf = ip_limit_ - ip; + if (nbuf < needed) { + // Stitch together bytes from ip and reader to form the word + // contents. We store the needed bytes in "scratch_". They + // will be consumed immediately by the caller since we do not + // read more than we need. + memmove(scratch_, ip, nbuf); + reader_->Skip(peeked_); // All peeked bytes are used up + peeked_ = 0; + while (nbuf < needed) { + size_t length; + const char* src = reader_->Peek(&length); + if (length == 0) return false; + uint32 to_add = min(needed - nbuf, length); + memcpy(scratch_ + nbuf, src, to_add); + nbuf += to_add; + reader_->Skip(to_add); + } + assert(nbuf == needed); + ip_ = scratch_; + ip_limit_ = scratch_ + needed; + } else if (nbuf < 5) { + // Have enough bytes, but move into scratch_ so that we do not + // read past end of input + memmove(scratch_, ip, nbuf); + reader_->Skip(peeked_); // All peeked bytes are used up + peeked_ = 0; + ip_ = scratch_; + ip_limit_ = scratch_ + nbuf; + } else { + // Pass pointer to buffer returned by reader_. + ip_ = ip; + } + return true; +} + +template +static bool InternalUncompress(Source* r, + Writer* writer, + uint32 max_len) { + // Read the uncompressed length from the front of the compressed input + SnappyDecompressor decompressor(r); + uint32 uncompressed_len = 0; + if (!decompressor.ReadUncompressedLength(&uncompressed_len)) return false; + return InternalUncompressAllTags( + &decompressor, writer, uncompressed_len, max_len); +} + +template +static bool InternalUncompressAllTags(SnappyDecompressor* decompressor, + Writer* writer, + uint32 uncompressed_len, + uint32 max_len) { + // Protect against possible DoS attack + if (static_cast(uncompressed_len) > max_len) { + return false; + } + + writer->SetExpectedLength(uncompressed_len); + + // Process the entire input + decompressor->DecompressAllTags(writer); + return (decompressor->eof() && writer->CheckLength()); +} + +bool GetUncompressedLength(Source* source, uint32* result) { + SnappyDecompressor decompressor(source); + return decompressor.ReadUncompressedLength(result); +} + +size_t Compress(Source* reader, Sink* writer) { + size_t written = 0; + size_t N = reader->Available(); + char ulength[Varint::kMax32]; + char* p = Varint::Encode32(ulength, N); + writer->Append(ulength, p-ulength); + written += (p - ulength); + + internal::WorkingMemory wmem; + char* scratch = NULL; + char* scratch_output = NULL; + + while (N > 0) { + // Get next block to compress (without copying if possible) + size_t fragment_size; + const char* fragment = reader->Peek(&fragment_size); + assert(fragment_size != 0); // premature end of input + const size_t num_to_read = min(N, kBlockSize); + size_t bytes_read = fragment_size; + + size_t pending_advance = 0; + if (bytes_read >= num_to_read) { + // Buffer returned by reader is large enough + pending_advance = num_to_read; + fragment_size = num_to_read; + } else { + // Read into scratch buffer + if (scratch == NULL) { + // If this is the last iteration, we want to allocate N bytes + // of space, otherwise the max possible kBlockSize space. + // num_to_read contains exactly the correct value + scratch = new char[num_to_read]; + } + memcpy(scratch, fragment, bytes_read); + reader->Skip(bytes_read); + + while (bytes_read < num_to_read) { + fragment = reader->Peek(&fragment_size); + size_t n = min(fragment_size, num_to_read - bytes_read); + memcpy(scratch + bytes_read, fragment, n); + bytes_read += n; + reader->Skip(n); + } + assert(bytes_read == num_to_read); + fragment = scratch; + fragment_size = num_to_read; + } + assert(fragment_size == num_to_read); + + // Get encoding table for compression + int table_size; + uint16* table = wmem.GetHashTable(num_to_read, &table_size); + + // Compress input_fragment and append to dest + const int max_output = MaxCompressedLength(num_to_read); + + // Need a scratch buffer for the output, in case the byte sink doesn't + // have room for us directly. + if (scratch_output == NULL) { + scratch_output = new char[max_output]; + } else { + // Since we encode kBlockSize regions followed by a region + // which is <= kBlockSize in length, a previously allocated + // scratch_output[] region is big enough for this iteration. + } + char* dest = writer->GetAppendBuffer(max_output, scratch_output); + char* end = internal::CompressFragment(fragment, fragment_size, + dest, table, table_size); + writer->Append(dest, end - dest); + written += (end - dest); + + N -= num_to_read; + reader->Skip(pending_advance); + } + + delete[] scratch; + delete[] scratch_output; + + return written; +} + +// ----------------------------------------------------------------------- +// Flat array interfaces +// ----------------------------------------------------------------------- + +// A type that writes to a flat array. +// Note that this is not a "ByteSink", but a type that matches the +// Writer template argument to SnappyDecompressor::DecompressAllTags(). +class SnappyArrayWriter { + private: + char* base_; + char* op_; + char* op_limit_; + + public: + inline explicit SnappyArrayWriter(char* dst) + : base_(dst), + op_(dst) { + } + + inline void SetExpectedLength(size_t len) { + op_limit_ = op_ + len; + } + + inline bool CheckLength() const { + return op_ == op_limit_; + } + + inline bool Append(const char* ip, size_t len) { + char* op = op_; + const size_t space_left = op_limit_ - op; + if (space_left < len) { + return false; + } + memcpy(op, ip, len); + op_ = op + len; + return true; + } + + inline bool TryFastAppend(const char* ip, size_t available, size_t len) { + char* op = op_; + const size_t space_left = op_limit_ - op; + if (len <= 16 && available >= 16 && space_left >= 16) { + // Fast path, used for the majority (about 95%) of invocations. + UnalignedCopy64(ip, op); + UnalignedCopy64(ip + 8, op + 8); + op_ = op + len; + return true; + } else { + return false; + } + } + + inline bool AppendFromSelf(size_t offset, size_t len) { + char* op = op_; + const size_t space_left = op_limit_ - op; + + if (op - base_ <= offset - 1u) { // -1u catches offset==0 + return false; + } + if (len <= 16 && offset >= 8 && space_left >= 16) { + // Fast path, used for the majority (70-80%) of dynamic invocations. + UnalignedCopy64(op - offset, op); + UnalignedCopy64(op - offset + 8, op + 8); + } else { + if (space_left >= len + kMaxIncrementCopyOverflow) { + IncrementalCopyFastPath(op - offset, op, len); + } else { + if (space_left < len) { + return false; + } + IncrementalCopy(op - offset, op, len); + } + } + + op_ = op + len; + return true; + } +}; + +bool RawUncompress(const char* compressed, size_t n, char* uncompressed) { + ByteArraySource reader(compressed, n); + return RawUncompress(&reader, uncompressed); +} + +bool RawUncompress(Source* compressed, char* uncompressed) { + SnappyArrayWriter output(uncompressed); + return InternalUncompress(compressed, &output, kuint32max); +} + +bool Uncompress(const char* compressed, size_t n, string* uncompressed) { + size_t ulength; + if (!GetUncompressedLength(compressed, n, &ulength)) { + return false; + } + // Protect against possible DoS attack + if ((static_cast(ulength) + uncompressed->size()) > + uncompressed->max_size()) { + return false; + } + STLStringResizeUninitialized(uncompressed, ulength); + return RawUncompress(compressed, n, string_as_array(uncompressed)); +} + + +// A Writer that drops everything on the floor and just does validation +class SnappyDecompressionValidator { + private: + size_t expected_; + size_t produced_; + + public: + inline SnappyDecompressionValidator() : produced_(0) { } + inline void SetExpectedLength(size_t len) { + expected_ = len; + } + inline bool CheckLength() const { + return expected_ == produced_; + } + inline bool Append(const char* ip, size_t len) { + produced_ += len; + return produced_ <= expected_; + } + inline bool TryFastAppend(const char* ip, size_t available, size_t length) { + return false; + } + inline bool AppendFromSelf(size_t offset, size_t len) { + if (produced_ <= offset - 1u) return false; // -1u catches offset==0 + produced_ += len; + return produced_ <= expected_; + } +}; + +bool IsValidCompressedBuffer(const char* compressed, size_t n) { + ByteArraySource reader(compressed, n); + SnappyDecompressionValidator writer; + return InternalUncompress(&reader, &writer, kuint32max); +} + +void RawCompress(const char* input, + size_t input_length, + char* compressed, + size_t* compressed_length) { + ByteArraySource reader(input, input_length); + UncheckedByteArraySink writer(compressed); + Compress(&reader, &writer); + + // Compute how many bytes were added + *compressed_length = (writer.CurrentDestination() - compressed); +} + +size_t Compress(const char* input, size_t input_length, string* compressed) { + // Pre-grow the buffer to the max length of the compressed output + compressed->resize(MaxCompressedLength(input_length)); + + size_t compressed_length; + RawCompress(input, input_length, string_as_array(compressed), + &compressed_length); + compressed->resize(compressed_length); + return compressed_length; +} + + +} // end namespace snappy + diff --git a/chromium/third_party/snappy/src/snappy.h b/chromium/third_party/snappy/src/snappy.h new file mode 100644 index 00000000000..03ef6ce5ba1 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy.h @@ -0,0 +1,163 @@ +// Copyright 2005 and onwards Google Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// A light-weight compression algorithm. It is designed for speed of +// compression and decompression, rather than for the utmost in space +// savings. +// +// For getting better compression ratios when you are compressing data +// with long repeated sequences or compressing data that is similar to +// other data, while still compressing fast, you might look at first +// using BMDiff and then compressing the output of BMDiff with +// Snappy. + +#ifndef UTIL_SNAPPY_SNAPPY_H__ +#define UTIL_SNAPPY_SNAPPY_H__ + +#include +#include + +#include "snappy-stubs-public.h" + +namespace snappy { + class Source; + class Sink; + + // ------------------------------------------------------------------------ + // Generic compression/decompression routines. + // ------------------------------------------------------------------------ + + // Compress the bytes read from "*source" and append to "*sink". Return the + // number of bytes written. + size_t Compress(Source* source, Sink* sink); + + // Find the uncompressed length of the given stream, as given by the header. + // Note that the true length could deviate from this; the stream could e.g. + // be truncated. + // + // Also note that this leaves "*source" in a state that is unsuitable for + // further operations, such as RawUncompress(). You will need to rewind + // or recreate the source yourself before attempting any further calls. + bool GetUncompressedLength(Source* source, uint32* result); + + // ------------------------------------------------------------------------ + // Higher-level string based routines (should be sufficient for most users) + // ------------------------------------------------------------------------ + + // Sets "*output" to the compressed version of "input[0,input_length-1]". + // Original contents of *output are lost. + // + // REQUIRES: "input[]" is not an alias of "*output". + size_t Compress(const char* input, size_t input_length, string* output); + + // Decompresses "compressed[0,compressed_length-1]" to "*uncompressed". + // Original contents of "*uncompressed" are lost. + // + // REQUIRES: "compressed[]" is not an alias of "*uncompressed". + // + // returns false if the message is corrupted and could not be decompressed + bool Uncompress(const char* compressed, size_t compressed_length, + string* uncompressed); + + + // ------------------------------------------------------------------------ + // Lower-level character array based routines. May be useful for + // efficiency reasons in certain circumstances. + // ------------------------------------------------------------------------ + + // REQUIRES: "compressed" must point to an area of memory that is at + // least "MaxCompressedLength(input_length)" bytes in length. + // + // Takes the data stored in "input[0..input_length]" and stores + // it in the array pointed to by "compressed". + // + // "*compressed_length" is set to the length of the compressed output. + // + // Example: + // char* output = new char[snappy::MaxCompressedLength(input_length)]; + // size_t output_length; + // RawCompress(input, input_length, output, &output_length); + // ... Process(output, output_length) ... + // delete [] output; + void RawCompress(const char* input, + size_t input_length, + char* compressed, + size_t* compressed_length); + + // Given data in "compressed[0..compressed_length-1]" generated by + // calling the Snappy::Compress routine, this routine + // stores the uncompressed data to + // uncompressed[0..GetUncompressedLength(compressed)-1] + // returns false if the message is corrupted and could not be decrypted + bool RawUncompress(const char* compressed, size_t compressed_length, + char* uncompressed); + + // Given data from the byte source 'compressed' generated by calling + // the Snappy::Compress routine, this routine stores the uncompressed + // data to + // uncompressed[0..GetUncompressedLength(compressed,compressed_length)-1] + // returns false if the message is corrupted and could not be decrypted + bool RawUncompress(Source* compressed, char* uncompressed); + + // Returns the maximal size of the compressed representation of + // input data that is "source_bytes" bytes in length; + size_t MaxCompressedLength(size_t source_bytes); + + // REQUIRES: "compressed[]" was produced by RawCompress() or Compress() + // Returns true and stores the length of the uncompressed data in + // *result normally. Returns false on parsing error. + // This operation takes O(1) time. + bool GetUncompressedLength(const char* compressed, size_t compressed_length, + size_t* result); + + // Returns true iff the contents of "compressed[]" can be uncompressed + // successfully. Does not return the uncompressed data. Takes + // time proportional to compressed_length, but is usually at least + // a factor of four faster than actual decompression. + bool IsValidCompressedBuffer(const char* compressed, + size_t compressed_length); + + // The size of a compression block. Note that many parts of the compression + // code assumes that kBlockSize <= 65536; in particular, the hash table + // can only store 16-bit offsets, and EmitCopy() also assumes the offset + // is 65535 bytes or less. Note also that if you change this, it will + // affect the framing format (see framing_format.txt). + // + // Note that there might be older data around that is compressed with larger + // block sizes, so the decompression code should not rely on the + // non-existence of long backreferences. + static const int kBlockLog = 16; + static const size_t kBlockSize = 1 << kBlockLog; + + static const int kMaxHashTableBits = 14; + static const size_t kMaxHashTableSize = 1 << kMaxHashTableBits; + +} // end namespace snappy + + +#endif // UTIL_SNAPPY_SNAPPY_H__ diff --git a/chromium/third_party/snappy/src/snappy_unittest.cc b/chromium/third_party/snappy/src/snappy_unittest.cc new file mode 100644 index 00000000000..59c108f4c83 --- /dev/null +++ b/chromium/third_party/snappy/src/snappy_unittest.cc @@ -0,0 +1,1164 @@ +// Copyright 2005 and onwards Google Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + + +#include +#include +#include + +#include "snappy.h" +#include "snappy-internal.h" +#include "snappy-test.h" +#include "snappy-sinksource.h" + +DEFINE_int32(start_len, -1, + "Starting prefix size for testing (-1: just full file contents)"); +DEFINE_int32(end_len, -1, + "Starting prefix size for testing (-1: just full file contents)"); +DEFINE_int32(bytes, 10485760, + "How many bytes to compress/uncompress per file for timing"); + +DEFINE_bool(zlib, false, + "Run zlib compression (http://www.zlib.net)"); +DEFINE_bool(lzo, false, + "Run LZO compression (http://www.oberhumer.com/opensource/lzo/)"); +DEFINE_bool(quicklz, false, + "Run quickLZ compression (http://www.quicklz.com/)"); +DEFINE_bool(liblzf, false, + "Run libLZF compression " + "(http://www.goof.com/pcg/marc/liblzf.html)"); +DEFINE_bool(fastlz, false, + "Run FastLZ compression (http://www.fastlz.org/"); +DEFINE_bool(snappy, true, "Run snappy compression"); + + +DEFINE_bool(write_compressed, false, + "Write compressed versions of each file to .comp"); +DEFINE_bool(write_uncompressed, false, + "Write uncompressed versions of each file to .uncomp"); + +namespace snappy { + + +#ifdef HAVE_FUNC_MMAP + +// To test against code that reads beyond its input, this class copies a +// string to a newly allocated group of pages, the last of which +// is made unreadable via mprotect. Note that we need to allocate the +// memory with mmap(), as POSIX allows mprotect() only on memory allocated +// with mmap(), and some malloc/posix_memalign implementations expect to +// be able to read previously allocated memory while doing heap allocations. +class DataEndingAtUnreadablePage { + public: + explicit DataEndingAtUnreadablePage(const string& s) { + const size_t page_size = getpagesize(); + const size_t size = s.size(); + // Round up space for string to a multiple of page_size. + size_t space_for_string = (size + page_size - 1) & ~(page_size - 1); + alloc_size_ = space_for_string + page_size; + mem_ = mmap(NULL, alloc_size_, + PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + CHECK_NE(MAP_FAILED, mem_); + protected_page_ = reinterpret_cast(mem_) + space_for_string; + char* dst = protected_page_ - size; + memcpy(dst, s.data(), size); + data_ = dst; + size_ = size; + // Make guard page unreadable. + CHECK_EQ(0, mprotect(protected_page_, page_size, PROT_NONE)); + } + + ~DataEndingAtUnreadablePage() { + // Undo the mprotect. + CHECK_EQ(0, mprotect(protected_page_, getpagesize(), PROT_READ|PROT_WRITE)); + CHECK_EQ(0, munmap(mem_, alloc_size_)); + } + + const char* data() const { return data_; } + size_t size() const { return size_; } + + private: + size_t alloc_size_; + void* mem_; + char* protected_page_; + const char* data_; + size_t size_; +}; + +#else // HAVE_FUNC_MMAP + +// Fallback for systems without mmap. +typedef string DataEndingAtUnreadablePage; + +#endif + +enum CompressorType { + ZLIB, LZO, LIBLZF, QUICKLZ, FASTLZ, SNAPPY +}; + +const char* names[] = { + "ZLIB", "LZO", "LIBLZF", "QUICKLZ", "FASTLZ", "SNAPPY" +}; + +static size_t MinimumRequiredOutputSpace(size_t input_size, + CompressorType comp) { + switch (comp) { +#ifdef ZLIB_VERSION + case ZLIB: + return ZLib::MinCompressbufSize(input_size); +#endif // ZLIB_VERSION + +#ifdef LZO_VERSION + case LZO: + return input_size + input_size/64 + 16 + 3; +#endif // LZO_VERSION + +#ifdef LZF_VERSION + case LIBLZF: + return input_size; +#endif // LZF_VERSION + +#ifdef QLZ_VERSION_MAJOR + case QUICKLZ: + return input_size + 36000; // 36000 is used for scratch. +#endif // QLZ_VERSION_MAJOR + +#ifdef FASTLZ_VERSION + case FASTLZ: + return max(static_cast(ceil(input_size * 1.05)), 66); +#endif // FASTLZ_VERSION + + case SNAPPY: + return snappy::MaxCompressedLength(input_size); + + default: + LOG(FATAL) << "Unknown compression type number " << comp; + } +} + +// Returns true if we successfully compressed, false otherwise. +// +// If compressed_is_preallocated is set, do not resize the compressed buffer. +// This is typically what you want for a benchmark, in order to not spend +// time in the memory allocator. If you do set this flag, however, +// "compressed" must be preinitialized to at least MinCompressbufSize(comp) +// number of bytes, and may contain junk bytes at the end after return. +static bool Compress(const char* input, size_t input_size, CompressorType comp, + string* compressed, bool compressed_is_preallocated) { + if (!compressed_is_preallocated) { + compressed->resize(MinimumRequiredOutputSpace(input_size, comp)); + } + + switch (comp) { +#ifdef ZLIB_VERSION + case ZLIB: { + ZLib zlib; + uLongf destlen = compressed->size(); + int ret = zlib.Compress( + reinterpret_cast(string_as_array(compressed)), + &destlen, + reinterpret_cast(input), + input_size); + CHECK_EQ(Z_OK, ret); + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + return true; + } +#endif // ZLIB_VERSION + +#ifdef LZO_VERSION + case LZO: { + unsigned char* mem = new unsigned char[LZO1X_1_15_MEM_COMPRESS]; + lzo_uint destlen; + int ret = lzo1x_1_15_compress( + reinterpret_cast(input), + input_size, + reinterpret_cast(string_as_array(compressed)), + &destlen, + mem); + CHECK_EQ(LZO_E_OK, ret); + delete[] mem; + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + break; + } +#endif // LZO_VERSION + +#ifdef LZF_VERSION + case LIBLZF: { + int destlen = lzf_compress(input, + input_size, + string_as_array(compressed), + input_size); + if (destlen == 0) { + // lzf *can* cause lots of blowup when compressing, so they + // recommend to limit outsize to insize, and just not compress + // if it's bigger. Ideally, we'd just swap input and output. + compressed->assign(input, input_size); + destlen = input_size; + } + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + break; + } +#endif // LZF_VERSION + +#ifdef QLZ_VERSION_MAJOR + case QUICKLZ: { + qlz_state_compress *state_compress = new qlz_state_compress; + int destlen = qlz_compress(input, + string_as_array(compressed), + input_size, + state_compress); + delete state_compress; + CHECK_NE(0, destlen); + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + break; + } +#endif // QLZ_VERSION_MAJOR + +#ifdef FASTLZ_VERSION + case FASTLZ: { + // Use level 1 compression since we mostly care about speed. + int destlen = fastlz_compress_level( + 1, + input, + input_size, + string_as_array(compressed)); + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + CHECK_NE(destlen, 0); + break; + } +#endif // FASTLZ_VERSION + + case SNAPPY: { + size_t destlen; + snappy::RawCompress(input, input_size, + string_as_array(compressed), + &destlen); + CHECK_LE(destlen, snappy::MaxCompressedLength(input_size)); + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + break; + } + + + default: { + return false; // the asked-for library wasn't compiled in + } + } + return true; +} + +static bool Uncompress(const string& compressed, CompressorType comp, + int size, string* output) { + switch (comp) { +#ifdef ZLIB_VERSION + case ZLIB: { + output->resize(size); + ZLib zlib; + uLongf destlen = output->size(); + int ret = zlib.Uncompress( + reinterpret_cast(string_as_array(output)), + &destlen, + reinterpret_cast(compressed.data()), + compressed.size()); + CHECK_EQ(Z_OK, ret); + CHECK_EQ(static_cast(size), destlen); + break; + } +#endif // ZLIB_VERSION + +#ifdef LZO_VERSION + case LZO: { + output->resize(size); + lzo_uint destlen; + int ret = lzo1x_decompress( + reinterpret_cast(compressed.data()), + compressed.size(), + reinterpret_cast(string_as_array(output)), + &destlen, + NULL); + CHECK_EQ(LZO_E_OK, ret); + CHECK_EQ(static_cast(size), destlen); + break; + } +#endif // LZO_VERSION + +#ifdef LZF_VERSION + case LIBLZF: { + output->resize(size); + int destlen = lzf_decompress(compressed.data(), + compressed.size(), + string_as_array(output), + output->size()); + if (destlen == 0) { + // This error probably means we had decided not to compress, + // and thus have stored input in output directly. + output->assign(compressed.data(), compressed.size()); + destlen = compressed.size(); + } + CHECK_EQ(destlen, size); + break; + } +#endif // LZF_VERSION + +#ifdef QLZ_VERSION_MAJOR + case QUICKLZ: { + output->resize(size); + qlz_state_decompress *state_decompress = new qlz_state_decompress; + int destlen = qlz_decompress(compressed.data(), + string_as_array(output), + state_decompress); + delete state_decompress; + CHECK_EQ(destlen, size); + break; + } +#endif // QLZ_VERSION_MAJOR + +#ifdef FASTLZ_VERSION + case FASTLZ: { + output->resize(size); + int destlen = fastlz_decompress(compressed.data(), + compressed.length(), + string_as_array(output), + size); + CHECK_EQ(destlen, size); + break; + } +#endif // FASTLZ_VERSION + + case SNAPPY: { + snappy::RawUncompress(compressed.data(), compressed.size(), + string_as_array(output)); + break; + } + + + default: { + return false; // the asked-for library wasn't compiled in + } + } + return true; +} + +static void Measure(const char* data, + size_t length, + CompressorType comp, + int repeats, + int block_size) { + // Run tests a few time and pick median running times + static const int kRuns = 5; + double ctime[kRuns]; + double utime[kRuns]; + int compressed_size = 0; + + { + // Chop the input into blocks + int num_blocks = (length + block_size - 1) / block_size; + vector input(num_blocks); + vector input_length(num_blocks); + vector compressed(num_blocks); + vector output(num_blocks); + for (int b = 0; b < num_blocks; b++) { + int input_start = b * block_size; + int input_limit = min((b+1)*block_size, length); + input[b] = data+input_start; + input_length[b] = input_limit-input_start; + + // Pre-grow the output buffer so we don't measure string append time. + compressed[b].resize(MinimumRequiredOutputSpace(block_size, comp)); + } + + // First, try one trial compression to make sure the code is compiled in + if (!Compress(input[0], input_length[0], comp, &compressed[0], true)) { + LOG(WARNING) << "Skipping " << names[comp] << ": " + << "library not compiled in"; + return; + } + + for (int run = 0; run < kRuns; run++) { + CycleTimer ctimer, utimer; + + for (int b = 0; b < num_blocks; b++) { + // Pre-grow the output buffer so we don't measure string append time. + compressed[b].resize(MinimumRequiredOutputSpace(block_size, comp)); + } + + ctimer.Start(); + for (int b = 0; b < num_blocks; b++) + for (int i = 0; i < repeats; i++) + Compress(input[b], input_length[b], comp, &compressed[b], true); + ctimer.Stop(); + + // Compress once more, with resizing, so we don't leave junk + // at the end that will confuse the decompressor. + for (int b = 0; b < num_blocks; b++) { + Compress(input[b], input_length[b], comp, &compressed[b], false); + } + + for (int b = 0; b < num_blocks; b++) { + output[b].resize(input_length[b]); + } + + utimer.Start(); + for (int i = 0; i < repeats; i++) + for (int b = 0; b < num_blocks; b++) + Uncompress(compressed[b], comp, input_length[b], &output[b]); + utimer.Stop(); + + ctime[run] = ctimer.Get(); + utime[run] = utimer.Get(); + } + + compressed_size = 0; + for (int i = 0; i < compressed.size(); i++) { + compressed_size += compressed[i].size(); + } + } + + sort(ctime, ctime + kRuns); + sort(utime, utime + kRuns); + const int med = kRuns/2; + + float comp_rate = (length / ctime[med]) * repeats / 1048576.0; + float uncomp_rate = (length / utime[med]) * repeats / 1048576.0; + string x = names[comp]; + x += ":"; + string urate = (uncomp_rate >= 0) + ? StringPrintf("%.1f", uncomp_rate) + : string("?"); + printf("%-7s [b %dM] bytes %6d -> %6d %4.1f%% " + "comp %5.1f MB/s uncomp %5s MB/s\n", + x.c_str(), + block_size/(1<<20), + static_cast(length), static_cast(compressed_size), + (compressed_size * 100.0) / max(1, length), + comp_rate, + urate.c_str()); +} + + +static int VerifyString(const string& input) { + string compressed; + DataEndingAtUnreadablePage i(input); + const size_t written = snappy::Compress(i.data(), i.size(), &compressed); + CHECK_EQ(written, compressed.size()); + CHECK_LE(compressed.size(), + snappy::MaxCompressedLength(input.size())); + CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + + string uncompressed; + DataEndingAtUnreadablePage c(compressed); + CHECK(snappy::Uncompress(c.data(), c.size(), &uncompressed)); + CHECK_EQ(uncompressed, input); + return uncompressed.size(); +} + + +// Test that data compressed by a compressor that does not +// obey block sizes is uncompressed properly. +static void VerifyNonBlockedCompression(const string& input) { + if (input.length() > snappy::kBlockSize) { + // We cannot test larger blocks than the maximum block size, obviously. + return; + } + + string prefix; + Varint::Append32(&prefix, input.size()); + + // Setup compression table + snappy::internal::WorkingMemory wmem; + int table_size; + uint16* table = wmem.GetHashTable(input.size(), &table_size); + + // Compress entire input in one shot + string compressed; + compressed += prefix; + compressed.resize(prefix.size()+snappy::MaxCompressedLength(input.size())); + char* dest = string_as_array(&compressed) + prefix.size(); + char* end = snappy::internal::CompressFragment(input.data(), input.size(), + dest, table, table_size); + compressed.resize(end - compressed.data()); + + // Uncompress into string + string uncomp_str; + CHECK(snappy::Uncompress(compressed.data(), compressed.size(), &uncomp_str)); + CHECK_EQ(uncomp_str, input); + +} + +// Expand the input so that it is at least K times as big as block size +static string Expand(const string& input) { + static const int K = 3; + string data = input; + while (data.size() < K * snappy::kBlockSize) { + data += input; + } + return data; +} + +static int Verify(const string& input) { + VLOG(1) << "Verifying input of size " << input.size(); + + // Compress using string based routines + const int result = VerifyString(input); + + + VerifyNonBlockedCompression(input); + if (!input.empty()) { + VerifyNonBlockedCompression(Expand(input)); + } + + + return result; +} + +// This test checks to ensure that snappy doesn't coredump if it gets +// corrupted data. + +static bool IsValidCompressedBuffer(const string& c) { + return snappy::IsValidCompressedBuffer(c.data(), c.size()); +} +static bool Uncompress(const string& c, string* u) { + return snappy::Uncompress(c.data(), c.size(), u); +} + +TYPED_TEST(CorruptedTest, VerifyCorrupted) { + string source = "making sure we don't crash with corrupted input"; + VLOG(1) << source; + string dest; + TypeParam uncmp; + snappy::Compress(source.data(), source.size(), &dest); + + // Mess around with the data. It's hard to simulate all possible + // corruptions; this is just one example ... + CHECK_GT(dest.size(), 3); + dest[1]--; + dest[3]++; + // this really ought to fail. + CHECK(!IsValidCompressedBuffer(TypeParam(dest))); + CHECK(!Uncompress(TypeParam(dest), &uncmp)); + + // This is testing for a security bug - a buffer that decompresses to 100k + // but we lie in the snappy header and only reserve 0 bytes of memory :) + source.resize(100000); + for (int i = 0; i < source.length(); ++i) { + source[i] = 'A'; + } + snappy::Compress(source.data(), source.size(), &dest); + dest[0] = dest[1] = dest[2] = dest[3] = 0; + CHECK(!IsValidCompressedBuffer(TypeParam(dest))); + CHECK(!Uncompress(TypeParam(dest), &uncmp)); + + if (sizeof(void *) == 4) { + // Another security check; check a crazy big length can't DoS us with an + // over-allocation. + // Currently this is done only for 32-bit builds. On 64-bit builds, + // where 3 GB might be an acceptable allocation size, Uncompress() + // attempts to decompress, and sometimes causes the test to run out of + // memory. + dest[0] = dest[1] = dest[2] = dest[3] = 0xff; + // This decodes to a really large size, i.e., about 3 GB. + dest[4] = 'k'; + CHECK(!IsValidCompressedBuffer(TypeParam(dest))); + CHECK(!Uncompress(TypeParam(dest), &uncmp)); + } else { + LOG(WARNING) << "Crazy decompression lengths not checked on 64-bit build"; + } + + // This decodes to about 2 MB; much smaller, but should still fail. + dest[0] = dest[1] = dest[2] = 0xff; + dest[3] = 0x00; + CHECK(!IsValidCompressedBuffer(TypeParam(dest))); + CHECK(!Uncompress(TypeParam(dest), &uncmp)); + + // try reading stuff in from a bad file. + for (int i = 1; i <= 3; ++i) { + string data = ReadTestDataFile(StringPrintf("baddata%d.snappy", i).c_str(), + 0); + string uncmp; + // check that we don't return a crazy length + size_t ulen; + CHECK(!snappy::GetUncompressedLength(data.data(), data.size(), &ulen) + || (ulen < (1<<20))); + uint32 ulen2; + snappy::ByteArraySource source(data.data(), data.size()); + CHECK(!snappy::GetUncompressedLength(&source, &ulen2) || + (ulen2 < (1<<20))); + CHECK(!IsValidCompressedBuffer(TypeParam(data))); + CHECK(!Uncompress(TypeParam(data), &uncmp)); + } +} + +// Helper routines to construct arbitrary compressed strings. +// These mirror the compression code in snappy.cc, but are copied +// here so that we can bypass some limitations in the how snappy.cc +// invokes these routines. +static void AppendLiteral(string* dst, const string& literal) { + if (literal.empty()) return; + int n = literal.size() - 1; + if (n < 60) { + // Fit length in tag byte + dst->push_back(0 | (n << 2)); + } else { + // Encode in upcoming bytes + char number[4]; + int count = 0; + while (n > 0) { + number[count++] = n & 0xff; + n >>= 8; + } + dst->push_back(0 | ((59+count) << 2)); + *dst += string(number, count); + } + *dst += literal; +} + +static void AppendCopy(string* dst, int offset, int length) { + while (length > 0) { + // Figure out how much to copy in one shot + int to_copy; + if (length >= 68) { + to_copy = 64; + } else if (length > 64) { + to_copy = 60; + } else { + to_copy = length; + } + length -= to_copy; + + if ((to_copy < 12) && (offset < 2048)) { + assert(to_copy-4 < 8); // Must fit in 3 bits + dst->push_back(1 | ((to_copy-4) << 2) | ((offset >> 8) << 5)); + dst->push_back(offset & 0xff); + } else if (offset < 65536) { + dst->push_back(2 | ((to_copy-1) << 2)); + dst->push_back(offset & 0xff); + dst->push_back(offset >> 8); + } else { + dst->push_back(3 | ((to_copy-1) << 2)); + dst->push_back(offset & 0xff); + dst->push_back((offset >> 8) & 0xff); + dst->push_back((offset >> 16) & 0xff); + dst->push_back((offset >> 24) & 0xff); + } + } +} + +TEST(Snappy, SimpleTests) { + Verify(""); + Verify("a"); + Verify("ab"); + Verify("abc"); + + Verify("aaaaaaa" + string(16, 'b') + string("aaaaa") + "abc"); + Verify("aaaaaaa" + string(256, 'b') + string("aaaaa") + "abc"); + Verify("aaaaaaa" + string(2047, 'b') + string("aaaaa") + "abc"); + Verify("aaaaaaa" + string(65536, 'b') + string("aaaaa") + "abc"); + Verify("abcaaaaaaa" + string(65536, 'b') + string("aaaaa") + "abc"); +} + +// Verify max blowup (lots of four-byte copies) +TEST(Snappy, MaxBlowup) { + string input; + for (int i = 0; i < 20000; i++) { + ACMRandom rnd(i); + uint32 bytes = static_cast(rnd.Next()); + input.append(reinterpret_cast(&bytes), sizeof(bytes)); + } + for (int i = 19999; i >= 0; i--) { + ACMRandom rnd(i); + uint32 bytes = static_cast(rnd.Next()); + input.append(reinterpret_cast(&bytes), sizeof(bytes)); + } + Verify(input); +} + +TEST(Snappy, RandomData) { + ACMRandom rnd(FLAGS_test_random_seed); + + const int num_ops = 20000; + for (int i = 0; i < num_ops; i++) { + if ((i % 1000) == 0) { + VLOG(0) << "Random op " << i << " of " << num_ops; + } + + string x; + int len = rnd.Uniform(4096); + if (i < 100) { + len = 65536 + rnd.Uniform(65536); + } + while (x.size() < len) { + int run_len = 1; + if (rnd.OneIn(10)) { + run_len = rnd.Skewed(8); + } + char c = (i < 100) ? rnd.Uniform(256) : rnd.Skewed(3); + while (run_len-- > 0 && x.size() < len) { + x += c; + } + } + + Verify(x); + } +} + +TEST(Snappy, FourByteOffset) { + // The new compressor cannot generate four-byte offsets since + // it chops up the input into 32KB pieces. So we hand-emit the + // copy manually. + + // The two fragments that make up the input string. + string fragment1 = "012345689abcdefghijklmnopqrstuvwxyz"; + string fragment2 = "some other string"; + + // How many times each fragment is emitted. + const int n1 = 2; + const int n2 = 100000 / fragment2.size(); + const int length = n1 * fragment1.size() + n2 * fragment2.size(); + + string compressed; + Varint::Append32(&compressed, length); + + AppendLiteral(&compressed, fragment1); + string src = fragment1; + for (int i = 0; i < n2; i++) { + AppendLiteral(&compressed, fragment2); + src += fragment2; + } + AppendCopy(&compressed, src.size(), fragment1.size()); + src += fragment1; + CHECK_EQ(length, src.size()); + + string uncompressed; + CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + CHECK(snappy::Uncompress(compressed.data(), compressed.size(), + &uncompressed)); + CHECK_EQ(uncompressed, src); +} + + +static bool CheckUncompressedLength(const string& compressed, + size_t* ulength) { + const bool result1 = snappy::GetUncompressedLength(compressed.data(), + compressed.size(), + ulength); + + snappy::ByteArraySource source(compressed.data(), compressed.size()); + uint32 length; + const bool result2 = snappy::GetUncompressedLength(&source, &length); + CHECK_EQ(result1, result2); + return result1; +} + +TEST(SnappyCorruption, TruncatedVarint) { + string compressed, uncompressed; + size_t ulength; + compressed.push_back('\xf0'); + CHECK(!CheckUncompressedLength(compressed, &ulength)); + CHECK(!snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + CHECK(!snappy::Uncompress(compressed.data(), compressed.size(), + &uncompressed)); +} + +TEST(SnappyCorruption, UnterminatedVarint) { + string compressed, uncompressed; + size_t ulength; + compressed.push_back(128); + compressed.push_back(128); + compressed.push_back(128); + compressed.push_back(128); + compressed.push_back(128); + compressed.push_back(10); + CHECK(!CheckUncompressedLength(compressed, &ulength)); + CHECK(!snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + CHECK(!snappy::Uncompress(compressed.data(), compressed.size(), + &uncompressed)); +} + +TEST(Snappy, ReadPastEndOfBuffer) { + // Check that we do not read past end of input + + // Make a compressed string that ends with a single-byte literal + string compressed; + Varint::Append32(&compressed, 1); + AppendLiteral(&compressed, "x"); + + string uncompressed; + DataEndingAtUnreadablePage c(compressed); + CHECK(snappy::Uncompress(c.data(), c.size(), &uncompressed)); + CHECK_EQ(uncompressed, string("x")); +} + +// Check for an infinite loop caused by a copy with offset==0 +TEST(Snappy, ZeroOffsetCopy) { + const char* compressed = "\x40\x12\x00\x00"; + // \x40 Length (must be > kMaxIncrementCopyOverflow) + // \x12\x00\x00 Copy with offset==0, length==5 + char uncompressed[100]; + EXPECT_FALSE(snappy::RawUncompress(compressed, 4, uncompressed)); +} + +TEST(Snappy, ZeroOffsetCopyValidation) { + const char* compressed = "\x05\x12\x00\x00"; + // \x05 Length + // \x12\x00\x00 Copy with offset==0, length==5 + EXPECT_FALSE(snappy::IsValidCompressedBuffer(compressed, 4)); +} + + +namespace { + +int TestFindMatchLength(const char* s1, const char *s2, unsigned length) { + return snappy::internal::FindMatchLength(s1, s2, s2 + length); +} + +} // namespace + +TEST(Snappy, FindMatchLength) { + // Exercise all different code paths through the function. + // 64-bit version: + + // Hit s1_limit in 64-bit loop, hit s1_limit in single-character loop. + EXPECT_EQ(6, TestFindMatchLength("012345", "012345", 6)); + EXPECT_EQ(11, TestFindMatchLength("01234567abc", "01234567abc", 11)); + + // Hit s1_limit in 64-bit loop, find a non-match in single-character loop. + EXPECT_EQ(9, TestFindMatchLength("01234567abc", "01234567axc", 9)); + + // Same, but edge cases. + EXPECT_EQ(11, TestFindMatchLength("01234567abc!", "01234567abc!", 11)); + EXPECT_EQ(11, TestFindMatchLength("01234567abc!", "01234567abc?", 11)); + + // Find non-match at once in first loop. + EXPECT_EQ(0, TestFindMatchLength("01234567xxxxxxxx", "?1234567xxxxxxxx", 16)); + EXPECT_EQ(1, TestFindMatchLength("01234567xxxxxxxx", "0?234567xxxxxxxx", 16)); + EXPECT_EQ(4, TestFindMatchLength("01234567xxxxxxxx", "01237654xxxxxxxx", 16)); + EXPECT_EQ(7, TestFindMatchLength("01234567xxxxxxxx", "0123456?xxxxxxxx", 16)); + + // Find non-match in first loop after one block. + EXPECT_EQ(8, TestFindMatchLength("abcdefgh01234567xxxxxxxx", + "abcdefgh?1234567xxxxxxxx", 24)); + EXPECT_EQ(9, TestFindMatchLength("abcdefgh01234567xxxxxxxx", + "abcdefgh0?234567xxxxxxxx", 24)); + EXPECT_EQ(12, TestFindMatchLength("abcdefgh01234567xxxxxxxx", + "abcdefgh01237654xxxxxxxx", 24)); + EXPECT_EQ(15, TestFindMatchLength("abcdefgh01234567xxxxxxxx", + "abcdefgh0123456?xxxxxxxx", 24)); + + // 32-bit version: + + // Short matches. + EXPECT_EQ(0, TestFindMatchLength("01234567", "?1234567", 8)); + EXPECT_EQ(1, TestFindMatchLength("01234567", "0?234567", 8)); + EXPECT_EQ(2, TestFindMatchLength("01234567", "01?34567", 8)); + EXPECT_EQ(3, TestFindMatchLength("01234567", "012?4567", 8)); + EXPECT_EQ(4, TestFindMatchLength("01234567", "0123?567", 8)); + EXPECT_EQ(5, TestFindMatchLength("01234567", "01234?67", 8)); + EXPECT_EQ(6, TestFindMatchLength("01234567", "012345?7", 8)); + EXPECT_EQ(7, TestFindMatchLength("01234567", "0123456?", 8)); + EXPECT_EQ(7, TestFindMatchLength("01234567", "0123456?", 7)); + EXPECT_EQ(7, TestFindMatchLength("01234567!", "0123456??", 7)); + + // Hit s1_limit in 32-bit loop, hit s1_limit in single-character loop. + EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd", "xxxxxxabcd", 10)); + EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd?", "xxxxxxabcd?", 10)); + EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcdef", "xxxxxxabcdef", 13)); + + // Same, but edge cases. + EXPECT_EQ(12, TestFindMatchLength("xxxxxx0123abc!", "xxxxxx0123abc!", 12)); + EXPECT_EQ(12, TestFindMatchLength("xxxxxx0123abc!", "xxxxxx0123abc?", 12)); + + // Hit s1_limit in 32-bit loop, find a non-match in single-character loop. + EXPECT_EQ(11, TestFindMatchLength("xxxxxx0123abc", "xxxxxx0123axc", 13)); + + // Find non-match at once in first loop. + EXPECT_EQ(6, TestFindMatchLength("xxxxxx0123xxxxxxxx", + "xxxxxx?123xxxxxxxx", 18)); + EXPECT_EQ(7, TestFindMatchLength("xxxxxx0123xxxxxxxx", + "xxxxxx0?23xxxxxxxx", 18)); + EXPECT_EQ(8, TestFindMatchLength("xxxxxx0123xxxxxxxx", + "xxxxxx0132xxxxxxxx", 18)); + EXPECT_EQ(9, TestFindMatchLength("xxxxxx0123xxxxxxxx", + "xxxxxx012?xxxxxxxx", 18)); + + // Same, but edge cases. + EXPECT_EQ(6, TestFindMatchLength("xxxxxx0123", "xxxxxx?123", 10)); + EXPECT_EQ(7, TestFindMatchLength("xxxxxx0123", "xxxxxx0?23", 10)); + EXPECT_EQ(8, TestFindMatchLength("xxxxxx0123", "xxxxxx0132", 10)); + EXPECT_EQ(9, TestFindMatchLength("xxxxxx0123", "xxxxxx012?", 10)); + + // Find non-match in first loop after one block. + EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd0123xx", + "xxxxxxabcd?123xx", 16)); + EXPECT_EQ(11, TestFindMatchLength("xxxxxxabcd0123xx", + "xxxxxxabcd0?23xx", 16)); + EXPECT_EQ(12, TestFindMatchLength("xxxxxxabcd0123xx", + "xxxxxxabcd0132xx", 16)); + EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcd0123xx", + "xxxxxxabcd012?xx", 16)); + + // Same, but edge cases. + EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd?123", 14)); + EXPECT_EQ(11, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd0?23", 14)); + EXPECT_EQ(12, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd0132", 14)); + EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd012?", 14)); +} + +TEST(Snappy, FindMatchLengthRandom) { + const int kNumTrials = 10000; + const int kTypicalLength = 10; + ACMRandom rnd(FLAGS_test_random_seed); + + for (int i = 0; i < kNumTrials; i++) { + string s, t; + char a = rnd.Rand8(); + char b = rnd.Rand8(); + while (!rnd.OneIn(kTypicalLength)) { + s.push_back(rnd.OneIn(2) ? a : b); + t.push_back(rnd.OneIn(2) ? a : b); + } + DataEndingAtUnreadablePage u(s); + DataEndingAtUnreadablePage v(t); + int matched = snappy::internal::FindMatchLength( + u.data(), v.data(), v.data() + t.size()); + if (matched == t.size()) { + EXPECT_EQ(s, t); + } else { + EXPECT_NE(s[matched], t[matched]); + for (int j = 0; j < matched; j++) { + EXPECT_EQ(s[j], t[j]); + } + } + } +} + + +static void CompressFile(const char* fname) { + string fullinput; + file::GetContents(fname, &fullinput, file::Defaults()).CheckSuccess(); + + string compressed; + Compress(fullinput.data(), fullinput.size(), SNAPPY, &compressed, false); + + file::SetContents(string(fname).append(".comp"), compressed, file::Defaults()) + .CheckSuccess(); +} + +static void UncompressFile(const char* fname) { + string fullinput; + file::GetContents(fname, &fullinput, file::Defaults()).CheckSuccess(); + + size_t uncompLength; + CHECK(CheckUncompressedLength(fullinput, &uncompLength)); + + string uncompressed; + uncompressed.resize(uncompLength); + CHECK(snappy::Uncompress(fullinput.data(), fullinput.size(), &uncompressed)); + + file::SetContents(string(fname).append(".uncomp"), uncompressed, + file::Defaults()).CheckSuccess(); +} + +static void MeasureFile(const char* fname) { + string fullinput; + file::GetContents(fname, &fullinput, file::Defaults()).CheckSuccess(); + printf("%-40s :\n", fname); + + int start_len = (FLAGS_start_len < 0) ? fullinput.size() : FLAGS_start_len; + int end_len = fullinput.size(); + if (FLAGS_end_len >= 0) { + end_len = min(fullinput.size(), FLAGS_end_len); + } + for (int len = start_len; len <= end_len; len++) { + const char* const input = fullinput.data(); + int repeats = (FLAGS_bytes + len) / (len + 1); + if (FLAGS_zlib) Measure(input, len, ZLIB, repeats, 1024<<10); + if (FLAGS_lzo) Measure(input, len, LZO, repeats, 1024<<10); + if (FLAGS_liblzf) Measure(input, len, LIBLZF, repeats, 1024<<10); + if (FLAGS_quicklz) Measure(input, len, QUICKLZ, repeats, 1024<<10); + if (FLAGS_fastlz) Measure(input, len, FASTLZ, repeats, 1024<<10); + if (FLAGS_snappy) Measure(input, len, SNAPPY, repeats, 4096<<10); + + // For block-size based measurements + if (0 && FLAGS_snappy) { + Measure(input, len, SNAPPY, repeats, 8<<10); + Measure(input, len, SNAPPY, repeats, 16<<10); + Measure(input, len, SNAPPY, repeats, 32<<10); + Measure(input, len, SNAPPY, repeats, 64<<10); + Measure(input, len, SNAPPY, repeats, 256<<10); + Measure(input, len, SNAPPY, repeats, 1024<<10); + } + } +} + +static struct { + const char* label; + const char* filename; + size_t size_limit; +} files[] = { + { "html", "html", 0 }, + { "urls", "urls.10K", 0 }, + { "jpg", "house.jpg", 0 }, + { "jpg_200", "house.jpg", 200 }, + { "pdf", "mapreduce-osdi-1.pdf", 0 }, + { "html4", "html_x_4", 0 }, + { "cp", "cp.html", 0 }, + { "c", "fields.c", 0 }, + { "lsp", "grammar.lsp", 0 }, + { "xls", "kennedy.xls", 0 }, + { "xls_200", "kennedy.xls", 200 }, + { "txt1", "alice29.txt", 0 }, + { "txt2", "asyoulik.txt", 0 }, + { "txt3", "lcet10.txt", 0 }, + { "txt4", "plrabn12.txt", 0 }, + { "bin", "ptt5", 0 }, + { "bin_200", "ptt5", 200 }, + { "sum", "sum", 0 }, + { "man", "xargs.1", 0 }, + { "pb", "geo.protodata", 0 }, + { "gaviota", "kppkn.gtb", 0 }, +}; + +static void BM_UFlat(int iters, int arg) { + StopBenchmarkTiming(); + + // Pick file to process based on "arg" + CHECK_GE(arg, 0); + CHECK_LT(arg, ARRAYSIZE(files)); + string contents = ReadTestDataFile(files[arg].filename, + files[arg].size_limit); + + string zcontents; + snappy::Compress(contents.data(), contents.size(), &zcontents); + char* dst = new char[contents.size()]; + + SetBenchmarkBytesProcessed(static_cast(iters) * + static_cast(contents.size())); + SetBenchmarkLabel(files[arg].label); + StartBenchmarkTiming(); + while (iters-- > 0) { + CHECK(snappy::RawUncompress(zcontents.data(), zcontents.size(), dst)); + } + StopBenchmarkTiming(); + + delete[] dst; +} +BENCHMARK(BM_UFlat)->DenseRange(0, ARRAYSIZE(files) - 1); + +static void BM_UValidate(int iters, int arg) { + StopBenchmarkTiming(); + + // Pick file to process based on "arg" + CHECK_GE(arg, 0); + CHECK_LT(arg, ARRAYSIZE(files)); + string contents = ReadTestDataFile(files[arg].filename, + files[arg].size_limit); + + string zcontents; + snappy::Compress(contents.data(), contents.size(), &zcontents); + + SetBenchmarkBytesProcessed(static_cast(iters) * + static_cast(contents.size())); + SetBenchmarkLabel(files[arg].label); + StartBenchmarkTiming(); + while (iters-- > 0) { + CHECK(snappy::IsValidCompressedBuffer(zcontents.data(), zcontents.size())); + } + StopBenchmarkTiming(); +} +BENCHMARK(BM_UValidate)->DenseRange(0, 4); + + +static void BM_ZFlat(int iters, int arg) { + StopBenchmarkTiming(); + + // Pick file to process based on "arg" + CHECK_GE(arg, 0); + CHECK_LT(arg, ARRAYSIZE(files)); + string contents = ReadTestDataFile(files[arg].filename, + files[arg].size_limit); + + char* dst = new char[snappy::MaxCompressedLength(contents.size())]; + + SetBenchmarkBytesProcessed(static_cast(iters) * + static_cast(contents.size())); + StartBenchmarkTiming(); + + size_t zsize = 0; + while (iters-- > 0) { + snappy::RawCompress(contents.data(), contents.size(), dst, &zsize); + } + StopBenchmarkTiming(); + const double compression_ratio = + static_cast(zsize) / std::max(1, contents.size()); + SetBenchmarkLabel(StringPrintf("%s (%.2f %%)", + files[arg].label, 100.0 * compression_ratio)); + VLOG(0) << StringPrintf("compression for %s: %zd -> %zd bytes", + files[arg].label, contents.size(), zsize); + delete[] dst; +} +BENCHMARK(BM_ZFlat)->DenseRange(0, ARRAYSIZE(files) - 1); + + +} // namespace snappy + + +int main(int argc, char** argv) { + InitGoogle(argv[0], &argc, &argv, true); + File::Init(); + RunSpecifiedBenchmarks(); + + + if (argc >= 2) { + for (int arg = 1; arg < argc; arg++) { + if (FLAGS_write_compressed) { + CompressFile(argv[arg]); + } else if (FLAGS_write_uncompressed) { + UncompressFile(argv[arg]); + } else { + MeasureFile(argv[arg]); + } + } + return 0; + } + + return RUN_ALL_TESTS(); +} diff --git a/chromium/third_party/snappy/src/testdata/alice29.txt b/chromium/third_party/snappy/src/testdata/alice29.txt new file mode 100644 index 00000000000..703365523b9 --- /dev/null +++ b/chromium/third_party/snappy/src/testdata/alice29.txt @@ -0,0 +1,3609 @@ + + + + + ALICE'S ADVENTURES IN WONDERLAND + + Lewis Carroll + + THE MILLENNIUM FULCRUM EDITION 2.9 + + + + + CHAPTER I + + Down the Rabbit-Hole + + + Alice was beginning to get very tired of sitting by her sister +on the bank, and of having nothing to do: once or twice she had +peeped into the book her sister was reading, but it had no +pictures or conversations in it, `and what is the use of a book,' +thought Alice `without pictures or conversation?' + + So she was considering in her own mind (as well as she could, +for the hot day made her feel very sleepy and stupid), whether +the pleasure of making a daisy-chain would be worth the trouble +of getting up and picking the daisies, when suddenly a White +Rabbit with pink eyes ran close by her. + + There was nothing so VERY remarkable in that; nor did Alice +think it so VERY much out of the way to hear the Rabbit say to +itself, `Oh dear! Oh dear! I shall be late!' (when she thought +it over afterwards, it occurred to her that she ought to have +wondered at this, but at the time it all seemed quite natural); +but when the Rabbit actually TOOK A WATCH OUT OF ITS WAISTCOAT- +POCKET, and looked at it, and then hurried on, Alice started to +her feet, for it flashed across her mind that she had never +before seen a rabbit with either a waistcoat-pocket, or a watch to +take out of it, and burning with curiosity, she ran across the +field after it, and fortunately was just in time to see it pop +down a large rabbit-hole under the hedge. + + In another moment down went Alice after it, never once +considering how in the world she was to get out again. + + The rabbit-hole went straight on like a tunnel for some way, +and then dipped suddenly down, so suddenly that Alice had not a +moment to think about stopping herself before she found herself +falling down a very deep well. + + Either the well was very deep, or she fell very slowly, for she +had plenty of time as she went down to look about her and to +wonder what was going to happen next. First, she tried to look +down and make out what she was coming to, but it was too dark to +see anything; then she looked at the sides of the well, and +noticed that they were filled with cupboards and book-shelves; +here and there she saw maps and pictures hung upon pegs. She +took down a jar from one of the shelves as she passed; it was +labelled `ORANGE MARMALADE', but to her great disappointment it +was empty: she did not like to drop the jar for fear of killing +somebody, so managed to put it into one of the cupboards as she +fell past it. + + `Well!' thought Alice to herself, `after such a fall as this, I +shall think nothing of tumbling down stairs! How brave they'll +all think me at home! Why, I wouldn't say anything about it, +even if I fell off the top of the house!' (Which was very likely +true.) + + Down, down, down. Would the fall NEVER come to an end! `I +wonder how many miles I've fallen by this time?' she said aloud. +`I must be getting somewhere near the centre of the earth. Let +me see: that would be four thousand miles down, I think--' (for, +you see, Alice had learnt several things of this sort in her +lessons in the schoolroom, and though this was not a VERY good +opportunity for showing off her knowledge, as there was no one to +listen to her, still it was good practice to say it over) `--yes, +that's about the right distance--but then I wonder what Latitude +or Longitude I've got to?' (Alice had no idea what Latitude was, +or Longitude either, but thought they were nice grand words to +say.) + + Presently she began again. `I wonder if I shall fall right +THROUGH the earth! How funny it'll seem to come out among the +people that walk with their heads downward! The Antipathies, I +think--' (she was rather glad there WAS no one listening, this +time, as it didn't sound at all the right word) `--but I shall +have to ask them what the name of the country is, you know. +Please, Ma'am, is this New Zealand or Australia?' (and she tried +to curtsey as she spoke--fancy CURTSEYING as you're falling +through the air! Do you think you could manage it?) `And what +an ignorant little girl she'll think me for asking! No, it'll +never do to ask: perhaps I shall see it written up somewhere.' + + Down, down, down. There was nothing else to do, so Alice soon +began talking again. `Dinah'll miss me very much to-night, I +should think!' (Dinah was the cat.) `I hope they'll remember +her saucer of milk at tea-time. Dinah my dear! I wish you were +down here with me! There are no mice in the air, I'm afraid, but +you might catch a bat, and that's very like a mouse, you know. +But do cats eat bats, I wonder?' And here Alice began to get +rather sleepy, and went on saying to herself, in a dreamy sort of +way, `Do cats eat bats? Do cats eat bats?' and sometimes, `Do +bats eat cats?' for, you see, as she couldn't answer either +question, it didn't much matter which way she put it. She felt +that she was dozing off, and had just begun to dream that she +was walking hand in hand with Dinah, and saying to her very +earnestly, `Now, Dinah, tell me the truth: did you ever eat a +bat?' when suddenly, thump! thump! down she came upon a heap of +sticks and dry leaves, and the fall was over. + + Alice was not a bit hurt, and she jumped up on to her feet in a +moment: she looked up, but it was all dark overhead; before her +was another long passage, and the White Rabbit was still in +sight, hurrying down it. There was not a moment to be lost: +away went Alice like the wind, and was just in time to hear it +say, as it turned a corner, `Oh my ears and whiskers, how late +it's getting!' She was close behind it when she turned the +corner, but the Rabbit was no longer to be seen: she found +herself in a long, low hall, which was lit up by a row of lamps +hanging from the roof. + + There were doors all round the hall, but they were all locked; +and when Alice had been all the way down one side and up the +other, trying every door, she walked sadly down the middle, +wondering how she was ever to get out again. + + Suddenly she came upon a little three-legged table, all made of +solid glass; there was nothing on it except a tiny golden key, +and Alice's first thought was that it might belong to one of the +doors of the hall; but, alas! either the locks were too large, or +the key was too small, but at any rate it would not open any of +them. However, on the second time round, she came upon a low +curtain she had not noticed before, and behind it was a little +door about fifteen inches high: she tried the little golden key +in the lock, and to her great delight it fitted! + + Alice opened the door and found that it led into a small +passage, not much larger than a rat-hole: she knelt down and +looked along the passage into the loveliest garden you ever saw. +How she longed to get out of that dark hall, and wander about +among those beds of bright flowers and those cool fountains, but +she could not even get her head though the doorway; `and even if +my head would go through,' thought poor Alice, `it would be of +very little use without my shoulders. Oh, how I wish +I could shut up like a telescope! I think I could, if I only +know how to begin.' For, you see, so many out-of-the-way things +had happened lately, that Alice had begun to think that very few +things indeed were really impossible. + + There seemed to be no use in waiting by the little door, so she +went back to the table, half hoping she might find another key on +it, or at any rate a book of rules for shutting people up like +telescopes: this time she found a little bottle on it, (`which +certainly was not here before,' said Alice,) and round the neck +of the bottle was a paper label, with the words `DRINK ME' +beautifully printed on it in large letters. + + It was all very well to say `Drink me,' but the wise little +Alice was not going to do THAT in a hurry. `No, I'll look +first,' she said, `and see whether it's marked "poison" or not'; +for she had read several nice little histories about children who +had got burnt, and eaten up by wild beasts and other unpleasant +things, all because they WOULD not remember the simple rules +their friends had taught them: such as, that a red-hot poker +will burn you if you hold it too long; and that if you cut your +finger VERY deeply with a knife, it usually bleeds; and she had +never forgotten that, if you drink much from a bottle marked +`poison,' it is almost certain to disagree with you, sooner or +later. + + However, this bottle was NOT marked `poison,' so Alice ventured +to taste it, and finding it very nice, (it had, in fact, a sort +of mixed flavour of cherry-tart, custard, pine-apple, roast +turkey, toffee, and hot buttered toast,) she very soon finished +it off. + + * * * * * * * + + * * * * * * + + * * * * * * * + + `What a curious feeling!' said Alice; `I must be shutting up +like a telescope.' + + And so it was indeed: she was now only ten inches high, and +her face brightened up at the thought that she was now the right +size for going though the little door into that lovely garden. +First, however, she waited for a few minutes to see if she was +going to shrink any further: she felt a little nervous about +this; `for it might end, you know,' said Alice to herself, `in my +going out altogether, like a candle. I wonder what I should be +like then?' And she tried to fancy what the flame of a candle is +like after the candle is blown out, for she could not remember +ever having seen such a thing. + + After a while, finding that nothing more happened, she decided +on going into the garden at once; but, alas for poor Alice! when +she got to the door, she found he had forgotten the little golden +key, and when she went back to the table for it, she found she +could not possibly reach it: she could see it quite plainly +through the glass, and she tried her best to climb up one of the +legs of the table, but it was too slippery; and when she had +tired herself out with trying, the poor little thing sat down and +cried. + + `Come, there's no use in crying like that!' said Alice to +herself, rather sharply; `I advise you to leave off this minute!' +She generally gave herself very good advice, (though she very +seldom followed it), and sometimes she scolded herself so +severely as to bring tears into her eyes; and once she remembered +trying to box her own ears for having cheated herself in a game +of croquet she was playing against herself, for this curious +child was very fond of pretending to be two people. `But it's no +use now,' thought poor Alice, `to pretend to be two people! Why, +there's hardly enough of me left to make ONE respectable +person!' + + Soon her eye fell on a little glass box that was lying under +the table: she opened it, and found in it a very small cake, on +which the words `EAT ME' were beautifully marked in currants. +`Well, I'll eat it,' said Alice, `and if it makes me grow larger, +I can reach the key; and if it makes me grow smaller, I can creep +under the door; so either way I'll get into the garden, and I +don't care which happens!' + + She ate a little bit, and said anxiously to herself, `Which +way? Which way?', holding her hand on the top of her head to +feel which way it was growing, and she was quite surprised to +find that she remained the same size: to be sure, this generally +happens when one eats cake, but Alice had got so much into the +way of expecting nothing but out-of-the-way things to happen, +that it seemed quite dull and stupid for life to go on in the +common way. + + So she set to work, and very soon finished off the cake. + + * * * * * * * + + * * * * * * + + * * * * * * * + + + + + CHAPTER II + + The Pool of Tears + + + `Curiouser and curiouser!' cried Alice (she was so much +surprised, that for the moment she quite forgot how to speak good +English); `now I'm opening out like the largest telescope that +ever was! Good-bye, feet!' (for when she looked down at her +feet, they seemed to be almost out of sight, they were getting so +far off). `Oh, my poor little feet, I wonder who will put on +your shoes and stockings for you now, dears? I'm sure _I_ shan't +be able! I shall be a great deal too far off to trouble myself +about you: you must manage the best way you can; --but I must be +kind to them,' thought Alice, `or perhaps they won't walk the +way I want to go! Let me see: I'll give them a new pair of +boots every Christmas.' + + And she went on planning to herself how she would manage it. +`They must go by the carrier,' she thought; `and how funny it'll +seem, sending presents to one's own feet! And how odd the +directions will look! + + ALICE'S RIGHT FOOT, ESQ. + HEARTHRUG, + NEAR THE FENDER, + (WITH ALICE'S LOVE). + +Oh dear, what nonsense I'm talking!' + + Just then her head struck against the roof of the hall: in +fact she was now more than nine feet high, and she at once took +up the little golden key and hurried off to the garden door. + + Poor Alice! It was as much as she could do, lying down on one +side, to look through into the garden with one eye; but to get +through was more hopeless than ever: she sat down and began to +cry again. + + `You ought to be ashamed of yourself,' said Alice, `a great +girl like you,' (she might well say this), `to go on crying in +this way! Stop this moment, I tell you!' But she went on all +the same, shedding gallons of tears, until there was a large pool +all round her, about four inches deep and reaching half down the +hall. + + After a time she heard a little pattering of feet in the +distance, and she hastily dried her eyes to see what was coming. +It was the White Rabbit returning, splendidly dressed, with a +pair of white kid gloves in one hand and a large fan in the +other: he came trotting along in a great hurry, muttering to +himself as he came, `Oh! the Duchess, the Duchess! Oh! won't she +be savage if I've kept her waiting!' Alice felt so desperate +that she was ready to ask help of any one; so, when the Rabbit +came near her, she began, in a low, timid voice, `If you please, +sir--' The Rabbit started violently, dropped the white kid +gloves and the fan, and skurried away into the darkness as hard +as he could go. + + Alice took up the fan and gloves, and, as the hall was very +hot, she kept fanning herself all the time she went on talking: +`Dear, dear! How queer everything is to-day! And yesterday +things went on just as usual. I wonder if I've been changed in +the night? Let me think: was I the same when I got up this +morning? I almost think I can remember feeling a little +different. But if I'm not the same, the next question is, Who in +the world am I? Ah, THAT'S the great puzzle!' And she began +thinking over all the children she knew that were of the same age +as herself, to see if she could have been changed for any of +them. + + `I'm sure I'm not Ada,' she said, `for her hair goes in such +long ringlets, and mine doesn't go in ringlets at all; and I'm +sure I can't be Mabel, for I know all sorts of things, and she, +oh! she knows such a very little! Besides, SHE'S she, and I'm I, +and--oh dear, how puzzling it all is! I'll try if I know all the +things I used to know. Let me see: four times five is twelve, +and four times six is thirteen, and four times seven is--oh dear! +I shall never get to twenty at that rate! However, the +Multiplication Table doesn't signify: let's try Geography. +London is the capital of Paris, and Paris is the capital of Rome, +and Rome--no, THAT'S all wrong, I'm certain! I must have been +changed for Mabel! I'll try and say "How doth the little--"' +and she crossed her hands on her lap as if she were saying lessons, +and began to repeat it, but her voice sounded hoarse and +strange, and the words did not come the same as they used to do:-- + + `How doth the little crocodile + Improve his shining tail, + And pour the waters of the Nile + On every golden scale! + + `How cheerfully he seems to grin, + How neatly spread his claws, + And welcome little fishes in + With gently smiling jaws!' + + `I'm sure those are not the right words,' said poor Alice, and +her eyes filled with tears again as she went on, `I must be Mabel +after all, and I shall have to go and live in that poky little +house, and have next to no toys to play with, and oh! ever so +many lessons to learn! No, I've made up my mind about it; if I'm +Mabel, I'll stay down here! It'll be no use their putting their +heads down and saying "Come up again, dear!" I shall only look +up and say "Who am I then? Tell me that first, and then, if I +like being that person, I'll come up: if not, I'll stay down +here till I'm somebody else"--but, oh dear!' cried Alice, with a +sudden burst of tears, `I do wish they WOULD put their heads +down! I am so VERY tired of being all alone here!' + + As she said this she looked down at her hands, and was +surprised to see that she had put on one of the Rabbit's little +white kid gloves while she was talking. `How CAN I have done +that?' she thought. `I must be growing small again.' She got up +and went to the table to measure herself by it, and found that, +as nearly as she could guess, she was now about two feet high, +and was going on shrinking rapidly: she soon found out that the +cause of this was the fan she was holding, and she dropped it +hastily, just in time to avoid shrinking away altogether. + +`That WAS a narrow escape!' said Alice, a good deal frightened at +the sudden change, but very glad to find herself still in +existence; `and now for the garden!' and she ran with all speed +back to the little door: but, alas! the little door was shut +again, and the little golden key was lying on the glass table as +before, `and things are worse than ever,' thought the poor child, +`for I never was so small as this before, never! And I declare +it's too bad, that it is!' + + As she said these words her foot slipped, and in another +moment, splash! she was up to her chin in salt water. He first +idea was that she had somehow fallen into the sea, `and in that +case I can go back by railway,' she said to herself. (Alice had +been to the seaside once in her life, and had come to the general +conclusion, that wherever you go to on the English coast you find +a number of bathing machines in the sea, some children digging in +the sand with wooden spades, then a row of lodging houses, and +behind them a railway station.) However, she soon made out that +she was in the pool of tears which she had wept when she was nine +feet high. + + `I wish I hadn't cried so much!' said Alice, as she swam about, +trying to find her way out. `I shall be punished for it now, I +suppose, by being drowned in my own tears! That WILL be a queer +thing, to be sure! However, everything is queer to-day.' + + Just then she heard something splashing about in the pool a +little way off, and she swam nearer to make out what it was: at +first she thought it must be a walrus or hippopotamus, but then +she remembered how small she was now, and she soon made out that +it was only a mouse that had slipped in like herself. + + `Would it be of any use, now,' thought Alice, `to speak to this +mouse? Everything is so out-of-the-way down here, that I should +think very likely it can talk: at any rate, there's no harm in +trying.' So she began: `O Mouse, do you know the way out of +this pool? I am very tired of swimming about here, O Mouse!' +(Alice thought this must be the right way of speaking to a mouse: +she had never done such a thing before, but she remembered having +seen in her brother's Latin Grammar, `A mouse--of a mouse--to a +mouse--a mouse--O mouse!' The Mouse looked at her rather +inquisitively, and seemed to her to wink with one of its little +eyes, but it said nothing. + + `Perhaps it doesn't understand English,' thought Alice; `I +daresay it's a French mouse, come over with William the +Conqueror.' (For, with all her knowledge of history, Alice had +no very clear notion how long ago anything had happened.) So she +began again: `Ou est ma chatte?' which was the first sentence in +her French lesson-book. The Mouse gave a sudden leap out of the +water, and seemed to quiver all over with fright. `Oh, I beg +your pardon!' cried Alice hastily, afraid that she had hurt the +poor animal's feelings. `I quite forgot you didn't like cats.' + + `Not like cats!' cried the Mouse, in a shrill, passionate +voice. `Would YOU like cats if you were me?' + + `Well, perhaps not,' said Alice in a soothing tone: `don't be +angry about it. And yet I wish I could show you our cat Dinah: +I think you'd take a fancy to cats if you could only see her. +She is such a dear quiet thing,' Alice went on, half to herself, +as she swam lazily about in the pool, `and she sits purring so +nicely by the fire, licking her paws and washing her face--and +she is such a nice soft thing to nurse--and she's such a capital +one for catching mice--oh, I beg your pardon!' cried Alice again, +for this time the Mouse was bristling all over, and she felt +certain it must be really offended. `We won't talk about her any +more if you'd rather not.' + + `We indeed!' cried the Mouse, who was trembling down to the end +of his tail. `As if I would talk on such a subject! Our family +always HATED cats: nasty, low, vulgar things! Don't let me hear +the name again!' + + `I won't indeed!' said Alice, in a great hurry to change the +subject of conversation. `Are you--are you fond--of--of dogs?' +The Mouse did not answer, so Alice went on eagerly: `There is +such a nice little dog near our house I should like to show you! +A little bright-eyed terrier, you know, with oh, such long curly +brown hair! And it'll fetch things when you throw them, and +it'll sit up and beg for its dinner, and all sorts of things--I +can't remember half of them--and it belongs to a farmer, you +know, and he says it's so useful, it's worth a hundred pounds! +He says it kills all the rats and--oh dear!' cried Alice in a +sorrowful tone, `I'm afraid I've offended it again!' For the +Mouse was swimming away from her as hard as it could go, and +making quite a commotion in the pool as it went. + + So she called softly after it, `Mouse dear! Do come back +again, and we won't talk about cats or dogs either, if you don't +like them!' When the Mouse heard this, it turned round and swam +slowly back to her: its face was quite pale (with passion, Alice +thought), and it said in a low trembling voice, `Let us get to +the shore, and then I'll tell you my history, and you'll +understand why it is I hate cats and dogs.' + + It was high time to go, for the pool was getting quite crowded +with the birds and animals that had fallen into it: there were a +Duck and a Dodo, a Lory and an Eaglet, and several other curious +creatures. Alice led the way, and the whole party swam to the +shore. + + + + CHAPTER III + + A Caucus-Race and a Long Tale + + + They were indeed a queer-looking party that assembled on the +bank--the birds with draggled feathers, the animals with their +fur clinging close to them, and all dripping wet, cross, and +uncomfortable. + + The first question of course was, how to get dry again: they +had a consultation about this, and after a few minutes it seemed +quite natural to Alice to find herself talking familiarly with +them, as if she had known them all her life. Indeed, she had +quite a long argument with the Lory, who at last turned sulky, +and would only say, `I am older than you, and must know better'; +and this Alice would not allow without knowing how old it was, +and, as the Lory positively refused to tell its age, there was no +more to be said. + + At last the Mouse, who seemed to be a person of authority among +them, called out, `Sit down, all of you, and listen to me! I'LL +soon make you dry enough!' They all sat down at once, in a large +ring, with the Mouse in the middle. Alice kept her eyes +anxiously fixed on it, for she felt sure she would catch a bad +cold if she did not get dry very soon. + + `Ahem!' said the Mouse with an important air, `are you all ready? +This is the driest thing I know. Silence all round, if you please! +"William the Conqueror, whose cause was favoured by the pope, was +soon submitted to by the English, who wanted leaders, and had been +of late much accustomed to usurpation and conquest. Edwin and +Morcar, the earls of Mercia and Northumbria--"' + + `Ugh!' said the Lory, with a shiver. + + `I beg your pardon!' said the Mouse, frowning, but very +politely: `Did you speak?' + + `Not I!' said the Lory hastily. + + `I thought you did,' said the Mouse. `--I proceed. "Edwin and +Morcar, the earls of Mercia and Northumbria, declared for him: +and even Stigand, the patriotic archbishop of Canterbury, found +it advisable--"' + + `Found WHAT?' said the Duck. + + `Found IT,' the Mouse replied rather crossly: `of course you +know what "it" means.' + + `I know what "it" means well enough, when I find a thing,' said +the Duck: `it's generally a frog or a worm. The question is, +what did the archbishop find?' + + The Mouse did not notice this question, but hurriedly went on, +`"--found it advisable to go with Edgar Atheling to meet William +and offer him the crown. William's conduct at first was +moderate. But the insolence of his Normans--" How are you +getting on now, my dear?' it continued, turning to Alice as it +spoke. + + `As wet as ever,' said Alice in a melancholy tone: `it doesn't +seem to dry me at all.' + + `In that case,' said the Dodo solemnly, rising to its feet, `I +move that the meeting adjourn, for the immediate adoption of more +energetic remedies--' + + `Speak English!' said the Eaglet. `I don't know the meaning of +half those long words, and, what's more, I don't believe you do +either!' And the Eaglet bent down its head to hide a smile: +some of the other birds tittered audibly. + + `What I was going to say,' said the Dodo in an offended tone, +`was, that the best thing to get us dry would be a Caucus-race.' + + `What IS a Caucus-race?' said Alice; not that she wanted much +to know, but the Dodo had paused as if it thought that SOMEBODY +ought to speak, and no one else seemed inclined to say anything. + + `Why,' said the Dodo, `the best way to explain it is to do it.' +(And, as you might like to try the thing yourself, some winter +day, I will tell you how the Dodo managed it.) + + First it marked out a race-course, in a sort of circle, (`the +exact shape doesn't matter,' it said,) and then all the party +were placed along the course, here and there. There was no `One, +two, three, and away,' but they began running when they liked, +and left off when they liked, so that it was not easy to know +when the race was over. However, when they had been running half +an hour or so, and were quite dry again, the Dodo suddenly called +out `The race is over!' and they all crowded round it, panting, +and asking, `But who has won?' + + This question the Dodo could not answer without a great deal of +thought, and it sat for a long time with one finger pressed upon +its forehead (the position in which you usually see Shakespeare, +in the pictures of him), while the rest waited in silence. At +last the Dodo said, `EVERYBODY has won, and all must have +prizes.' + + `But who is to give the prizes?' quite a chorus of voices +asked. + + `Why, SHE, of course,' said the Dodo, pointing to Alice with +one finger; and the whole party at once crowded round her, +calling out in a confused way, `Prizes! Prizes!' + + Alice had no idea what to do, and in despair she put her hand +in her pocket, and pulled out a box of comfits, (luckily the salt +water had not got into it), and handed them round as prizes. +There was exactly one a-piece all round. + + `But she must have a prize herself, you know,' said the Mouse. + + `Of course,' the Dodo replied very gravely. `What else have +you got in your pocket?' he went on, turning to Alice. + + `Only a thimble,' said Alice sadly. + + `Hand it over here,' said the Dodo. + + Then they all crowded round her once more, while the Dodo +solemnly presented the thimble, saying `We beg your acceptance of +this elegant thimble'; and, when it had finished this short +speech, they all cheered. + + Alice thought the whole thing very absurd, but they all looked +so grave that she did not dare to laugh; and, as she could not +think of anything to say, she simply bowed, and took the thimble, +looking as solemn as she could. + + The next thing was to eat the comfits: this caused some noise +and confusion, as the large birds complained that they could not +taste theirs, and the small ones choked and had to be patted on +the back. However, it was over at last, and they sat down again +in a ring, and begged the Mouse to tell them something more. + + `You promised to tell me your history, you know,' said Alice, +`and why it is you hate--C and D,' she added in a whisper, half +afraid that it would be offended again. + + `Mine is a long and a sad tale!' said the Mouse, turning to +Alice, and sighing. + + `It IS a long tail, certainly,' said Alice, looking down with +wonder at the Mouse's tail; `but why do you call it sad?' And +she kept on puzzling about it while the Mouse was speaking, so +that her idea of the tale was something like this:-- + + `Fury said to a + mouse, That he + met in the + house, + "Let us + both go to + law: I will + prosecute + YOU. --Come, + I'll take no + denial; We + must have a + trial: For + really this + morning I've + nothing + to do." + Said the + mouse to the + cur, "Such + a trial, + dear Sir, + With + no jury + or judge, + would be + wasting + our + breath." + "I'll be + judge, I'll + be jury," + Said + cunning + old Fury: + "I'll + try the + whole + cause, + and + condemn + you + to + death."' + + + `You are not attending!' said the Mouse to Alice severely. +`What are you thinking of?' + + `I beg your pardon,' said Alice very humbly: `you had got to +the fifth bend, I think?' + + `I had NOT!' cried the Mouse, sharply and very angrily. + + `A knot!' said Alice, always ready to make herself useful, and +looking anxiously about her. `Oh, do let me help to undo it!' + + `I shall do nothing of the sort,' said the Mouse, getting up +and walking away. `You insult me by talking such nonsense!' + + `I didn't mean it!' pleaded poor Alice. `But you're so easily +offended, you know!' + + The Mouse only growled in reply. + + `Please come back and finish your story!' Alice called after +it; and the others all joined in chorus, `Yes, please do!' but +the Mouse only shook its head impatiently, and walked a little +quicker. + + `What a pity it wouldn't stay!' sighed the Lory, as soon as it +was quite out of sight; and an old Crab took the opportunity of +saying to her daughter `Ah, my dear! Let this be a lesson to you +never to lose YOUR temper!' `Hold your tongue, Ma!' said the +young Crab, a little snappishly. `You're enough to try the +patience of an oyster!' + + `I wish I had our Dinah here, I know I do!' said Alice aloud, +addressing nobody in particular. `She'd soon fetch it back!' + + `And who is Dinah, if I might venture to ask the question?' +said the Lory. + + Alice replied eagerly, for she was always ready to talk about +her pet: `Dinah's our cat. And she's such a capital one for +catching mice you can't think! And oh, I wish you could see her +after the birds! Why, she'll eat a little bird as soon as look +at it!' + + This speech caused a remarkable sensation among the party. +Some of the birds hurried off at once: one the old Magpie began +wrapping itself up very carefully, remarking, `I really must be +getting home; the night-air doesn't suit my throat!' and a Canary +called out in a trembling voice to its children, `Come away, my +dears! It's high time you were all in bed!' On various pretexts +they all moved off, and Alice was soon left alone. + + `I wish I hadn't mentioned Dinah!' she said to herself in a +melancholy tone. `Nobody seems to like her, down here, and I'm +sure she's the best cat in the world! Oh, my dear Dinah! I +wonder if I shall ever see you any more!' And here poor Alice +began to cry again, for she felt very lonely and low-spirited. +In a little while, however, she again heard a little pattering of +footsteps in the distance, and she looked up eagerly, half hoping +that the Mouse had changed his mind, and was coming back to +finish his story. + + + + CHAPTER IV + + The Rabbit Sends in a Little Bill + + + It was the White Rabbit, trotting slowly back again, and +looking anxiously about as it went, as if it had lost something; +and she heard it muttering to itself `The Duchess! The Duchess! +Oh my dear paws! Oh my fur and whiskers! She'll get me +executed, as sure as ferrets are ferrets! Where CAN I have +dropped them, I wonder?' Alice guessed in a moment that it was +looking for the fan and the pair of white kid gloves, and she +very good-naturedly began hunting about for them, but they were +nowhere to be seen--everything seemed to have changed since her +swim in the pool, and the great hall, with the glass table and +the little door, had vanished completely. + + Very soon the Rabbit noticed Alice, as she went hunting about, +and called out to her in an angry tone, `Why, Mary Ann, what ARE +you doing out here? Run home this moment, and fetch me a pair of +gloves and a fan! Quick, now!' And Alice was so much frightened +that she ran off at once in the direction it pointed to, without +trying to explain the mistake it had made. + + `He took me for his housemaid,' she said to herself as she ran. +`How surprised he'll be when he finds out who I am! But I'd +better take him his fan and gloves--that is, if I can find them.' +As she said this, she came upon a neat little house, on the door +of which was a bright brass plate with the name `W. RABBIT' +engraved upon it. She went in without knocking, and hurried +upstairs, in great fear lest she should meet the real Mary Ann, +and be turned out of the house before she had found the fan and +gloves. + + `How queer it seems,' Alice said to herself, `to be going +messages for a rabbit! I suppose Dinah'll be sending me on +messages next!' And she began fancying the sort of thing that +would happen: `"Miss Alice! Come here directly, and get ready +for your walk!" "Coming in a minute, nurse! But I've got to see +that the mouse doesn't get out." Only I don't think,' Alice went +on, `that they'd let Dinah stop in the house if it began ordering +people about like that!' + + By this time she had found her way into a tidy little room with +a table in the window, and on it (as she had hoped) a fan and two +or three pairs of tiny white kid gloves: she took up the fan and +a pair of the gloves, and was just going to leave the room, when +her eye fell upon a little bottle that stood near the looking- +glass. There was no label this time with the words `DRINK ME,' +but nevertheless she uncorked it and put it to her lips. `I know +SOMETHING interesting is sure to happen,' she said to herself, +`whenever I eat or drink anything; so I'll just see what this +bottle does. I do hope it'll make me grow large again, for +really I'm quite tired of being such a tiny little thing!' + + It did so indeed, and much sooner than she had expected: +before she had drunk half the bottle, she found her head pressing +against the ceiling, and had to stoop to save her neck from being +broken. She hastily put down the bottle, saying to herself +`That's quite enough--I hope I shan't grow any more--As it is, I +can't get out at the door--I do wish I hadn't drunk quite so +much!' + + Alas! it was too late to wish that! She went on growing, and +growing, and very soon had to kneel down on the floor: in +another minute there was not even room for this, and she tried +the effect of lying down with one elbow against the door, and the +other arm curled round her head. Still she went on growing, and, +as a last resource, she put one arm out of the window, and one +foot up the chimney, and said to herself `Now I can do no more, +whatever happens. What WILL become of me?' + + Luckily for Alice, the little magic bottle had now had its full +effect, and she grew no larger: still it was very uncomfortable, +and, as there seemed to be no sort of chance of her ever getting +out of the room again, no wonder she felt unhappy. + + `It was much pleasanter at home,' thought poor Alice, `when one +wasn't always growing larger and smaller, and being ordered about +by mice and rabbits. I almost wish I hadn't gone down that +rabbit-hole--and yet--and yet--it's rather curious, you know, +this sort of life! I do wonder what CAN have happened to me! +When I used to read fairy-tales, I fancied that kind of thing +never happened, and now here I am in the middle of one! There +ought to be a book written about me, that there ought! And when +I grow up, I'll write one--but I'm grown up now,' she added in a +sorrowful tone; `at least there's no room to grow up any more +HERE.' + + `But then,' thought Alice, `shall I NEVER get any older than I +am now? That'll be a comfort, one way--never to be an old woman- +-but then--always to have lessons to learn! Oh, I shouldn't like +THAT!' + + `Oh, you foolish Alice!' she answered herself. `How can you +learn lessons in here? Why, there's hardly room for YOU, and no +room at all for any lesson-books!' + + And so she went on, taking first one side and then the other, +and making quite a conversation of it altogether; but after a few +minutes she heard a voice outside, and stopped to listen. + + `Mary Ann! Mary Ann!' said the voice. `Fetch me my gloves +this moment!' Then came a little pattering of feet on the +stairs. Alice knew it was the Rabbit coming to look for her, and +she trembled till she shook the house, quite forgetting that she +was now about a thousand times as large as the Rabbit, and had no +reason to be afraid of it. + + Presently the Rabbit came up to the door, and tried to open it; +but, as the door opened inwards, and Alice's elbow was pressed +hard against it, that attempt proved a failure. Alice heard it +say to itself `Then I'll go round and get in at the window.' + + `THAT you won't' thought Alice, and, after waiting till she +fancied she heard the Rabbit just under the window, she suddenly +spread out her hand, and made a snatch in the air. She did not +get hold of anything, but she heard a little shriek and a fall, +and a crash of broken glass, from which she concluded that it was +just possible it had fallen into a cucumber-frame, or something +of the sort. + + Next came an angry voice--the Rabbit's--`Pat! Pat! Where are +you?' And then a voice she had never heard before, `Sure then +I'm here! Digging for apples, yer honour!' + + `Digging for apples, indeed!' said the Rabbit angrily. `Here! +Come and help me out of THIS!' (Sounds of more broken glass.) + + `Now tell me, Pat, what's that in the window?' + + `Sure, it's an arm, yer honour!' (He pronounced it `arrum.') + + `An arm, you goose! Who ever saw one that size? Why, it +fills the whole window!' + + `Sure, it does, yer honour: but it's an arm for all that.' + + `Well, it's got no business there, at any rate: go and take it +away!' + + There was a long silence after this, and Alice could only hear +whispers now and then; such as, `Sure, I don't like it, yer +honour, at all, at all!' `Do as I tell you, you coward!' and at +last she spread out her hand again, and made another snatch in +the air. This time there were TWO little shrieks, and more +sounds of broken glass. `What a number of cucumber-frames there +must be!' thought Alice. `I wonder what they'll do next! As for +pulling me out of the window, I only wish they COULD! I'm sure I +don't want to stay in here any longer!' + + She waited for some time without hearing anything more: at +last came a rumbling of little cartwheels, and the sound of a +good many voice all talking together: she made out the words: +`Where's the other ladder?--Why, I hadn't to bring but one; +Bill's got the other--Bill! fetch it here, lad!--Here, put 'em up +at this corner--No, tie 'em together first--they don't reach half +high enough yet--Oh! they'll do well enough; don't be particular- +-Here, Bill! catch hold of this rope--Will the roof bear?--Mind +that loose slate--Oh, it's coming down! Heads below!' (a loud +crash)--`Now, who did that?--It was Bill, I fancy--Who's to go +down the chimney?--Nay, I shan't! YOU do it!--That I won't, +then!--Bill's to go down--Here, Bill! the master says you're to +go down the chimney!' + + `Oh! So Bill's got to come down the chimney, has he?' said +Alice to herself. `Shy, they seem to put everything upon Bill! +I wouldn't be in Bill's place for a good deal: this fireplace is +narrow, to be sure; but I THINK I can kick a little!' + + She drew her foot as far down the chimney as she could, and +waited till she heard a little animal (she couldn't guess of what +sort it was) scratching and scrambling about in the chimney close +above her: then, saying to herself `This is Bill,' she gave one +sharp kick, and waited to see what would happen next. + + The first thing she heard was a general chorus of `There goes +Bill!' then the Rabbit's voice along--`Catch him, you by the +hedge!' then silence, and then another confusion of voices--`Hold +up his head--Brandy now--Don't choke him--How was it, old fellow? +What happened to you? Tell us all about it!' + + Last came a little feeble, squeaking voice, (`That's Bill,' +thought Alice,) `Well, I hardly know--No more, thank ye; I'm +better now--but I'm a deal too flustered to tell you--all I know +is, something comes at me like a Jack-in-the-box, and up I goes +like a sky-rocket!' + + `So you did, old fellow!' said the others. + + `We must burn the house down!' said the Rabbit's voice; and +Alice called out as loud as she could, `If you do. I'll set +Dinah at you!' + + There was a dead silence instantly, and Alice thought to +herself, `I wonder what they WILL do next! If they had any +sense, they'd take the roof off.' After a minute or two, they +began moving about again, and Alice heard the Rabbit say, `A +barrowful will do, to begin with.' + + `A barrowful of WHAT?' thought Alice; but she had not long to +doubt, for the next moment a shower of little pebbles came +rattling in at the window, and some of them hit her in the face. +`I'll put a stop to this,' she said to herself, and shouted out, +`You'd better not do that again!' which produced another dead +silence. + + Alice noticed with some surprise that the pebbles were all +turning into little cakes as they lay on the floor, and a bright +idea came into her head. `If I eat one of these cakes,' she +thought, `it's sure to make SOME change in my size; and as it +can't possibly make me larger, it must make me smaller, I +suppose.' + + So she swallowed one of the cakes, and was delighted to find +that she began shrinking directly. As soon as she was small +enough to get through the door, she ran out of the house, and +found quite a crowd of little animals and birds waiting outside. +The poor little Lizard, Bill, was in the middle, being held up by +two guinea-pigs, who were giving it something out of a bottle. +They all made a rush at Alice the moment she appeared; but she +ran off as hard as she could, and soon found herself safe in a +thick wood. + + `The first thing I've got to do,' said Alice to herself, as she +wandered about in the wood, `is to grow to my right size again; +and the second thing is to find my way into that lovely garden. +I think that will be the best plan.' + + It sounded an excellent plan, no doubt, and very neatly and +simply arranged; the only difficulty was, that she had not the +smallest idea how to set about it; and while she was peering +about anxiously among the trees, a little sharp bark just over +her head made her look up in a great hurry. + + An enormous puppy was looking down at her with large round +eyes, and feebly stretching out one paw, trying to touch her. +`Poor little thing!' said Alice, in a coaxing tone, and she tried +hard to whistle to it; but she was terribly frightened all the +time at the thought that it might be hungry, in which case it +would be very likely to eat her up in spite of all her coaxing. + + Hardly knowing what she did, she picked up a little bit of +stick, and held it out to the puppy; whereupon the puppy jumped +into the air off all its feet at once, with a yelp of delight, +and rushed at the stick, and made believe to worry it; then Alice +dodged behind a great thistle, to keep herself from being run +over; and the moment she appeared on the other side, the puppy +made another rush at the stick, and tumbled head over heels in +its hurry to get hold of it; then Alice, thinking it was very +like having a game of play with a cart-horse, and expecting every +moment to be trampled under its feet, ran round the thistle +again; then the puppy began a series of short charges at the +stick, running a very little way forwards each time and a long +way back, and barking hoarsely all the while, till at last it sat +down a good way off, panting, with its tongue hanging out of its +mouth, and its great eyes half shut. + + This seemed to Alice a good opportunity for making her escape; +so she set off at once, and ran till she was quite tired and out +of breath, and till the puppy's bark sounded quite faint in the +distance. + + `And yet what a dear little puppy it was!' said Alice, as she +leant against a buttercup to rest herself, and fanned herself +with one of the leaves: `I should have liked teaching it tricks +very much, if--if I'd only been the right size to do it! Oh +dear! I'd nearly forgotten that I've got to grow up again! Let +me see--how IS it to be managed? I suppose I ought to eat or +drink something or other; but the great question is, what?' + + The great question certainly was, what? Alice looked all round +her at the flowers and the blades of grass, but she did not see +anything that looked like the right thing to eat or drink under +the circumstances. There was a large mushroom growing near her, +about the same height as herself; and when she had looked under +it, and on both sides of it, and behind it, it occurred to her +that she might as well look and see what was on the top of it. + + She stretched herself up on tiptoe, and peeped over the edge of +the mushroom, and her eyes immediately met those of a large +caterpillar, that was sitting on the top with its arms folded, +quietly smoking a long hookah, and taking not the smallest notice +of her or of anything else. + + + + CHAPTER V + + Advice from a Caterpillar + + + The Caterpillar and Alice looked at each other for some time in +silence: at last the Caterpillar took the hookah out of its +mouth, and addressed her in a languid, sleepy voice. + + `Who are YOU?' said the Caterpillar. + + This was not an encouraging opening for a conversation. Alice +replied, rather shyly, `I--I hardly know, sir, just at present-- +at least I know who I WAS when I got up this morning, but I think +I must have been changed several times since then.' + + `What do you mean by that?' said the Caterpillar sternly. +`Explain yourself!' + + `I can't explain MYSELF, I'm afraid, sir' said Alice, `because +I'm not myself, you see.' + + `I don't see,' said the Caterpillar. + + `I'm afraid I can't put it more clearly,' Alice replied very +politely, `for I can't understand it myself to begin with; and +being so many different sizes in a day is very confusing.' + + `It isn't,' said the Caterpillar. + + `Well, perhaps you haven't found it so yet,' said Alice; `but +when you have to turn into a chrysalis--you will some day, you +know--and then after that into a butterfly, I should think you'll +feel it a little queer, won't you?' + + `Not a bit,' said the Caterpillar. + + `Well, perhaps your feelings may be different,' said Alice; +`all I know is, it would feel very queer to ME.' + + `You!' said the Caterpillar contemptuously. `Who are YOU?' + + Which brought them back again to the beginning of the +conversation. Alice felt a little irritated at the Caterpillar's +making such VERY short remarks, and she drew herself up and said, +very gravely, `I think, you ought to tell me who YOU are, first.' + + `Why?' said the Caterpillar. + + Here was another puzzling question; and as Alice could not +think of any good reason, and as the Caterpillar seemed to be in +a VERY unpleasant state of mind, she turned away. + + `Come back!' the Caterpillar called after her. `I've something +important to say!' + + This sounded promising, certainly: Alice turned and came back +again. + + `Keep your temper,' said the Caterpillar. + + `Is that all?' said Alice, swallowing down her anger as well as +she could. + + `No,' said the Caterpillar. + + Alice thought she might as well wait, as she had nothing else +to do, and perhaps after all it might tell her something worth +hearing. For some minutes it puffed away without speaking, but +at last it unfolded its arms, took the hookah out of its mouth +again, and said, `So you think you're changed, do you?' + + `I'm afraid I am, sir,' said Alice; `I can't remember things as +I used--and I don't keep the same size for ten minutes together!' + + `Can't remember WHAT things?' said the Caterpillar. + + `Well, I've tried to say "HOW DOTH THE LITTLE BUSY BEE," but it +all came different!' Alice replied in a very melancholy voice. + + `Repeat, "YOU ARE OLD, FATHER WILLIAM,"' said the Caterpillar. + + Alice folded her hands, and began:-- + + `You are old, Father William,' the young man said, + `And your hair has become very white; + And yet you incessantly stand on your head-- + Do you think, at your age, it is right?' + + `In my youth,' Father William replied to his son, + `I feared it might injure the brain; + But, now that I'm perfectly sure I have none, + Why, I do it again and again.' + + `You are old,' said the youth, `as I mentioned before, + And have grown most uncommonly fat; + Yet you turned a back-somersault in at the door-- + Pray, what is the reason of that?' + + `In my youth,' said the sage, as he shook his grey locks, + `I kept all my limbs very supple + By the use of this ointment--one shilling the box-- + Allow me to sell you a couple?' + + `You are old,' said the youth, `and your jaws are too weak + For anything tougher than suet; + Yet you finished the goose, with the bones and the beak-- + Pray how did you manage to do it?' + + `In my youth,' said his father, `I took to the law, + And argued each case with my wife; + And the muscular strength, which it gave to my jaw, + Has lasted the rest of my life.' + + `You are old,' said the youth, `one would hardly suppose + That your eye was as steady as ever; + Yet you balanced an eel on the end of your nose-- + What made you so awfully clever?' + + `I have answered three questions, and that is enough,' + Said his father; `don't give yourself airs! + Do you think I can listen all day to such stuff? + Be off, or I'll kick you down stairs!' + + + `That is not said right,' said the Caterpillar. + + `Not QUITE right, I'm afraid,' said Alice, timidly; `some of the +words have got altered.' + + `It is wrong from beginning to end,' said the Caterpillar +decidedly, and there was silence for some minutes. + + The Caterpillar was the first to speak. + + `What size do you want to be?' it asked. + + `Oh, I'm not particular as to size,' Alice hastily replied; +`only one doesn't like changing so often, you know.' + + `I DON'T know,' said the Caterpillar. + + Alice said nothing: she had never been so much contradicted in +her life before, and she felt that she was losing her temper. + + `Are you content now?' said the Caterpillar. + + `Well, I should like to be a LITTLE larger, sir, if you +wouldn't mind,' said Alice: `three inches is such a wretched +height to be.' + + `It is a very good height indeed!' said the Caterpillar +angrily, rearing itself upright as it spoke (it was exactly three +inches high). + + `But I'm not used to it!' pleaded poor Alice in a piteous tone. +And she thought of herself, `I wish the creatures wouldn't be so +easily offended!' + + `You'll get used to it in time,' said the Caterpillar; and it +put the hookah into its mouth and began smoking again. + + This time Alice waited patiently until it chose to speak again. +In a minute or two the Caterpillar took the hookah out of its +mouth and yawned once or twice, and shook itself. Then it got +down off the mushroom, and crawled away in the grass, merely +remarking as it went, `One side will make you grow taller, and +the other side will make you grow shorter.' + + `One side of WHAT? The other side of WHAT?' thought Alice to +herself. + + `Of the mushroom,' said the Caterpillar, just as if she had +asked it aloud; and in another moment it was out of sight. + + Alice remained looking thoughtfully at the mushroom for a +minute, trying to make out which were the two sides of it; and as +it was perfectly round, she found this a very difficult question. +However, at last she stretched her arms round it as far as they +would go, and broke off a bit of the edge with each hand. + + `And now which is which?' she said to herself, and nibbled a +little of the right-hand bit to try the effect: the next moment +she felt a violent blow underneath her chin: it had struck her +foot! + + She was a good deal frightened by this very sudden change, but +she felt that there was no time to be lost, as she was shrinking +rapidly; so she set to work at once to eat some of the other bit. +Her chin was pressed so closely against her foot, that there was +hardly room to open her mouth; but she did it at last, and +managed to swallow a morsel of the lefthand bit. + + + * * * * * * * + + * * * * * * + + * * * * * * * + + `Come, my head's free at last!' said Alice in a tone of +delight, which changed into alarm in another moment, when she +found that her shoulders were nowhere to be found: all she could +see, when she looked down, was an immense length of neck, which +seemed to rise like a stalk out of a sea of green leaves that lay +far below her. + + `What CAN all that green stuff be?' said Alice. `And where +HAVE my shoulders got to? And oh, my poor hands, how is it I +can't see you?' She was moving them about as she spoke, but no +result seemed to follow, except a little shaking among the +distant green leaves. + + As there seemed to be no chance of getting her hands up to her +head, she tried to get her head down to them, and was delighted +to find that her neck would bend about easily in any direction, +like a serpent. She had just succeeded in curving it down into a +graceful zigzag, and was going to dive in among the leaves, which +she found to be nothing but the tops of the trees under which she +had been wandering, when a sharp hiss made her draw back in a +hurry: a large pigeon had flown into her face, and was beating +her violently with its wings. + + `Serpent!' screamed the Pigeon. + + `I'm NOT a serpent!' said Alice indignantly. `Let me alone!' + + `Serpent, I say again!' repeated the Pigeon, but in a more +subdued tone, and added with a kind of sob, `I've tried every +way, and nothing seems to suit them!' + + `I haven't the least idea what you're talking about,' said +Alice. + + `I've tried the roots of trees, and I've tried banks, and I've +tried hedges,' the Pigeon went on, without attending to her; `but +those serpents! There's no pleasing them!' + + Alice was more and more puzzled, but she thought there was no +use in saying anything more till the Pigeon had finished. + + `As if it wasn't trouble enough hatching the eggs,' said the +Pigeon; `but I must be on the look-out for serpents night and +day! Why, I haven't had a wink of sleep these three weeks!' + + `I'm very sorry you've been annoyed,' said Alice, who was +beginning to see its meaning. + + `And just as I'd taken the highest tree in the wood,' continued +the Pigeon, raising its voice to a shriek, `and just as I was +thinking I should be free of them at last, they must needs come +wriggling down from the sky! Ugh, Serpent!' + + `But I'm NOT a serpent, I tell you!' said Alice. `I'm a--I'm +a--' + + `Well! WHAT are you?' said the Pigeon. `I can see you're +trying to invent something!' + + `I--I'm a little girl,' said Alice, rather doubtfully, as she +remembered the number of changes she had gone through that day. + + `A likely story indeed!' said the Pigeon in a tone of the +deepest contempt. `I've seen a good many little girls in my +time, but never ONE with such a neck as that! No, no! You're a +serpent; and there's no use denying it. I suppose you'll be +telling me next that you never tasted an egg!' + + `I HAVE tasted eggs, certainly,' said Alice, who was a very +truthful child; `but little girls eat eggs quite as much as +serpents do, you know.' + + `I don't believe it,' said the Pigeon; `but if they do, why +then they're a kind of serpent, that's all I can say.' + + This was such a new idea to Alice, that she was quite silent +for a minute or two, which gave the Pigeon the opportunity of +adding, `You're looking for eggs, I know THAT well enough; and +what does it matter to me whether you're a little girl or a +serpent?' + + `It matters a good deal to ME,' said Alice hastily; `but I'm +not looking for eggs, as it happens; and if I was, I shouldn't +want YOURS: I don't like them raw.' + + `Well, be off, then!' said the Pigeon in a sulky tone, as it +settled down again into its nest. Alice crouched down among the +trees as well as she could, for her neck kept getting entangled +among the branches, and every now and then she had to stop and +untwist it. After a while she remembered that she still held the +pieces of mushroom in her hands, and she set to work very +carefully, nibbling first at one and then at the other, and +growing sometimes taller and sometimes shorter, until she had +succeeded in bringing herself down to her usual height. + + It was so long since she had been anything near the right size, +that it felt quite strange at first; but she got used to it in a +few minutes, and began talking to herself, as usual. `Come, +there's half my plan done now! How puzzling all these changes +are! I'm never sure what I'm going to be, from one minute to +another! However, I've got back to my right size: the next +thing is, to get into that beautiful garden--how IS that to be +done, I wonder?' As she said this, she came suddenly upon an +open place, with a little house in it about four feet high. +`Whoever lives there,' thought Alice, `it'll never do to come +upon them THIS size: why, I should frighten them out of their +wits!' So she began nibbling at the righthand bit again, and did +not venture to go near the house till she had brought herself +down to nine inches high. + + + + CHAPTER VI + + Pig and Pepper + + + For a minute or two she stood looking at the house, and +wondering what to do next, when suddenly a footman in livery came +running out of the wood--(she considered him to be a footman +because he was in livery: otherwise, judging by his face only, +she would have called him a fish)--and rapped loudly at the door +with his knuckles. It was opened by another footman in livery, +with a round face, and large eyes like a frog; and both footmen, +Alice noticed, had powdered hair that curled all over their +heads. She felt very curious to know what it was all about, and +crept a little way out of the wood to listen. + + The Fish-Footman began by producing from under his arm a great +letter, nearly as large as himself, and this he handed over to +the other, saying, in a solemn tone, `For the Duchess. An +invitation from the Queen to play croquet.' The Frog-Footman +repeated, in the same solemn tone, only changing the order of the +words a little, `From the Queen. An invitation for the Duchess +to play croquet.' + + Then they both bowed low, and their curls got entangled +together. + + Alice laughed so much at this, that she had to run back into +the wood for fear of their hearing her; and when she next peeped +out the Fish-Footman was gone, and the other was sitting on the +ground near the door, staring stupidly up into the sky. + + Alice went timidly up to the door, and knocked. + + `There's no sort of use in knocking,' said the Footman, `and +that for two reasons. First, because I'm on the same side of the +door as you are; secondly, because they're making such a noise +inside, no one could possibly hear you.' And certainly there was +a most extraordinary noise going on within--a constant howling +and sneezing, and every now and then a great crash, as if a dish +or kettle had been broken to pieces. + + `Please, then,' said Alice, `how am I to get in?' + + `There might be some sense in your knocking,' the Footman went +on without attending to her, `if we had the door between us. For +instance, if you were INSIDE, you might knock, and I could let +you out, you know.' He was looking up into the sky all the time +he was speaking, and this Alice thought decidedly uncivil. `But +perhaps he can't help it,' she said to herself; `his eyes are so +VERY nearly at the top of his head. But at any rate he might +answer questions.--How am I to get in?' she repeated, aloud. + + `I shall sit here,' the Footman remarked, `till tomorrow--' + + At this moment the door of the house opened, and a large plate +came skimming out, straight at the Footman's head: it just +grazed his nose, and broke to pieces against one of the trees +behind him. + + `--or next day, maybe,' the Footman continued in the same tone, +exactly as if nothing had happened. + + `How am I to get in?' asked Alice again, in a louder tone. + + `ARE you to get in at all?' said the Footman. `That's the +first question, you know.' + + It was, no doubt: only Alice did not like to be told so. +`It's really dreadful,' she muttered to herself, `the way all the +creatures argue. It's enough to drive one crazy!' + + The Footman seemed to think this a good opportunity for +repeating his remark, with variations. `I shall sit here,' he +said, `on and off, for days and days.' + + `But what am I to do?' said Alice. + + `Anything you like,' said the Footman, and began whistling. + + `Oh, there's no use in talking to him,' said Alice desperately: +`he's perfectly idiotic!' And she opened the door and went in. + + The door led right into a large kitchen, which was full of +smoke from one end to the other: the Duchess was sitting on a +three-legged stool in the middle, nursing a baby; the cook was +leaning over the fire, stirring a large cauldron which seemed to +be full of soup. + + `There's certainly too much pepper in that soup!' Alice said to +herself, as well as she could for sneezing. + + There was certainly too much of it in the air. Even the +Duchess sneezed occasionally; and as for the baby, it was +sneezing and howling alternately without a moment's pause. The +only things in the kitchen that did not sneeze, were the cook, +and a large cat which was sitting on the hearth and grinning from +ear to ear. + + `Please would you tell me,' said Alice, a little timidly, for +she was not quite sure whether it was good manners for her to +speak first, `why your cat grins like that?' + + `It's a Cheshire cat,' said the Duchess, `and that's why. +Pig!' + + She said the last word with such sudden violence that Alice +quite jumped; but she saw in another moment that it was addressed +to the baby, and not to her, so she took courage, and went on +again:-- + + `I didn't know that Cheshire cats always grinned; in fact, I +didn't know that cats COULD grin.' + + `They all can,' said the Duchess; `and most of 'em do.' + + `I don't know of any that do,' Alice said very politely, +feeling quite pleased to have got into a conversation. + + `You don't know much,' said the Duchess; `and that's a fact.' + + Alice did not at all like the tone of this remark, and thought +it would be as well to introduce some other subject of +conversation. While she was trying to fix on one, the cook took +the cauldron of soup off the fire, and at once set to work +throwing everything within her reach at the Duchess and the baby +--the fire-irons came first; then followed a shower of saucepans, +plates, and dishes. The Duchess took no notice of them even when +they hit her; and the baby was howling so much already, that it +was quite impossible to say whether the blows hurt it or not. + + `Oh, PLEASE mind what you're doing!' cried Alice, jumping up +and down in an agony of terror. `Oh, there goes his PRECIOUS +nose'; as an unusually large saucepan flew close by it, and very +nearly carried it off. + + `If everybody minded their own business,' the Duchess said in a +hoarse growl, `the world would go round a deal faster than it +does.' + + `Which would NOT be an advantage,' said Alice, who felt very +glad to get an opportunity of showing off a little of her +knowledge. `Just think of what work it would make with the day +and night! You see the earth takes twenty-four hours to turn +round on its axis--' + + `Talking of axes,' said the Duchess, `chop off her head!' + + Alice glanced rather anxiously at the cook, to see if she meant +to take the hint; but the cook was busily stirring the soup, and +seemed not to be listening, so she went on again: `Twenty-four +hours, I THINK; or is it twelve? I--' + + `Oh, don't bother ME,' said the Duchess; `I never could abide +figures!' And with that she began nursing her child again, +singing a sort of lullaby to it as she did so, and giving it a +violent shake at the end of every line: + + `Speak roughly to your little boy, + And beat him when he sneezes: + He only does it to annoy, + Because he knows it teases.' + + CHORUS. + + (In which the cook and the baby joined):-- + + `Wow! wow! wow!' + + While the Duchess sang the second verse of the song, she kept +tossing the baby violently up and down, and the poor little thing +howled so, that Alice could hardly hear the words:-- + + `I speak severely to my boy, + I beat him when he sneezes; + For he can thoroughly enjoy + The pepper when he pleases!' + + CHORUS. + + `Wow! wow! wow!' + + `Here! you may nurse it a bit, if you like!' the Duchess said +to Alice, flinging the baby at her as she spoke. `I must go and +get ready to play croquet with the Queen,' and she hurried out of +the room. The cook threw a frying-pan after her as she went out, +but it just missed her. + + Alice caught the baby with some difficulty, as it was a queer- +shaped little creature, and held out its arms and legs in all +directions, `just like a star-fish,' thought Alice. The poor +little thing was snorting like a steam-engine when she caught it, +and kept doubling itself up and straightening itself out again, +so that altogether, for the first minute or two, it was as much +as she could do to hold it. + + As soon as she had made out the proper way of nursing it, +(which was to twist it up into a sort of knot, and then keep +tight hold of its right ear and left foot, so as to prevent its +undoing itself,) she carried it out into the open air. `IF I +don't take this child away with me,' thought Alice, `they're sure +to kill it in a day or two: wouldn't it be murder to leave it +behind?' She said the last words out loud, and the little thing +grunted in reply (it had left off sneezing by this time). `Don't +grunt,' said Alice; `that's not at all a proper way of expressing +yourself.' + + The baby grunted again, and Alice looked very anxiously into +its face to see what was the matter with it. There could be no +doubt that it had a VERY turn-up nose, much more like a snout +than a real nose; also its eyes were getting extremely small for +a baby: altogether Alice did not like the look of the thing at +all. `But perhaps it was only sobbing,' she thought, and looked +into its eyes again, to see if there were any tears. + + No, there were no tears. `If you're going to turn into a pig, +my dear,' said Alice, seriously, `I'll have nothing more to do +with you. Mind now!' The poor little thing sobbed again (or +grunted, it was impossible to say which), and they went on for +some while in silence. + + Alice was just beginning to think to herself, `Now, what am I +to do with this creature when I get it home?' when it grunted +again, so violently, that she looked down into its face in some +alarm. This time there could be NO mistake about it: it was +neither more nor less than a pig, and she felt that it would be +quite absurd for her to carry it further. + + So she set the little creature down, and felt quite relieved to +see it trot away quietly into the wood. `If it had grown up,' +she said to herself, `it would have made a dreadfully ugly child: +but it makes rather a handsome pig, I think.' And she began +thinking over other children she knew, who might do very well as +pigs, and was just saying to herself, `if one only knew the right +way to change them--' when she was a little startled by seeing +the Cheshire Cat sitting on a bough of a tree a few yards off. + + The Cat only grinned when it saw Alice. It looked good- +natured, she thought: still it had VERY long claws and a great +many teeth, so she felt that it ought to be treated with respect. + + `Cheshire Puss,' she began, rather timidly, as she did not at +all know whether it would like the name: however, it only +grinned a little wider. `Come, it's pleased so far,' thought +Alice, and she went on. `Would you tell me, please, which way I +ought to go from here?' + + `That depends a good deal on where you want to get to,' said +the Cat. + + `I don't much care where--' said Alice. + + `Then it doesn't matter which way you go,' said the Cat. + + `--so long as I get SOMEWHERE,' Alice added as an explanation. + + `Oh, you're sure to do that,' said the Cat, `if you only walk +long enough.' + + Alice felt that this could not be denied, so she tried another +question. `What sort of people live about here?' + + `In THAT direction,' the Cat said, waving its right paw round, +`lives a Hatter: and in THAT direction,' waving the other paw, +`lives a March Hare. Visit either you like: they're both mad.' + + `But I don't want to go among mad people,' Alice remarked. + + `Oh, you can't help that,' said the Cat: `we're all mad here. +I'm mad. You're mad.' + + `How do you know I'm mad?' said Alice. + + `You must be,' said the Cat, `or you wouldn't have come here.' + + Alice didn't think that proved it at all; however, she went on +`And how do you know that you're mad?' + + `To begin with,' said the Cat, `a dog's not mad. You grant +that?' + + `I suppose so,' said Alice. + + `Well, then,' the Cat went on, `you see, a dog growls when it's +angry, and wags its tail when it's pleased. Now I growl when I'm +pleased, and wag my tail when I'm angry. Therefore I'm mad.' + + `I call it purring, not growling,' said Alice. + + `Call it what you like,' said the Cat. `Do you play croquet +with the Queen to-day?' + + `I should like it very much,' said Alice, `but I haven't been +invited yet.' + + `You'll see me there,' said the Cat, and vanished. + + Alice was not much surprised at this, she was getting so used +to queer things happening. While she was looking at the place +where it had been, it suddenly appeared again. + + `By-the-bye, what became of the baby?' said the Cat. `I'd +nearly forgotten to ask.' + + `It turned into a pig,' Alice quietly said, just as if it had +come back in a natural way. + + `I thought it would,' said the Cat, and vanished again. + + Alice waited a little, half expecting to see it again, but it +did not appear, and after a minute or two she walked on in the +direction in which the March Hare was said to live. `I've seen +hatters before,' she said to herself; `the March Hare will be +much the most interesting, and perhaps as this is May it won't be +raving mad--at least not so mad as it was in March.' As she said +this, she looked up, and there was the Cat again, sitting on a +branch of a tree. + + `Did you say pig, or fig?' said the Cat. + + `I said pig,' replied Alice; `and I wish you wouldn't keep +appearing and vanishing so suddenly: you make one quite giddy.' + + `All right,' said the Cat; and this time it vanished quite +slowly, beginning with the end of the tail, and ending with the +grin, which remained some time after the rest of it had gone. + + `Well! I've often seen a cat without a grin,' thought Alice; +`but a grin without a cat! It's the most curious thing I ever +say in my life!' + + She had not gone much farther before she came in sight of the +house of the March Hare: she thought it must be the right house, +because the chimneys were shaped like ears and the roof was +thatched with fur. It was so large a house, that she did not +like to go nearer till she had nibbled some more of the lefthand +bit of mushroom, and raised herself to about two feet high: even +then she walked up towards it rather timidly, saying to herself +`Suppose it should be raving mad after all! I almost wish I'd +gone to see the Hatter instead!' + + + + CHAPTER VII + + A Mad Tea-Party + + + There was a table set out under a tree in front of the house, +and the March Hare and the Hatter were having tea at it: a +Dormouse was sitting between them, fast asleep, and the other two +were using it as a cushion, resting their elbows on it, and the +talking over its head. `Very uncomfortable for the Dormouse,' +thought Alice; `only, as it's asleep, I suppose it doesn't mind.' + + The table was a large one, but the three were all crowded +together at one corner of it: `No room! No room!' they cried +out when they saw Alice coming. `There's PLENTY of room!' said +Alice indignantly, and she sat down in a large arm-chair at one +end of the table. + + `Have some wine,' the March Hare said in an encouraging tone. + + Alice looked all round the table, but there was nothing on it +but tea. `I don't see any wine,' she remarked. + + `There isn't any,' said the March Hare. + + `Then it wasn't very civil of you to offer it,' said Alice +angrily. + + `It wasn't very civil of you to sit down without being +invited,' said the March Hare. + + `I didn't know it was YOUR table,' said Alice; `it's laid for a +great many more than three.' + + `Your hair wants cutting,' said the Hatter. He had been +looking at Alice for some time with great curiosity, and this was +his first speech. + + `You should learn not to make personal remarks,' Alice said +with some severity; `it's very rude.' + + The Hatter opened his eyes very wide on hearing this; but all +he SAID was, `Why is a raven like a writing-desk?' + + `Come, we shall have some fun now!' thought Alice. `I'm glad +they've begun asking riddles.--I believe I can guess that,' she +added aloud. + + `Do you mean that you think you can find out the answer to it?' +said the March Hare. + + `Exactly so,' said Alice. + + `Then you should say what you mean,' the March Hare went on. + + `I do,' Alice hastily replied; `at least--at least I mean what +I say--that's the same thing, you know.' + + `Not the same thing a bit!' said the Hatter. `You might just +as well say that "I see what I eat" is the same thing as "I eat +what I see"!' + + `You might just as well say,' added the March Hare, `that "I +like what I get" is the same thing as "I get what I like"!' + + `You might just as well say,' added the Dormouse, who seemed to +be talking in his sleep, `that "I breathe when I sleep" is the +same thing as "I sleep when I breathe"!' + + `It IS the same thing with you,' said the Hatter, and here the +conversation dropped, and the party sat silent for a minute, +while Alice thought over all she could remember about ravens and +writing-desks, which wasn't much. + + The Hatter was the first to break the silence. `What day of +the month is it?' he said, turning to Alice: he had taken his +watch out of his pocket, and was looking at it uneasily, shaking +it every now and then, and holding it to his ear. + + Alice considered a little, and then said `The fourth.' + + `Two days wrong!' sighed the Hatter. `I told you butter +wouldn't suit the works!' he added looking angrily at the March +Hare. + + `It was the BEST butter,' the March Hare meekly replied. + + `Yes, but some crumbs must have got in as well,' the Hatter +grumbled: `you shouldn't have put it in with the bread-knife.' + + The March Hare took the watch and looked at it gloomily: then +he dipped it into his cup of tea, and looked at it again: but he +could think of nothing better to say than his first remark, `It +was the BEST butter, you know.' + + Alice had been looking over his shoulder with some curiosity. +`What a funny watch!' she remarked. `It tells the day of the +month, and doesn't tell what o'clock it is!' + + `Why should it?' muttered the Hatter. `Does YOUR watch tell +you what year it is?' + + `Of course not,' Alice replied very readily: `but that's +because it stays the same year for such a long time together.' + + `Which is just the case with MINE,' said the Hatter. + + Alice felt dreadfully puzzled. The Hatter's remark seemed to +have no sort of meaning in it, and yet it was certainly English. +`I don't quite understand you,' she said, as politely as she +could. + + `The Dormouse is asleep again,' said the Hatter, and he poured +a little hot tea upon its nose. + + The Dormouse shook its head impatiently, and said, without +opening its eyes, `Of course, of course; just what I was going to +remark myself.' + + `Have you guessed the riddle yet?' the Hatter said, turning to +Alice again. + + `No, I give it up,' Alice replied: `what's the answer?' + + `I haven't the slightest idea,' said the Hatter. + + `Nor I,' said the March Hare. + + Alice sighed wearily. `I think you might do something better +with the time,' she said, `than waste it in asking riddles that +have no answers.' + + `If you knew Time as well as I do,' said the Hatter, `you +wouldn't talk about wasting IT. It's HIM.' + + `I don't know what you mean,' said Alice. + + `Of course you don't!' the Hatter said, tossing his head +contemptuously. `I dare say you never even spoke to Time!' + + `Perhaps not,' Alice cautiously replied: `but I know I have to +beat time when I learn music.' + + `Ah! that accounts for it,' said the Hatter. `He won't stand +beating. Now, if you only kept on good terms with him, he'd do +almost anything you liked with the clock. For instance, suppose +it were nine o'clock in the morning, just time to begin lessons: +you'd only have to whisper a hint to Time, and round goes the +clock in a twinkling! Half-past one, time for dinner!' + + (`I only wish it was,' the March Hare said to itself in a +whisper.) + + `That would be grand, certainly,' said Alice thoughtfully: +`but then--I shouldn't be hungry for it, you know.' + + `Not at first, perhaps,' said the Hatter: `but you could keep +it to half-past one as long as you liked.' + + `Is that the way YOU manage?' Alice asked. + + The Hatter shook his head mournfully. `Not I!' he replied. +`We quarrelled last March--just before HE went mad, you know--' +(pointing with his tea spoon at the March Hare,) `--it was at the +great concert given by the Queen of Hearts, and I had to sing + + "Twinkle, twinkle, little bat! + How I wonder what you're at!" + +You know the song, perhaps?' + + `I've heard something like it,' said Alice. + + `It goes on, you know,' the Hatter continued, `in this way:-- + + "Up above the world you fly, + Like a tea-tray in the sky. + Twinkle, twinkle--"' + +Here the Dormouse shook itself, and began singing in its sleep +`Twinkle, twinkle, twinkle, twinkle--' and went on so long that +they had to pinch it to make it stop. + + `Well, I'd hardly finished the first verse,' said the Hatter, +`when the Queen jumped up and bawled out, "He's murdering the +time! Off with his head!"' + + `How dreadfully savage!' exclaimed Alice. + + `And ever since that,' the Hatter went on in a mournful tone, +`he won't do a thing I ask! It's always six o'clock now.' + + A bright idea came into Alice's head. `Is that the reason so +many tea-things are put out here?' she asked. + + `Yes, that's it,' said the Hatter with a sigh: `it's always +tea-time, and we've no time to wash the things between whiles.' + + `Then you keep moving round, I suppose?' said Alice. + + `Exactly so,' said the Hatter: `as the things get used up.' + + `But what happens when you come to the beginning again?' Alice +ventured to ask. + + `Suppose we change the subject,' the March Hare interrupted, +yawning. `I'm getting tired of this. I vote the young lady +tells us a story.' + + `I'm afraid I don't know one,' said Alice, rather alarmed at +the proposal. + + `Then the Dormouse shall!' they both cried. `Wake up, +Dormouse!' And they pinched it on both sides at once. + + The Dormouse slowly opened his eyes. `I wasn't asleep,' he +said in a hoarse, feeble voice: `I heard every word you fellows +were saying.' + + `Tell us a story!' said the March Hare. + + `Yes, please do!' pleaded Alice. + + `And be quick about it,' added the Hatter, `or you'll be asleep +again before it's done.' + + `Once upon a time there were three little sisters,' the +Dormouse began in a great hurry; `and their names were Elsie, +Lacie, and Tillie; and they lived at the bottom of a well--' + + `What did they live on?' said Alice, who always took a great +interest in questions of eating and drinking. + + `They lived on treacle,' said the Dormouse, after thinking a +minute or two. + + `They couldn't have done that, you know,' Alice gently +remarked; `they'd have been ill.' + + `So they were,' said the Dormouse; `VERY ill.' + + Alice tried to fancy to herself what such an extraordinary ways +of living would be like, but it puzzled her too much, so she went +on: `But why did they live at the bottom of a well?' + + `Take some more tea,' the March Hare said to Alice, very +earnestly. + + `I've had nothing yet,' Alice replied in an offended tone, `so +I can't take more.' + + `You mean you can't take LESS,' said the Hatter: `it's very +easy to take MORE than nothing.' + + `Nobody asked YOUR opinion,' said Alice. + + `Who's making personal remarks now?' the Hatter asked +triumphantly. + + Alice did not quite know what to say to this: so she helped +herself to some tea and bread-and-butter, and then turned to the +Dormouse, and repeated her question. `Why did they live at the +bottom of a well?' + + The Dormouse again took a minute or two to think about it, and +then said, `It was a treacle-well.' + + `There's no such thing!' Alice was beginning very angrily, but +the Hatter and the March Hare went `Sh! sh!' and the Dormouse +sulkily remarked, `If you can't be civil, you'd better finish the +story for yourself.' + + `No, please go on!' Alice said very humbly; `I won't interrupt +again. I dare say there may be ONE.' + + `One, indeed!' said the Dormouse indignantly. However, he +consented to go on. `And so these three little sisters--they +were learning to draw, you know--' + + `What did they draw?' said Alice, quite forgetting her promise. + + `Treacle,' said the Dormouse, without considering at all this +time. + + `I want a clean cup,' interrupted the Hatter: `let's all move +one place on.' + + He moved on as he spoke, and the Dormouse followed him: the +March Hare moved into the Dormouse's place, and Alice rather +unwillingly took the place of the March Hare. The Hatter was the +only one who got any advantage from the change: and Alice was a +good deal worse off than before, as the March Hare had just upset +the milk-jug into his plate. + + Alice did not wish to offend the Dormouse again, so she began +very cautiously: `But I don't understand. Where did they draw +the treacle from?' + + `You can draw water out of a water-well,' said the Hatter; `so +I should think you could draw treacle out of a treacle-well--eh, +stupid?' + + `But they were IN the well,' Alice said to the Dormouse, not +choosing to notice this last remark. + + `Of course they were', said the Dormouse; `--well in.' + + This answer so confused poor Alice, that she let the Dormouse +go on for some time without interrupting it. + + `They were learning to draw,' the Dormouse went on, yawning and +rubbing its eyes, for it was getting very sleepy; `and they drew +all manner of things--everything that begins with an M--' + + `Why with an M?' said Alice. + + `Why not?' said the March Hare. + + Alice was silent. + + The Dormouse had closed its eyes by this time, and was going +off into a doze; but, on being pinched by the Hatter, it woke up +again with a little shriek, and went on: `--that begins with an +M, such as mouse-traps, and the moon, and memory, and muchness-- +you know you say things are "much of a muchness"--did you ever +see such a thing as a drawing of a muchness?' + + `Really, now you ask me,' said Alice, very much confused, `I +don't think--' + + `Then you shouldn't talk,' said the Hatter. + + This piece of rudeness was more than Alice could bear: she got +up in great disgust, and walked off; the Dormouse fell asleep +instantly, and neither of the others took the least notice of her +going, though she looked back once or twice, half hoping that +they would call after her: the last time she saw them, they were +trying to put the Dormouse into the teapot. + + `At any rate I'll never go THERE again!' said Alice as she +picked her way through the wood. `It's the stupidest tea-party I +ever was at in all my life!' + + Just as she said this, she noticed that one of the trees had a +door leading right into it. `That's very curious!' she thought. +`But everything's curious today. I think I may as well go in at +once.' And in she went. + + Once more she found herself in the long hall, and close to the +little glass table. `Now, I'll manage better this time,' she +said to herself, and began by taking the little golden key, and +unlocking the door that led into the garden. Then she went to +work nibbling at the mushroom (she had kept a piece of it in her +pocked) till she was about a foot high: then she walked down the +little passage: and THEN--she found herself at last in the +beautiful garden, among the bright flower-beds and the cool +fountains. + + + + CHAPTER VIII + + The Queen's Croquet-Ground + + + A large rose-tree stood near the entrance of the garden: the +roses growing on it were white, but there were three gardeners at +it, busily painting them red. Alice thought this a very curious +thing, and she went nearer to watch them, and just as she came up +to them she heard one of them say, `Look out now, Five! Don't go +splashing paint over me like that!' + + `I couldn't help it,' said Five, in a sulky tone; `Seven jogged +my elbow.' + + On which Seven looked up and said, `That's right, Five! Always +lay the blame on others!' + + `YOU'D better not talk!' said Five. `I heard the Queen say only +yesterday you deserved to be beheaded!' + + `What for?' said the one who had spoken first. + + `That's none of YOUR business, Two!' said Seven. + + `Yes, it IS his business!' said Five, `and I'll tell him--it +was for bringing the cook tulip-roots instead of onions.' + + Seven flung down his brush, and had just begun `Well, of all +the unjust things--' when his eye chanced to fall upon Alice, as +she stood watching them, and he checked himself suddenly: the +others looked round also, and all of them bowed low. + + `Would you tell me,' said Alice, a little timidly, `why you are +painting those roses?' + + Five and Seven said nothing, but looked at Two. Two began in a +low voice, `Why the fact is, you see, Miss, this here ought to +have been a RED rose-tree, and we put a white one in by mistake; +and if the Queen was to find it out, we should all have our heads +cut off, you know. So you see, Miss, we're doing our best, afore +she comes, to--' At this moment Five, who had been anxiously +looking across the garden, called out `The Queen! The Queen!' +and the three gardeners instantly threw themselves flat upon +their faces. There was a sound of many footsteps, and Alice +looked round, eager to see the Queen. + + First came ten soldiers carrying clubs; these were all shaped +like the three gardeners, oblong and flat, with their hands and +feet at the corners: next the ten courtiers; these were +ornamented all over with diamonds, and walked two and two, as the +soldiers did. After these came the royal children; there were +ten of them, and the little dears came jumping merrily along hand +in hand, in couples: they were all ornamented with hearts. Next +came the guests, mostly Kings and Queens, and among them Alice +recognised the White Rabbit: it was talking in a hurried nervous +manner, smiling at everything that was said, and went by without +noticing her. Then followed the Knave of Hearts, carrying the +King's crown on a crimson velvet cushion; and, last of all this +grand procession, came THE KING AND QUEEN OF HEARTS. + + Alice was rather doubtful whether she ought not to lie down on +her face like the three gardeners, but she could not remember +every having heard of such a rule at processions; `and besides, +what would be the use of a procession,' thought she, `if people +had all to lie down upon their faces, so that they couldn't see +it?' So she stood still where she was, and waited. + + When the procession came opposite to Alice, they all stopped +and looked at her, and the Queen said severely `Who is this?' +She said it to the Knave of Hearts, who only bowed and smiled in +reply. + + `Idiot!' said the Queen, tossing her head impatiently; and, +turning to Alice, she went on, `What's your name, child?' + + `My name is Alice, so please your Majesty,' said Alice very +politely; but she added, to herself, `Why, they're only a pack of +cards, after all. I needn't be afraid of them!' + + `And who are THESE?' said the Queen, pointing to the three +gardeners who were lying round the rosetree; for, you see, as +they were lying on their faces, and the pattern on their backs +was the same as the rest of the pack, she could not tell whether +they were gardeners, or soldiers, or courtiers, or three of her +own children. + + `How should I know?' said Alice, surprised at her own courage. +`It's no business of MINE.' + + The Queen turned crimson with fury, and, after glaring at her +for a moment like a wild beast, screamed `Off with her head! +Off--' + + `Nonsense!' said Alice, very loudly and decidedly, and the +Queen was silent. + + The King laid his hand upon her arm, and timidly said +`Consider, my dear: she is only a child!' + + The Queen turned angrily away from him, and said to the Knave +`Turn them over!' + + The Knave did so, very carefully, with one foot. + + `Get up!' said the Queen, in a shrill, loud voice, and the +three gardeners instantly jumped up, and began bowing to the +King, the Queen, the royal children, and everybody else. + + `Leave off that!' screamed the Queen. `You make me giddy.' +And then, turning to the rose-tree, she went on, `What HAVE you +been doing here?' + + `May it please your Majesty,' said Two, in a very humble tone, +going down on one knee as he spoke, `we were trying--' + + `I see!' said the Queen, who had meanwhile been examining the +roses. `Off with their heads!' and the procession moved on, +three of the soldiers remaining behind to execute the unfortunate +gardeners, who ran to Alice for protection. + + `You shan't be beheaded!' said Alice, and she put them into a +large flower-pot that stood near. The three soldiers wandered +about for a minute or two, looking for them, and then quietly +marched off after the others. + + `Are their heads off?' shouted the Queen. + + `Their heads are gone, if it please your Majesty!' the soldiers +shouted in reply. + + `That's right!' shouted the Queen. `Can you play croquet?' + + The soldiers were silent, and looked at Alice, as the question +was evidently meant for her. + + `Yes!' shouted Alice. + + `Come on, then!' roared the Queen, and Alice joined the +procession, wondering very much what would happen next. + + `It's--it's a very fine day!' said a timid voice at her side. +She was walking by the White Rabbit, who was peeping anxiously +into her face. + + `Very,' said Alice: `--where's the Duchess?' + + `Hush! Hush!' said the Rabbit in a low, hurried tone. He +looked anxiously over his shoulder as he spoke, and then raised +himself upon tiptoe, put his mouth close to her ear, and +whispered `She's under sentence of execution.' + + `What for?' said Alice. + + `Did you say "What a pity!"?' the Rabbit asked. + + `No, I didn't,' said Alice: `I don't think it's at all a pity. +I said "What for?"' + + `She boxed the Queen's ears--' the Rabbit began. Alice gave a +little scream of laughter. `Oh, hush!' the Rabbit whispered in a +frightened tone. `The Queen will hear you! You see, she came +rather late, and the Queen said--' + + `Get to your places!' shouted the Queen in a voice of thunder, +and people began running about in all directions, tumbling up +against each other; however, they got settled down in a minute or +two, and the game began. Alice thought she had never seen such a +curious croquet-ground in her life; it was all ridges and +furrows; the balls were live hedgehogs, the mallets live +flamingoes, and the soldiers had to double themselves up and to +stand on their hands and feet, to make the arches. + + The chief difficulty Alice found at first was in managing her +flamingo: she succeeded in getting its body tucked away, +comfortably enough, under her arm, with its legs hanging down, +but generally, just as she had got its neck nicely straightened +out, and was going to give the hedgehog a blow with its head, it +WOULD twist itself round and look up in her face, with such a +puzzled expression that she could not help bursting out laughing: +and when she had got its head down, and was going to begin again, +it was very provoking to find that the hedgehog had unrolled +itself, and was in the act of crawling away: besides all this, +there was generally a ridge or furrow in the way wherever she +wanted to send the hedgehog to, and, as the doubled-up soldiers +were always getting up and walking off to other parts of the +ground, Alice soon came to the conclusion that it was a very +difficult game indeed. + + The players all played at once without waiting for turns, +quarrelling all the while, and fighting for the hedgehogs; and in +a very short time the Queen was in a furious passion, and went +stamping about, and shouting `Off with his head!' or `Off with +her head!' about once in a minute. + + Alice began to feel very uneasy: to be sure, she had not as +yet had any dispute with the Queen, but she knew that it might +happen any minute, `and then,' thought she, `what would become of +me? They're dreadfully fond of beheading people here; the great +wonder is, that there's any one left alive!' + + She was looking about for some way of escape, and wondering +whether she could get away without being seen, when she noticed a +curious appearance in the air: it puzzled her very much at +first, but, after watching it a minute or two, she made it out to +be a grin, and she said to herself `It's the Cheshire Cat: now I +shall have somebody to talk to.' + + `How are you getting on?' said the Cat, as soon as there was +mouth enough for it to speak with. + + Alice waited till the eyes appeared, and then nodded. `It's no +use speaking to it,' she thought, `till its ears have come, or at +least one of them.' In another minute the whole head appeared, +and then Alice put down her flamingo, and began an account of the +game, feeling very glad she had someone to listen to her. The +Cat seemed to think that there was enough of it now in sight, and +no more of it appeared. + + `I don't think they play at all fairly,' Alice began, in rather +a complaining tone, `and they all quarrel so dreadfully one can't +hear oneself speak--and they don't seem to have any rules in +particular; at least, if there are, nobody attends to them--and +you've no idea how confusing it is all the things being alive; +for instance, there's the arch I've got to go through next +walking about at the other end of the ground--and I should have +croqueted the Queen's hedgehog just now, only it ran away when it +saw mine coming!' + + `How do you like the Queen?' said the Cat in a low voice. + + `Not at all,' said Alice: `she's so extremely--' Just then +she noticed that the Queen was close behind her, listening: so +she went on, `--likely to win, that it's hardly worth while +finishing the game.' + + The Queen smiled and passed on. + + `Who ARE you talking to?' said the King, going up to Alice, and +looking at the Cat's head with great curiosity. + + `It's a friend of mine--a Cheshire Cat,' said Alice: `allow me +to introduce it.' + + `I don't like the look of it at all,' said the King: `however, +it may kiss my hand if it likes.' + + `I'd rather not,' the Cat remarked. + + `Don't be impertinent,' said the King, `and don't look at me +like that!' He got behind Alice as he spoke. + + `A cat may look at a king,' said Alice. `I've read that in +some book, but I don't remember where.' + + `Well, it must be removed,' said the King very decidedly, and +he called the Queen, who was passing at the moment, `My dear! I +wish you would have this cat removed!' + + The Queen had only one way of settling all difficulties, great +or small. `Off with his head!' she said, without even looking +round. + + `I'll fetch the executioner myself,' said the King eagerly, and +he hurried off. + + Alice thought she might as well go back, and see how the game +was going on, as she heard the Queen's voice in the distance, +screaming with passion. She had already heard her sentence three +of the players to be executed for having missed their turns, and +she did not like the look of things at all, as the game was in +such confusion that she never knew whether it was her turn or +not. So she went in search of her hedgehog. + + The hedgehog was engaged in a fight with another hedgehog, +which seemed to Alice an excellent opportunity for croqueting one +of them with the other: the only difficulty was, that her +flamingo was gone across to the other side of the garden, where +Alice could see it trying in a helpless sort of way to fly up +into a tree. + + By the time she had caught the flamingo and brought it back, +the fight was over, and both the hedgehogs were out of sight: +`but it doesn't matter much,' thought Alice, `as all the arches +are gone from this side of the ground.' So she tucked it away +under her arm, that it might not escape again, and went back for +a little more conversation with her friend. + + When she got back to the Cheshire Cat, she was surprised to +find quite a large crowd collected round it: there was a dispute +going on between the executioner, the King, and the Queen, who +were all talking at once, while all the rest were quite silent, +and looked very uncomfortable. + + The moment Alice appeared, she was appealed to by all three to +settle the question, and they repeated their arguments to her, +though, as they all spoke at once, she found it very hard indeed +to make out exactly what they said. + + The executioner's argument was, that you couldn't cut off a +head unless there was a body to cut it off from: that he had +never had to do such a thing before, and he wasn't going to begin +at HIS time of life. + + The King's argument was, that anything that had a head could be +beheaded, and that you weren't to talk nonsense. + + The Queen's argument was, that if something wasn't done about +it in less than no time she'd have everybody executed, all round. +(It was this last remark that had made the whole party look so +grave and anxious.) + + Alice could think of nothing else to say but `It belongs to the +Duchess: you'd better ask HER about it.' + + `She's in prison,' the Queen said to the executioner: `fetch +her here.' And the executioner went off like an arrow. + + The Cat's head began fading away the moment he was gone, and, +by the time he had come back with the Dutchess, it had entirely +disappeared; so the King and the executioner ran wildly up and +down looking for it, while the rest of the party went back to the game. + + + + CHAPTER IX + + The Mock Turtle's Story + + + `You can't think how glad I am to see you again, you dear old +thing!' said the Duchess, as she tucked her arm affectionately +into Alice's, and they walked off together. + + Alice was very glad to find her in such a pleasant temper, and +thought to herself that perhaps it was only the pepper that had +made her so savage when they met in the kitchen. + + `When I'M a Duchess,' she said to herself, (not in a very +hopeful tone though), `I won't have any pepper in my kitchen AT +ALL. Soup does very well without--Maybe it's always pepper that +makes people hot-tempered,' she went on, very much pleased at +having found out a new kind of rule, `and vinegar that makes them +sour--and camomile that makes them bitter--and--and barley-sugar +and such things that make children sweet-tempered. I only wish +people knew that: then they wouldn't be so stingy about it, you +know--' + + She had quite forgotten the Duchess by this time, and was a +little startled when she heard her voice close to her ear. +`You're thinking about something, my dear, and that makes you +forget to talk. I can't tell you just now what the moral of that +is, but I shall remember it in a bit.' + + `Perhaps it hasn't one,' Alice ventured to remark. + + `Tut, tut, child!' said the Duchess. `Everything's got a +moral, if only you can find it.' And she squeezed herself up +closer to Alice's side as she spoke. + + Alice did not much like keeping so close to her: first, +because the Duchess was VERY ugly; and secondly, because she was +exactly the right height to rest her chin upon Alice's shoulder, +and it was an uncomfortably sharp chin. However, she did not +like to be rude, so she bore it as well as she could. + + `The game's going on rather better now,' she said, by way of +keeping up the conversation a little. + + `'Tis so,' said the Duchess: `and the moral of that is--"Oh, +'tis love, 'tis love, that makes the world go round!"' + + `Somebody said,' Alice whispered, `that it's done by everybody +minding their own business!' + + `Ah, well! It means much the same thing,' said the Duchess, +digging her sharp little chin into Alice's shoulder as she added, +`and the moral of THAT is--"Take care of the sense, and the +sounds will take care of themselves."' + + `How fond she is of finding morals in things!' Alice thought to +herself. + + `I dare say you're wondering why I don't put my arm round your +waist,' the Duchess said after a pause: `the reason is, that I'm +doubtful about the temper of your flamingo. Shall I try the +experiment?' + + `HE might bite,' Alice cautiously replied, not feeling at all +anxious to have the experiment tried. + + `Very true,' said the Duchess: `flamingoes and mustard both +bite. And the moral of that is--"Birds of a feather flock +together."' + + `Only mustard isn't a bird,' Alice remarked. + + `Right, as usual,' said the Duchess: `what a clear way you +have of putting things!' + + `It's a mineral, I THINK,' said Alice. + + `Of course it is,' said the Duchess, who seemed ready to agree +to everything that Alice said; `there's a large mustard-mine near +here. And the moral of that is--"The more there is of mine, the +less there is of yours."' + + `Oh, I know!' exclaimed Alice, who had not attended to this +last remark, `it's a vegetable. It doesn't look like one, but it +is.' + + `I quite agree with you,' said the Duchess; `and the moral of +that is--"Be what you would seem to be"--or if you'd like it put +more simply--"Never imagine yourself not to be otherwise than +what it might appear to others that what you were or might have +been was not otherwise than what you had been would have appeared +to them to be otherwise."' + + `I think I should understand that better,' Alice said very +politely, `if I had it written down: but I can't quite follow it +as you say it.' + + `That's nothing to what I could say if I chose,' the Duchess +replied, in a pleased tone. + + `Pray don't trouble yourself to say it any longer than that,' +said Alice. + + `Oh, don't talk about trouble!' said the Duchess. `I make you +a present of everything I've said as yet.' + + `A cheap sort of present!' thought Alice. `I'm glad they don't +give birthday presents like that!' But she did not venture to +say it out loud. + + `Thinking again?' the Duchess asked, with another dig of her +sharp little chin. + + `I've a right to think,' said Alice sharply, for she was +beginning to feel a little worried. + + `Just about as much right,' said the Duchess, `as pigs have to +fly; and the m--' + + But here, to Alice's great surprise, the Duchess's voice died +away, even in the middle of her favourite word `moral,' and the +arm that was linked into hers began to tremble. Alice looked up, +and there stood the Queen in front of them, with her arms folded, +frowning like a thunderstorm. + + `A fine day, your Majesty!' the Duchess began in a low, weak +voice. + + `Now, I give you fair warning,' shouted the Queen, stamping on +the ground as she spoke; `either you or your head must be off, +and that in about half no time! Take your choice!' + + The Duchess took her choice, and was gone in a moment. + + `Let's go on with the game,' the Queen said to Alice; and Alice +was too much frightened to say a word, but slowly followed her +back to the croquet-ground. + + The other guests had taken advantage of the Queen's absence, +and were resting in the shade: however, the moment they saw her, +they hurried back to the game, the Queen merely remarking that a +moment's delay would cost them their lives. + + All the time they were playing the Queen never left off +quarrelling with the other players, and shouting `Off with his +head!' or `Off with her head!' Those whom she sentenced were +taken into custody by the soldiers, who of course had to leave +off being arches to do this, so that by the end of half an hour +or so there were no arches left, and all the players, except the +King, the Queen, and Alice, were in custody and under sentence of +execution. + + Then the Queen left off, quite out of breath, and said to +Alice, `Have you seen the Mock Turtle yet?' + + `No,' said Alice. `I don't even know what a Mock Turtle is.' + + `It's the thing Mock Turtle Soup is made from,' said the Queen. + + `I never saw one, or heard of one,' said Alice. + + `Come on, then,' said the Queen, `and he shall tell you his +history,' + + As they walked off together, Alice heard the King say in a low +voice, to the company generally, `You are all pardoned.' `Come, +THAT'S a good thing!' she said to herself, for she had felt quite +unhappy at the number of executions the Queen had ordered. + + They very soon came upon a Gryphon, lying fast asleep in the +sun. (IF you don't know what a Gryphon is, look at the picture.) +`Up, lazy thing!' said the Queen, `and take this young lady to +see the Mock Turtle, and to hear his history. I must go back and +see after some executions I have ordered'; and she walked off, +leaving Alice alone with the Gryphon. Alice did not quite like +the look of the creature, but on the whole she thought it would +be quite as safe to stay with it as to go after that savage +Queen: so she waited. + + The Gryphon sat up and rubbed its eyes: then it watched the +Queen till she was out of sight: then it chuckled. `What fun!' +said the Gryphon, half to itself, half to Alice. + + `What IS the fun?' said Alice. + + `Why, SHE,' said the Gryphon. `It's all her fancy, that: they +never executes nobody, you know. Come on!' + + `Everybody says "come on!" here,' thought Alice, as she went +slowly after it: `I never was so ordered about in all my life, +never!' + + They had not gone far before they saw the Mock Turtle in the +distance, sitting sad and lonely on a little ledge of rock, and, +as they came nearer, Alice could hear him sighing as if his heart +would break. She pitied him deeply. `What is his sorrow?' she +asked the Gryphon, and the Gryphon answered, very nearly in the +same words as before, `It's all his fancy, that: he hasn't got +no sorrow, you know. Come on!' + + So they went up to the Mock Turtle, who looked at them with +large eyes full of tears, but said nothing. + + `This here young lady,' said the Gryphon, `she wants for to +know your history, she do.' + + `I'll tell it her,' said the Mock Turtle in a deep, hollow +tone: `sit down, both of you, and don't speak a word till I've +finished.' + + So they sat down, and nobody spoke for some minutes. Alice +thought to herself, `I don't see how he can EVEN finish, if he +doesn't begin.' But she waited patiently. + + `Once,' said the Mock Turtle at last, with a deep sigh, `I was +a real Turtle.' + + These words were followed by a very long silence, broken only +by an occasional exclamation of `Hjckrrh!' from the Gryphon, and +the constant heavy sobbing of the Mock Turtle. Alice was very +nearly getting up and saying, `Thank you, sir, for your +interesting story,' but she could not help thinking there MUST be +more to come, so she sat still and said nothing. + + `When we were little,' the Mock Turtle went on at last, more +calmly, though still sobbing a little now and then, `we went to +school in the sea. The master was an old Turtle--we used to call +him Tortoise--' + + `Why did you call him Tortoise, if he wasn't one?' Alice asked. + + `We called him Tortoise because he taught us,' said the Mock +Turtle angrily: `really you are very dull!' + + `You ought to be ashamed of yourself for asking such a simple +question,' added the Gryphon; and then they both sat silent and +looked at poor Alice, who felt ready to sink into the earth. At +last the Gryphon said to the Mock Turtle, `Drive on, old fellow! +Don't be all day about it!' and he went on in these words: + + `Yes, we went to school in the sea, though you mayn't believe +it--' + + `I never said I didn't!' interrupted Alice. + + `You did,' said the Mock Turtle. + + `Hold your tongue!' added the Gryphon, before Alice could speak +again. The Mock Turtle went on. + + `We had the best of educations--in fact, we went to school +every day--' + + `I'VE been to a day-school, too,' said Alice; `you needn't be +so proud as all that.' + + `With extras?' asked the Mock Turtle a little anxiously. + + `Yes,' said Alice, `we learned French and music.' + + `And washing?' said the Mock Turtle. + + `Certainly not!' said Alice indignantly. + + `Ah! then yours wasn't a really good school,' said the Mock +Turtle in a tone of great relief. `Now at OURS they had at the +end of the bill, "French, music, AND WASHING--extra."' + + `You couldn't have wanted it much,' said Alice; `living at the +bottom of the sea.' + + `I couldn't afford to learn it.' said the Mock Turtle with a +sigh. `I only took the regular course.' + + `What was that?' inquired Alice. + + `Reeling and Writhing, of course, to begin with,' the Mock +Turtle replied; `and then the different branches of Arithmetic-- +Ambition, Distraction, Uglification, and Derision.' + + `I never heard of "Uglification,"' Alice ventured to say. `What +is it?' + + The Gryphon lifted up both its paws in surprise. `What! Never +heard of uglifying!' it exclaimed. `You know what to beautify +is, I suppose?' + + `Yes,' said Alice doubtfully: `it means--to--make--anything-- +prettier.' + + `Well, then,' the Gryphon went on, `if you don't know what to +uglify is, you ARE a simpleton.' + + Alice did not feel encouraged to ask any more questions about +it, so she turned to the Mock Turtle, and said `What else had you +to learn?' + + `Well, there was Mystery,' the Mock Turtle replied, counting +off the subjects on his flappers, `--Mystery, ancient and modern, +with Seaography: then Drawling--the Drawling-master was an old +conger-eel, that used to come once a week: HE taught us +Drawling, Stretching, and Fainting in Coils.' + + `What was THAT like?' said Alice. + + `Well, I can't show it you myself,' the Mock Turtle said: `I'm +too stiff. And the Gryphon never learnt it.' + + `Hadn't time,' said the Gryphon: `I went to the Classics +master, though. He was an old crab, HE was.' + + `I never went to him,' the Mock Turtle said with a sigh: `he +taught Laughing and Grief, they used to say.' + + `So he did, so he did,' said the Gryphon, sighing in his turn; +and both creatures hid their faces in their paws. + + `And how many hours a day did you do lessons?' said Alice, in a +hurry to change the subject. + + `Ten hours the first day,' said the Mock Turtle: `nine the +next, and so on.' + + `What a curious plan!' exclaimed Alice. + + `That's the reason they're called lessons,' the Gryphon +remarked: `because they lessen from day to day.' + + This was quite a new idea to Alice, and she thought it over a +little before she made her next remark. `Then the eleventh day +must have been a holiday?' + + `Of course it was,' said the Mock Turtle. + + `And how did you manage on the twelfth?' Alice went on eagerly. + + `That's enough about lessons,' the Gryphon interrupted in a +very decided tone: `tell her something about the games now.' + + + + CHAPTER X + + The Lobster Quadrille + + + The Mock Turtle sighed deeply, and drew the back of one flapper +across his eyes. He looked at Alice, and tried to speak, but for +a minute or two sobs choked his voice. `Same as if he had a bone +in his throat,' said the Gryphon: and it set to work shaking him +and punching him in the back. At last the Mock Turtle recovered +his voice, and, with tears running down his cheeks, he went on +again:-- + + `You may not have lived much under the sea--' (`I haven't,' +said Alice)--`and perhaps you were never even introduced to a lobster--' +(Alice began to say `I once tasted--' but checked herself hastily, +and said `No, never') `--so you can have no idea what a delightful +thing a Lobster Quadrille is!' + + `No, indeed,' said Alice. `What sort of a dance is it?' + + `Why,' said the Gryphon, `you first form into a line along the +sea-shore--' + + `Two lines!' cried the Mock Turtle. `Seals, turtles, salmon, +and so on; then, when you've cleared all the jelly-fish out of +the way--' + + `THAT generally takes some time,' interrupted the Gryphon. + + `--you advance twice--' + + `Each with a lobster as a partner!' cried the Gryphon. + + `Of course,' the Mock Turtle said: `advance twice, set to +partners--' + + `--change lobsters, and retire in same order,' continued the +Gryphon. + + `Then, you know,' the Mock Turtle went on, `you throw the--' + + `The lobsters!' shouted the Gryphon, with a bound into the air. + + `--as far out to sea as you can--' + + `Swim after them!' screamed the Gryphon. + + `Turn a somersault in the sea!' cried the Mock Turtle, +capering wildly about. + + `Back to land again, and that's all the first figure,' said the +Mock Turtle, suddenly dropping his voice; and the two creatures, +who had been jumping about like mad things all this time, sat +down again very sadly and quietly, and looked at Alice. + + `It must be a very pretty dance,' said Alice timidly. + + `Would you like to see a little of it?' said the Mock Turtle. + + `Very much indeed,' said Alice. + + `Come, let's try the first figure!' said the Mock Turtle to the +Gryphon. `We can do without lobsters, you know. Which shall +sing?' + + `Oh, YOU sing,' said the Gryphon. `I've forgotten the words.' + + So they began solemnly dancing round and round Alice, every now +and then treading on her toes when they passed too close, and +waving their forepaws to mark the time, while the Mock Turtle +sang this, very slowly and sadly:-- + + +`"Will you walk a little faster?" said a whiting to a snail. +"There's a porpoise close behind us, and he's treading on my + tail. +See how eagerly the lobsters and the turtles all advance! +They are waiting on the shingle--will you come and join the +dance? + +Will you, won't you, will you, won't you, will you join the +dance? +Will you, won't you, will you, won't you, won't you join the +dance? + + +"You can really have no notion how delightful it will be +When they take us up and throw us, with the lobsters, out to + sea!" +But the snail replied "Too far, too far!" and gave a look + askance-- +Said he thanked the whiting kindly, but he would not join the + dance. + Would not, could not, would not, could not, would not join + the dance. + Would not, could not, would not, could not, could not join + the dance. + +`"What matters it how far we go?" his scaly friend replied. +"There is another shore, you know, upon the other side. +The further off from England the nearer is to France-- +Then turn not pale, beloved snail, but come and join the dance. + + Will you, won't you, will you, won't you, will you join the + dance? + Will you, won't you, will you, won't you, won't you join the + dance?"' + + + + `Thank you, it's a very interesting dance to watch,' said +Alice, feeling very glad that it was over at last: `and I do so +like that curious song about the whiting!' + + `Oh, as to the whiting,' said the Mock Turtle, `they--you've +seen them, of course?' + + `Yes,' said Alice, `I've often seen them at dinn--' she +checked herself hastily. + + `I don't know where Dinn may be,' said the Mock Turtle, `but +if you've seen them so often, of course you know what they're +like.' + + `I believe so,' Alice replied thoughtfully. `They have their +tails in their mouths--and they're all over crumbs.' + + `You're wrong about the crumbs,' said the Mock Turtle: +`crumbs would all wash off in the sea. But they HAVE their tails +in their mouths; and the reason is--' here the Mock Turtle +yawned and shut his eyes.--`Tell her about the reason and all +that,' he said to the Gryphon. + + `The reason is,' said the Gryphon, `that they WOULD go with +the lobsters to the dance. So they got thrown out to sea. So +they had to fall a long way. So they got their tails fast in +their mouths. So they couldn't get them out again. That's all.' + + `Thank you,' said Alice, `it's very interesting. I never knew +so much about a whiting before.' + + `I can tell you more than that, if you like,' said the +Gryphon. `Do you know why it's called a whiting?' + + `I never thought about it,' said Alice. `Why?' + + `IT DOES THE BOOTS AND SHOES.' the Gryphon replied very +solemnly. + + Alice was thoroughly puzzled. `Does the boots and shoes!' she +repeated in a wondering tone. + + `Why, what are YOUR shoes done with?' said the Gryphon. `I +mean, what makes them so shiny?' + + Alice looked down at them, and considered a little before she +gave her answer. `They're done with blacking, I believe.' + + `Boots and shoes under the sea,' the Gryphon went on in a deep +voice, `are done with a whiting. Now you know.' + + `And what are they made of?' Alice asked in a tone of great +curiosity. + + `Soles and eels, of course,' the Gryphon replied rather +impatiently: `any shrimp could have told you that.' + + `If I'd been the whiting,' said Alice, whose thoughts were +still running on the song, `I'd have said to the porpoise, "Keep +back, please: we don't want YOU with us!"' + + `They were obliged to have him with them,' the Mock Turtle +said: `no wise fish would go anywhere without a porpoise.' + + `Wouldn't it really?' said Alice in a tone of great surprise. + + `Of course not,' said the Mock Turtle: `why, if a fish came +to ME, and told me he was going a journey, I should say "With +what porpoise?"' + + `Don't you mean "purpose"?' said Alice. + + `I mean what I say,' the Mock Turtle replied in an offended +tone. And the Gryphon added `Come, let's hear some of YOUR +adventures.' + + `I could tell you my adventures--beginning from this morning,' +said Alice a little timidly: `but it's no use going back to +yesterday, because I was a different person then.' + + `Explain all that,' said the Mock Turtle. + + `No, no! The adventures first,' said the Gryphon in an +impatient tone: `explanations take such a dreadful time.' + + So Alice began telling them her adventures from the time when +she first saw the White Rabbit. She was a little nervous about +it just at first, the two creatures got so close to her, one on +each side, and opened their eyes and mouths so VERY wide, but she +gained courage as she went on. Her listeners were perfectly +quiet till she got to the part about her repeating `YOU ARE OLD, +FATHER WILLIAM,' to the Caterpillar, and the words all coming +different, and then the Mock Turtle drew a long breath, and said +`That's very curious.' + + `It's all about as curious as it can be,' said the Gryphon. + + `It all came different!' the Mock Turtle repeated +thoughtfully. `I should like to hear her try and repeat +something now. Tell her to begin.' He looked at the Gryphon as +if he thought it had some kind of authority over Alice. + + `Stand up and repeat "'TIS THE VOICE OF THE SLUGGARD,"' said +the Gryphon. + + `How the creatures order one about, and make one repeat +lessons!' thought Alice; `I might as well be at school at once.' +However, she got up, and began to repeat it, but her head was so +full of the Lobster Quadrille, that she hardly knew what she was +saying, and the words came very queer indeed:-- + + `'Tis the voice of the Lobster; I heard him declare, + "You have baked me too brown, I must sugar my hair." + As a duck with its eyelids, so he with his nose + Trims his belt and his buttons, and turns out his toes.' + + [later editions continued as follows + When the sands are all dry, he is gay as a lark, + And will talk in contemptuous tones of the Shark, + But, when the tide rises and sharks are around, + His voice has a timid and tremulous sound.] + + `That's different from what I used to say when I was a child,' +said the Gryphon. + + `Well, I never heard it before,' said the Mock Turtle; `but it +sounds uncommon nonsense.' + + Alice said nothing; she had sat down with her face in her +hands, wondering if anything would EVER happen in a natural way +again. + + `I should like to have it explained,' said the Mock Turtle. + + `She can't explain it,' said the Gryphon hastily. `Go on with +the next verse.' + + `But about his toes?' the Mock Turtle persisted. `How COULD +he turn them out with his nose, you know?' + + `It's the first position in dancing.' Alice said; but was +dreadfully puzzled by the whole thing, and longed to change the +subject. + + `Go on with the next verse,' the Gryphon repeated impatiently: +`it begins "I passed by his garden."' + + Alice did not dare to disobey, though she felt sure it would +all come wrong, and she went on in a trembling voice:-- + + `I passed by his garden, and marked, with one eye, + How the Owl and the Panther were sharing a pie--' + + [later editions continued as follows + The Panther took pie-crust, and gravy, and meat, + While the Owl had the dish as its share of the treat. + When the pie was all finished, the Owl, as a boon, + Was kindly permitted to pocket the spoon: + While the Panther received knife and fork with a growl, + And concluded the banquet--] + + `What IS the use of repeating all that stuff,' the Mock Turtle +interrupted, `if you don't explain it as you go on? It's by far +the most confusing thing I ever heard!' + + `Yes, I think you'd better leave off,' said the Gryphon: and +Alice was only too glad to do so. + + `Shall we try another figure of the Lobster Quadrille?' the +Gryphon went on. `Or would you like the Mock Turtle to sing you +a song?' + + `Oh, a song, please, if the Mock Turtle would be so kind,' +Alice replied, so eagerly that the Gryphon said, in a rather +offended tone, `Hm! No accounting for tastes! Sing her "Turtle +Soup," will you, old fellow?' + + The Mock Turtle sighed deeply, and began, in a voice sometimes +choked with sobs, to sing this:-- + + + `Beautiful Soup, so rich and green, + Waiting in a hot tureen! + Who for such dainties would not stoop? + Soup of the evening, beautiful Soup! + Soup of the evening, beautiful Soup! + Beau--ootiful Soo--oop! + Beau--ootiful Soo--oop! + Soo--oop of the e--e--evening, + Beautiful, beautiful Soup! + + `Beautiful Soup! Who cares for fish, + Game, or any other dish? + Who would not give all else for two p + ennyworth only of beautiful Soup? + Pennyworth only of beautiful Soup? + Beau--ootiful Soo--oop! + Beau--ootiful Soo--oop! + Soo--oop of the e--e--evening, + Beautiful, beauti--FUL SOUP!' + + `Chorus again!' cried the Gryphon, and the Mock Turtle had +just begun to repeat it, when a cry of `The trial's beginning!' +was heard in the distance. + + `Come on!' cried the Gryphon, and, taking Alice by the hand, +it hurried off, without waiting for the end of the song. + + `What trial is it?' Alice panted as she ran; but the Gryphon +only answered `Come on!' and ran the faster, while more and more +faintly came, carried on the breeze that followed them, the +melancholy words:-- + + `Soo--oop of the e--e--evening, + Beautiful, beautiful Soup!' + + + + CHAPTER XI + + Who Stole the Tarts? + + + The King and Queen of Hearts were seated on their throne when +they arrived, with a great crowd assembled about them--all sorts +of little birds and beasts, as well as the whole pack of cards: +the Knave was standing before them, in chains, with a soldier on +each side to guard him; and near the King was the White Rabbit, +with a trumpet in one hand, and a scroll of parchment in the +other. In the very middle of the court was a table, with a large +dish of tarts upon it: they looked so good, that it made Alice +quite hungry to look at them--`I wish they'd get the trial done,' +she thought, `and hand round the refreshments!' But there seemed +to be no chance of this, so she began looking at everything about +her, to pass away the time. + + Alice had never been in a court of justice before, but she had +read about them in books, and she was quite pleased to find that +she knew the name of nearly everything there. `That's the +judge,' she said to herself, `because of his great wig.' + + The judge, by the way, was the King; and as he wore his crown +over the wig, (look at the frontispiece if you want to see how he +did it,) he did not look at all comfortable, and it was certainly +not becoming. + + `And that's the jury-box,' thought Alice, `and those twelve +creatures,' (she was obliged to say `creatures,' you see, because +some of them were animals, and some were birds,) `I suppose they +are the jurors.' She said this last word two or three times over +to herself, being rather proud of it: for she thought, and +rightly too, that very few little girls of her age knew the +meaning of it at all. However, `jury-men' would have done just +as well. + + The twelve jurors were all writing very busily on slates. +`What are they doing?' Alice whispered to the Gryphon. `They +can't have anything to put down yet, before the trial's begun.' + + `They're putting down their names,' the Gryphon whispered in +reply, `for fear they should forget them before the end of the +trial.' + + `Stupid things!' Alice began in a loud, indignant voice, but +she stopped hastily, for the White Rabbit cried out, `Silence in +the court!' and the King put on his spectacles and looked +anxiously round, to make out who was talking. + + Alice could see, as well as if she were looking over their +shoulders, that all the jurors were writing down `stupid things!' +on their slates, and she could even make out that one of them +didn't know how to spell `stupid,' and that he had to ask his +neighbour to tell him. `A nice muddle their slates'll be in +before the trial's over!' thought Alice. + + One of the jurors had a pencil that squeaked. This of course, +Alice could not stand, and she went round the court and got +behind him, and very soon found an opportunity of taking it +away. She did it so quickly that the poor little juror (it was +Bill, the Lizard) could not make out at all what had become of +it; so, after hunting all about for it, he was obliged to write +with one finger for the rest of the day; and this was of very +little use, as it left no mark on the slate. + + `Herald, read the accusation!' said the King. + + On this the White Rabbit blew three blasts on the trumpet, and +then unrolled the parchment scroll, and read as follows:-- + + `The Queen of Hearts, she made some tarts, + All on a summer day: + The Knave of Hearts, he stole those tarts, + And took them quite away!' + + `Consider your verdict,' the King said to the jury. + + `Not yet, not yet!' the Rabbit hastily interrupted. `There's +a great deal to come before that!' + + `Call the first witness,' said the King; and the White Rabbit +blew three blasts on the trumpet, and called out, `First +witness!' + + The first witness was the Hatter. He came in with a teacup in +one hand and a piece of bread-and-butter in the other. `I beg +pardon, your Majesty,' he began, `for bringing these in: but I +hadn't quite finished my tea when I was sent for.' + + `You ought to have finished,' said the King. `When did you +begin?' + + The Hatter looked at the March Hare, who had followed him into +the court, arm-in-arm with the Dormouse. `Fourteenth of March, I +think it was,' he said. + + `Fifteenth,' said the March Hare. + + `Sixteenth,' added the Dormouse. + + `Write that down,' the King said to the jury, and the jury +eagerly wrote down all three dates on their slates, and then +added them up, and reduced the answer to shillings and pence. + + `Take off your hat,' the King said to the Hatter. + + `It isn't mine,' said the Hatter. + + `Stolen!' the King exclaimed, turning to the jury, who +instantly made a memorandum of the fact. + + `I keep them to sell,' the Hatter added as an explanation; +`I've none of my own. I'm a hatter.' + + Here the Queen put on her spectacles, and began staring at the +Hatter, who turned pale and fidgeted. + + `Give your evidence,' said the King; `and don't be nervous, or +I'll have you executed on the spot.' + + This did not seem to encourage the witness at all: he kept +shifting from one foot to the other, looking uneasily at the +Queen, and in his confusion he bit a large piece out of his +teacup instead of the bread-and-butter. + + Just at this moment Alice felt a very curious sensation, which +puzzled her a good deal until she made out what it was: she was +beginning to grow larger again, and she thought at first she +would get up and leave the court; but on second thoughts she +decided to remain where she was as long as there was room for +her. + + `I wish you wouldn't squeeze so.' said the Dormouse, who was +sitting next to her. `I can hardly breathe.' + + `I can't help it,' said Alice very meekly: `I'm growing.' + + `You've no right to grow here,' said the Dormouse. + + `Don't talk nonsense,' said Alice more boldly: `you know +you're growing too.' + + `Yes, but I grow at a reasonable pace,' said the Dormouse: +`not in that ridiculous fashion.' And he got up very sulkily +and crossed over to the other side of the court. + + All this time the Queen had never left off staring at the +Hatter, and, just as the Dormouse crossed the court, she said to +one of the officers of the court, `Bring me the list of the +singers in the last concert!' on which the wretched Hatter +trembled so, that he shook both his shoes off. + + `Give your evidence,' the King repeated angrily, `or I'll have +you executed, whether you're nervous or not.' + + `I'm a poor man, your Majesty,' the Hatter began, in a +trembling voice, `--and I hadn't begun my tea--not above a week +or so--and what with the bread-and-butter getting so thin--and +the twinkling of the tea--' + + `The twinkling of the what?' said the King. + + `It began with the tea,' the Hatter replied. + + `Of course twinkling begins with a T!' said the King sharply. +`Do you take me for a dunce? Go on!' + + `I'm a poor man,' the Hatter went on, `and most things +twinkled after that--only the March Hare said--' + + `I didn't!' the March Hare interrupted in a great hurry. + + `You did!' said the Hatter. + + `I deny it!' said the March Hare. + + `He denies it,' said the King: `leave out that part.' + + `Well, at any rate, the Dormouse said--' the Hatter went on, +looking anxiously round to see if he would deny it too: but the +Dormouse denied nothing, being fast asleep. + + `After that,' continued the Hatter, `I cut some more bread- +and-butter--' + + `But what did the Dormouse say?' one of the jury asked. + + `That I can't remember,' said the Hatter. + + `You MUST remember,' remarked the King, `or I'll have you +executed.' + + The miserable Hatter dropped his teacup and bread-and-butter, +and went down on one knee. `I'm a poor man, your Majesty,' he +began. + + `You're a very poor speaker,' said the King. + + Here one of the guinea-pigs cheered, and was immediately +suppressed by the officers of the court. (As that is rather a +hard word, I will just explain to you how it was done. They had +a large canvas bag, which tied up at the mouth with strings: +into this they slipped the guinea-pig, head first, and then sat +upon it.) + + `I'm glad I've seen that done,' thought Alice. `I've so often +read in the newspapers, at the end of trials, "There was some +attempts at applause, which was immediately suppressed by the +officers of the court," and I never understood what it meant +till now.' + + `If that's all you know about it, you may stand down,' +continued the King. + + `I can't go no lower,' said the Hatter: `I'm on the floor, as +it is.' + + `Then you may SIT down,' the King replied. + + Here the other guinea-pig cheered, and was suppressed. + + `Come, that finished the guinea-pigs!' thought Alice. `Now we +shall get on better.' + + `I'd rather finish my tea,' said the Hatter, with an anxious +look at the Queen, who was reading the list of singers. + + `You may go,' said the King, and the Hatter hurriedly left the +court, without even waiting to put his shoes on. + + `--and just take his head off outside,' the Queen added to one +of the officers: but the Hatter was out of sight before the +officer could get to the door. + + `Call the next witness!' said the King. + + The next witness was the Duchess's cook. She carried the +pepper-box in her hand, and Alice guessed who it was, even before +she got into the court, by the way the people near the door began +sneezing all at once. + + `Give your evidence,' said the King. + + `Shan't,' said the cook. + + The King looked anxiously at the White Rabbit, who said in a +low voice, `Your Majesty must cross-examine THIS witness.' + + `Well, if I must, I must,' the King said, with a melancholy +air, and, after folding his arms and frowning at the cook till +his eyes were nearly out of sight, he said in a deep voice, `What +are tarts made of?' + + `Pepper, mostly,' said the cook. + + `Treacle,' said a sleepy voice behind her. + + `Collar that Dormouse,' the Queen shrieked out. `Behead that +Dormouse! Turn that Dormouse out of court! Suppress him! Pinch +him! Off with his whiskers!' + + For some minutes the whole court was in confusion, getting the +Dormouse turned out, and, by the time they had settled down +again, the cook had disappeared. + + `Never mind!' said the King, with an air of great relief. +`Call the next witness.' And he added in an undertone to the +Queen, `Really, my dear, YOU must cross-examine the next witness. +It quite makes my forehead ache!' + + Alice watched the White Rabbit as he fumbled over the list, +feeling very curious to see what the next witness would be like, +`--for they haven't got much evidence YET,' she said to herself. +Imagine her surprise, when the White Rabbit read out, at the top +of his shrill little voice, the name `Alice!' + + + + CHAPTER XII + + Alice's Evidence + + + `Here!' cried Alice, quite forgetting in the flurry of the +moment how large she had grown in the last few minutes, and she +jumped up in such a hurry that she tipped over the jury-box with +the edge of her skirt, upsetting all the jurymen on to the heads +of the crowd below, and there they lay sprawling about, reminding +her very much of a globe of goldfish she had accidentally upset +the week before. + + `Oh, I BEG your pardon!' she exclaimed in a tone of great +dismay, and began picking them up again as quickly as she could, +for the accident of the goldfish kept running in her head, and +she had a vague sort of idea that they must be collected at once +and put back into the jury-box, or they would die. + + `The trial cannot proceed,' said the King in a very grave +voice, `until all the jurymen are back in their proper places-- +ALL,' he repeated with great emphasis, looking hard at Alice as +he said do. + + Alice looked at the jury-box, and saw that, in her haste, she +had put the Lizard in head downwards, and the poor little thing +was waving its tail about in a melancholy way, being quite unable +to move. She soon got it out again, and put it right; `not that +it signifies much,' she said to herself; `I should think it +would be QUITE as much use in the trial one way up as the other.' + + As soon as the jury had a little recovered from the shock of +being upset, and their slates and pencils had been found and +handed back to them, they set to work very diligently to write +out a history of the accident, all except the Lizard, who seemed +too much overcome to do anything but sit with its mouth open, +gazing up into the roof of the court. + + `What do you know about this business?' the King said to +Alice. + + `Nothing,' said Alice. + + `Nothing WHATEVER?' persisted the King. + + `Nothing whatever,' said Alice. + + `That's very important,' the King said, turning to the jury. +They were just beginning to write this down on their slates, when +the White Rabbit interrupted: `UNimportant, your Majesty means, +of course,' he said in a very respectful tone, but frowning and +making faces at him as he spoke. + + `UNimportant, of course, I meant,' the King hastily said, and +went on to himself in an undertone, `important--unimportant-- +unimportant--important--' as if he were trying which word +sounded best. + + Some of the jury wrote it down `important,' and some +`unimportant.' Alice could see this, as she was near enough to +look over their slates; `but it doesn't matter a bit,' she +thought to herself. + + At this moment the King, who had been for some time busily +writing in his note-book, cackled out `Silence!' and read out +from his book, `Rule Forty-two. ALL PERSONS MORE THAN A MILE +HIGH TO LEAVE THE COURT.' + + Everybody looked at Alice. + + `I'M not a mile high,' said Alice. + + `You are,' said the King. + + `Nearly two miles high,' added the Queen. + + `Well, I shan't go, at any rate,' said Alice: `besides, +that's not a regular rule: you invented it just now.' + + `It's the oldest rule in the book,' said the King. + + `Then it ought to be Number One,' said Alice. + + The King turned pale, and shut his note-book hastily. +`Consider your verdict,' he said to the jury, in a low, trembling +voice. + + `There's more evidence to come yet, please your Majesty,' said +the White Rabbit, jumping up in a great hurry; `this paper has +just been picked up.' + + `What's in it?' said the Queen. + + `I haven't opened it yet,' said the White Rabbit, `but it seems +to be a letter, written by the prisoner to--to somebody.' + + `It must have been that,' said the King, `unless it was +written to nobody, which isn't usual, you know.' + + `Who is it directed to?' said one of the jurymen. + + `It isn't directed at all,' said the White Rabbit; `in fact, +there's nothing written on the OUTSIDE.' He unfolded the paper +as he spoke, and added `It isn't a letter, after all: it's a set +of verses.' + + `Are they in the prisoner's handwriting?' asked another of +they jurymen. + + `No, they're not,' said the White Rabbit, `and that's the +queerest thing about it.' (The jury all looked puzzled.) + + `He must have imitated somebody else's hand,' said the King. +(The jury all brightened up again.) + + `Please your Majesty,' said the Knave, `I didn't write it, and +they can't prove I did: there's no name signed at the end.' + + `If you didn't sign it,' said the King, `that only makes the +matter worse. You MUST have meant some mischief, or else you'd +have signed your name like an honest man.' + + There was a general clapping of hands at this: it was the +first really clever thing the King had said that day. + + `That PROVES his guilt,' said the Queen. + + `It proves nothing of the sort!' said Alice. `Why, you don't +even know what they're about!' + + `Read them,' said the King. + + The White Rabbit put on his spectacles. `Where shall I begin, +please your Majesty?' he asked. + + `Begin at the beginning,' the King said gravely, `and go on +till you come to the end: then stop.' + + These were the verses the White Rabbit read:-- + + `They told me you had been to her, + And mentioned me to him: + She gave me a good character, + But said I could not swim. + + He sent them word I had not gone + (We know it to be true): + If she should push the matter on, + What would become of you? + + I gave her one, they gave him two, + You gave us three or more; + They all returned from him to you, + Though they were mine before. + + If I or she should chance to be + Involved in this affair, + He trusts to you to set them free, + Exactly as we were. + + My notion was that you had been + (Before she had this fit) + An obstacle that came between + Him, and ourselves, and it. + + Don't let him know she liked them best, + For this must ever be + A secret, kept from all the rest, + Between yourself and me.' + + `That's the most important piece of evidence we've heard yet,' +said the King, rubbing his hands; `so now let the jury--' + + `If any one of them can explain it,' said Alice, (she had +grown so large in the last few minutes that she wasn't a bit +afraid of interrupting him,) `I'll give him sixpence. _I_ don't +believe there's an atom of meaning in it.' + + The jury all wrote down on their slates, `SHE doesn't believe +there's an atom of meaning in it,' but none of them attempted to +explain the paper. + + `If there's no meaning in it,' said the King, `that saves a +world of trouble, you know, as we needn't try to find any. And +yet I don't know,' he went on, spreading out the verses on his +knee, and looking at them with one eye; `I seem to see some +meaning in them, after all. "--SAID I COULD NOT SWIM--" you +can't swim, can you?' he added, turning to the Knave. + + The Knave shook his head sadly. `Do I look like it?' he said. +(Which he certainly did NOT, being made entirely of cardboard.) + + `All right, so far,' said the King, and he went on muttering +over the verses to himself: `"WE KNOW IT TO BE TRUE--" that's +the jury, of course-- "I GAVE HER ONE, THEY GAVE HIM TWO--" why, +that must be what he did with the tarts, you know--' + + `But, it goes on "THEY ALL RETURNED FROM HIM TO YOU,"' said +Alice. + + `Why, there they are!' said the King triumphantly, pointing to +the tarts on the table. `Nothing can be clearer than THAT. +Then again--"BEFORE SHE HAD THIS FIT--" you never had fits, my +dear, I think?' he said to the Queen. + + `Never!' said the Queen furiously, throwing an inkstand at the +Lizard as she spoke. (The unfortunate little Bill had left off +writing on his slate with one finger, as he found it made no +mark; but he now hastily began again, using the ink, that was +trickling down his face, as long as it lasted.) + + `Then the words don't FIT you,' said the King, looking round +the court with a smile. There was a dead silence. + + `It's a pun!' the King added in an offended tone, and +everybody laughed, `Let the jury consider their verdict,' the +King said, for about the twentieth time that day. + + `No, no!' said the Queen. `Sentence first--verdict afterwards.' + + `Stuff and nonsense!' said Alice loudly. `The idea of having +the sentence first!' + + `Hold your tongue!' said the Queen, turning purple. + + `I won't!' said Alice. + + `Off with her head!' the Queen shouted at the top of her voice. +Nobody moved. + + `Who cares for you?' said Alice, (she had grown to her full +size by this time.) `You're nothing but a pack of cards!' + + At this the whole pack rose up into the air, and came flying +down upon her: she gave a little scream, half of fright and half +of anger, and tried to beat them off, and found herself lying on +the bank, with her head in the lap of her sister, who was gently +brushing away some dead leaves that had fluttered down from the +trees upon her face. + + `Wake up, Alice dear!' said her sister; `Why, what a long +sleep you've had!' + + `Oh, I've had such a curious dream!' said Alice, and she told +her sister, as well as she could remember them, all these strange +Adventures of hers that you have just been reading about; and +when she had finished, her sister kissed her, and said, `It WAS a +curious dream, dear, certainly: but now run in to your tea; it's +getting late.' So Alice got up and ran off, thinking while she +ran, as well she might, what a wonderful dream it had been. + + But her sister sat still just as she left her, leaning her +head on her hand, watching the setting sun, and thinking of +little Alice and all her wonderful Adventures, till she too began +dreaming after a fashion, and this was her dream:-- + + First, she dreamed of little Alice herself, and once again the +tiny hands were clasped upon her knee, and the bright eager eyes +were looking up into hers--she could hear the very tones of her +voice, and see that queer little toss of her head to keep back +the wandering hair that WOULD always get into her eyes--and +still as she listened, or seemed to listen, the whole place +around her became alive the strange creatures of her little +sister's dream. + + The long grass rustled at her feet as the White Rabbit hurried +by--the frightened Mouse splashed his way through the +neighbouring pool--she could hear the rattle of the teacups as +the March Hare and his friends shared their never-ending meal, +and the shrill voice of the Queen ordering off her unfortunate +guests to execution--once more the pig-baby was sneezing on the +Duchess's knee, while plates and dishes crashed around it--once +more the shriek of the Gryphon, the squeaking of the Lizard's +slate-pencil, and the choking of the suppressed guinea-pigs, +filled the air, mixed up with the distant sobs of the miserable +Mock Turtle. + + So she sat on, with closed eyes, and half believed herself in +Wonderland, though she knew she had but to open them again, and +all would change to dull reality--the grass would be only +rustling in the wind, and the pool rippling to the waving of the +reeds--the rattling teacups would change to tinkling sheep- +bells, and the Queen's shrill cries to the voice of the shepherd +boy--and the sneeze of the baby, the shriek of the Gryphon, and +all thy other queer noises, would change (she knew) to the +confused clamour of the busy farm-yard--while the lowing of the +cattle in the distance would take the place of the Mock Turtle's +heavy sobs. + + Lastly, she pictured to herself how this same little sister of +hers would, in the after-time, be herself a grown woman; and how +she would keep, through all her riper years, the simple and +loving heart of her childhood: and how she would gather about +her other little children, and make THEIR eyes bright and eager +with many a strange tale, perhaps even with the dream of +Wonderland of long ago: and how she would feel with all their +simple sorrows, and find a pleasure in all their simple joys, +remembering her own child-life, and the happy summer days. + + THE END + \ No newline at end of file diff --git a/chromium/third_party/snappy/src/testdata/asyoulik.txt b/chromium/third_party/snappy/src/testdata/asyoulik.txt new file mode 100644 index 00000000000..88dc7b60fe2 --- /dev/null +++ b/chromium/third_party/snappy/src/testdata/asyoulik.txt @@ -0,0 +1,4122 @@ + AS YOU LIKE IT + + + DRAMATIS PERSONAE + + +DUKE SENIOR living in banishment. + +DUKE FREDERICK his brother, an usurper of his dominions. + + +AMIENS | + | lords attending on the banished duke. +JAQUES | + + +LE BEAU a courtier attending upon Frederick. + +CHARLES wrestler to Frederick. + + +OLIVER | + | +JAQUES (JAQUES DE BOYS:) | sons of Sir Rowland de Boys. + | +ORLANDO | + + +ADAM | + | servants to Oliver. +DENNIS | + + +TOUCHSTONE a clown. + +SIR OLIVER MARTEXT a vicar. + + +CORIN | + | shepherds. +SILVIUS | + + +WILLIAM a country fellow in love with Audrey. + + A person representing HYMEN. (HYMEN:) + +ROSALIND daughter to the banished duke. + +CELIA daughter to Frederick. + +PHEBE a shepherdess. + +AUDREY a country wench. + + Lords, pages, and attendants, &c. + (Forester:) + (A Lord:) + (First Lord:) + (Second Lord:) + (First Page:) + (Second Page:) + + +SCENE Oliver's house; Duke Frederick's court; and the + Forest of Arden. + + + + + AS YOU LIKE IT + + +ACT I + + + +SCENE I Orchard of Oliver's house. + + + [Enter ORLANDO and ADAM] + +ORLANDO As I remember, Adam, it was upon this fashion + bequeathed me by will but poor a thousand crowns, + and, as thou sayest, charged my brother, on his + blessing, to breed me well: and there begins my + sadness. My brother Jaques he keeps at school, and + report speaks goldenly of his profit: for my part, + he keeps me rustically at home, or, to speak more + properly, stays me here at home unkept; for call you + that keeping for a gentleman of my birth, that + differs not from the stalling of an ox? His horses + are bred better; for, besides that they are fair + with their feeding, they are taught their manage, + and to that end riders dearly hired: but I, his + brother, gain nothing under him but growth; for the + which his animals on his dunghills are as much + bound to him as I. Besides this nothing that he so + plentifully gives me, the something that nature gave + me his countenance seems to take from me: he lets + me feed with his hinds, bars me the place of a + brother, and, as much as in him lies, mines my + gentility with my education. This is it, Adam, that + grieves me; and the spirit of my father, which I + think is within me, begins to mutiny against this + servitude: I will no longer endure it, though yet I + know no wise remedy how to avoid it. + +ADAM Yonder comes my master, your brother. + +ORLANDO Go apart, Adam, and thou shalt hear how he will + shake me up. + + [Enter OLIVER] + +OLIVER Now, sir! what make you here? + +ORLANDO Nothing: I am not taught to make any thing. + +OLIVER What mar you then, sir? + +ORLANDO Marry, sir, I am helping you to mar that which God + made, a poor unworthy brother of yours, with idleness. + +OLIVER Marry, sir, be better employed, and be naught awhile. + +ORLANDO Shall I keep your hogs and eat husks with them? + What prodigal portion have I spent, that I should + come to such penury? + +OLIVER Know you where your are, sir? + +ORLANDO O, sir, very well; here in your orchard. + +OLIVER Know you before whom, sir? + +ORLANDO Ay, better than him I am before knows me. I know + you are my eldest brother; and, in the gentle + condition of blood, you should so know me. The + courtesy of nations allows you my better, in that + you are the first-born; but the same tradition + takes not away my blood, were there twenty brothers + betwixt us: I have as much of my father in me as + you; albeit, I confess, your coming before me is + nearer to his reverence. + +OLIVER What, boy! + +ORLANDO Come, come, elder brother, you are too young in this. + +OLIVER Wilt thou lay hands on me, villain? + +ORLANDO I am no villain; I am the youngest son of Sir + Rowland de Boys; he was my father, and he is thrice + a villain that says such a father begot villains. + Wert thou not my brother, I would not take this hand + from thy throat till this other had pulled out thy + tongue for saying so: thou hast railed on thyself. + +ADAM Sweet masters, be patient: for your father's + remembrance, be at accord. + +OLIVER Let me go, I say. + +ORLANDO I will not, till I please: you shall hear me. My + father charged you in his will to give me good + education: you have trained me like a peasant, + obscuring and hiding from me all gentleman-like + qualities. The spirit of my father grows strong in + me, and I will no longer endure it: therefore allow + me such exercises as may become a gentleman, or + give me the poor allottery my father left me by + testament; with that I will go buy my fortunes. + +OLIVER And what wilt thou do? beg, when that is spent? + Well, sir, get you in: I will not long be troubled + with you; you shall have some part of your will: I + pray you, leave me. + +ORLANDO I will no further offend you than becomes me for my good. + +OLIVER Get you with him, you old dog. + +ADAM Is 'old dog' my reward? Most true, I have lost my + teeth in your service. God be with my old master! + he would not have spoke such a word. + + [Exeunt ORLANDO and ADAM] + +OLIVER Is it even so? begin you to grow upon me? I will + physic your rankness, and yet give no thousand + crowns neither. Holla, Dennis! + + [Enter DENNIS] + +DENNIS Calls your worship? + +OLIVER Was not Charles, the duke's wrestler, here to speak with me? + +DENNIS So please you, he is here at the door and importunes + access to you. + +OLIVER Call him in. + + [Exit DENNIS] + + 'Twill be a good way; and to-morrow the wrestling is. + + [Enter CHARLES] + +CHARLES Good morrow to your worship. + +OLIVER Good Monsieur Charles, what's the new news at the + new court? + +CHARLES There's no news at the court, sir, but the old news: + that is, the old duke is banished by his younger + brother the new duke; and three or four loving lords + have put themselves into voluntary exile with him, + whose lands and revenues enrich the new duke; + therefore he gives them good leave to wander. + +OLIVER Can you tell if Rosalind, the duke's daughter, be + banished with her father? + +CHARLES O, no; for the duke's daughter, her cousin, so loves + her, being ever from their cradles bred together, + that she would have followed her exile, or have died + to stay behind her. She is at the court, and no + less beloved of her uncle than his own daughter; and + never two ladies loved as they do. + +OLIVER Where will the old duke live? + +CHARLES They say he is already in the forest of Arden, and + a many merry men with him; and there they live like + the old Robin Hood of England: they say many young + gentlemen flock to him every day, and fleet the time + carelessly, as they did in the golden world. + +OLIVER What, you wrestle to-morrow before the new duke? + +CHARLES Marry, do I, sir; and I came to acquaint you with a + matter. I am given, sir, secretly to understand + that your younger brother Orlando hath a disposition + to come in disguised against me to try a fall. + To-morrow, sir, I wrestle for my credit; and he that + escapes me without some broken limb shall acquit him + well. Your brother is but young and tender; and, + for your love, I would be loath to foil him, as I + must, for my own honour, if he come in: therefore, + out of my love to you, I came hither to acquaint you + withal, that either you might stay him from his + intendment or brook such disgrace well as he shall + run into, in that it is a thing of his own search + and altogether against my will. + +OLIVER Charles, I thank thee for thy love to me, which + thou shalt find I will most kindly requite. I had + myself notice of my brother's purpose herein and + have by underhand means laboured to dissuade him from + it, but he is resolute. I'll tell thee, Charles: + it is the stubbornest young fellow of France, full + of ambition, an envious emulator of every man's + good parts, a secret and villanous contriver against + me his natural brother: therefore use thy + discretion; I had as lief thou didst break his neck + as his finger. And thou wert best look to't; for if + thou dost him any slight disgrace or if he do not + mightily grace himself on thee, he will practise + against thee by poison, entrap thee by some + treacherous device and never leave thee till he + hath ta'en thy life by some indirect means or other; + for, I assure thee, and almost with tears I speak + it, there is not one so young and so villanous this + day living. I speak but brotherly of him; but + should I anatomize him to thee as he is, I must + blush and weep and thou must look pale and wonder. + +CHARLES I am heartily glad I came hither to you. If he come + to-morrow, I'll give him his payment: if ever he go + alone again, I'll never wrestle for prize more: and + so God keep your worship! + +OLIVER Farewell, good Charles. + + [Exit CHARLES] + + Now will I stir this gamester: I hope I shall see + an end of him; for my soul, yet I know not why, + hates nothing more than he. Yet he's gentle, never + schooled and yet learned, full of noble device, of + all sorts enchantingly beloved, and indeed so much + in the heart of the world, and especially of my own + people, who best know him, that I am altogether + misprised: but it shall not be so long; this + wrestler shall clear all: nothing remains but that + I kindle the boy thither; which now I'll go about. + + [Exit] + + + + + AS YOU LIKE IT + + +ACT I + + + +SCENE II Lawn before the Duke's palace. + + + [Enter CELIA and ROSALIND] + +CELIA I pray thee, Rosalind, sweet my coz, be merry. + +ROSALIND Dear Celia, I show more mirth than I am mistress of; + and would you yet I were merrier? Unless you could + teach me to forget a banished father, you must not + learn me how to remember any extraordinary pleasure. + +CELIA Herein I see thou lovest me not with the full weight + that I love thee. If my uncle, thy banished father, + had banished thy uncle, the duke my father, so thou + hadst been still with me, I could have taught my + love to take thy father for mine: so wouldst thou, + if the truth of thy love to me were so righteously + tempered as mine is to thee. + +ROSALIND Well, I will forget the condition of my estate, to + rejoice in yours. + +CELIA You know my father hath no child but I, nor none is + like to have: and, truly, when he dies, thou shalt + be his heir, for what he hath taken away from thy + father perforce, I will render thee again in + affection; by mine honour, I will; and when I break + that oath, let me turn monster: therefore, my + sweet Rose, my dear Rose, be merry. + +ROSALIND From henceforth I will, coz, and devise sports. Let + me see; what think you of falling in love? + +CELIA Marry, I prithee, do, to make sport withal: but + love no man in good earnest; nor no further in sport + neither than with safety of a pure blush thou mayst + in honour come off again. + +ROSALIND What shall be our sport, then? + +CELIA Let us sit and mock the good housewife Fortune from + her wheel, that her gifts may henceforth be bestowed equally. + +ROSALIND I would we could do so, for her benefits are + mightily misplaced, and the bountiful blind woman + doth most mistake in her gifts to women. + +CELIA 'Tis true; for those that she makes fair she scarce + makes honest, and those that she makes honest she + makes very ill-favouredly. + +ROSALIND Nay, now thou goest from Fortune's office to + Nature's: Fortune reigns in gifts of the world, + not in the lineaments of Nature. + + [Enter TOUCHSTONE] + +CELIA No? when Nature hath made a fair creature, may she + not by Fortune fall into the fire? Though Nature + hath given us wit to flout at Fortune, hath not + Fortune sent in this fool to cut off the argument? + +ROSALIND Indeed, there is Fortune too hard for Nature, when + Fortune makes Nature's natural the cutter-off of + Nature's wit. + +CELIA Peradventure this is not Fortune's work neither, but + Nature's; who perceiveth our natural wits too dull + to reason of such goddesses and hath sent this + natural for our whetstone; for always the dulness of + the fool is the whetstone of the wits. How now, + wit! whither wander you? + +TOUCHSTONE Mistress, you must come away to your father. + +CELIA Were you made the messenger? + +TOUCHSTONE No, by mine honour, but I was bid to come for you. + +ROSALIND Where learned you that oath, fool? + +TOUCHSTONE Of a certain knight that swore by his honour they + were good pancakes and swore by his honour the + mustard was naught: now I'll stand to it, the + pancakes were naught and the mustard was good, and + yet was not the knight forsworn. + +CELIA How prove you that, in the great heap of your + knowledge? + +ROSALIND Ay, marry, now unmuzzle your wisdom. + +TOUCHSTONE Stand you both forth now: stroke your chins, and + swear by your beards that I am a knave. + +CELIA By our beards, if we had them, thou art. + +TOUCHSTONE By my knavery, if I had it, then I were; but if you + swear by that that is not, you are not forsworn: no + more was this knight swearing by his honour, for he + never had any; or if he had, he had sworn it away + before ever he saw those pancakes or that mustard. + +CELIA Prithee, who is't that thou meanest? + +TOUCHSTONE One that old Frederick, your father, loves. + +CELIA My father's love is enough to honour him: enough! + speak no more of him; you'll be whipped for taxation + one of these days. + +TOUCHSTONE The more pity, that fools may not speak wisely what + wise men do foolishly. + +CELIA By my troth, thou sayest true; for since the little + wit that fools have was silenced, the little foolery + that wise men have makes a great show. Here comes + Monsieur Le Beau. + +ROSALIND With his mouth full of news. + +CELIA Which he will put on us, as pigeons feed their young. + +ROSALIND Then shall we be news-crammed. + +CELIA All the better; we shall be the more marketable. + + [Enter LE BEAU] + + Bon jour, Monsieur Le Beau: what's the news? + +LE BEAU Fair princess, you have lost much good sport. + +CELIA Sport! of what colour? + +LE BEAU What colour, madam! how shall I answer you? + +ROSALIND As wit and fortune will. + +TOUCHSTONE Or as the Destinies decree. + +CELIA Well said: that was laid on with a trowel. + +TOUCHSTONE Nay, if I keep not my rank,-- + +ROSALIND Thou losest thy old smell. + +LE BEAU You amaze me, ladies: I would have told you of good + wrestling, which you have lost the sight of. + +ROSALIND You tell us the manner of the wrestling. + +LE BEAU I will tell you the beginning; and, if it please + your ladyships, you may see the end; for the best is + yet to do; and here, where you are, they are coming + to perform it. + +CELIA Well, the beginning, that is dead and buried. + +LE BEAU There comes an old man and his three sons,-- + +CELIA I could match this beginning with an old tale. + +LE BEAU Three proper young men, of excellent growth and presence. + +ROSALIND With bills on their necks, 'Be it known unto all men + by these presents.' + +LE BEAU The eldest of the three wrestled with Charles, the + duke's wrestler; which Charles in a moment threw him + and broke three of his ribs, that there is little + hope of life in him: so he served the second, and + so the third. Yonder they lie; the poor old man, + their father, making such pitiful dole over them + that all the beholders take his part with weeping. + +ROSALIND Alas! + +TOUCHSTONE But what is the sport, monsieur, that the ladies + have lost? + +LE BEAU Why, this that I speak of. + +TOUCHSTONE Thus men may grow wiser every day: it is the first + time that ever I heard breaking of ribs was sport + for ladies. + +CELIA Or I, I promise thee. + +ROSALIND But is there any else longs to see this broken music + in his sides? is there yet another dotes upon + rib-breaking? Shall we see this wrestling, cousin? + +LE BEAU You must, if you stay here; for here is the place + appointed for the wrestling, and they are ready to + perform it. + +CELIA Yonder, sure, they are coming: let us now stay and see it. + + [Flourish. Enter DUKE FREDERICK, Lords, ORLANDO, + CHARLES, and Attendants] + +DUKE FREDERICK Come on: since the youth will not be entreated, his + own peril on his forwardness. + +ROSALIND Is yonder the man? + +LE BEAU Even he, madam. + +CELIA Alas, he is too young! yet he looks successfully. + +DUKE FREDERICK How now, daughter and cousin! are you crept hither + to see the wrestling? + +ROSALIND Ay, my liege, so please you give us leave. + +DUKE FREDERICK You will take little delight in it, I can tell you; + there is such odds in the man. In pity of the + challenger's youth I would fain dissuade him, but he + will not be entreated. Speak to him, ladies; see if + you can move him. + +CELIA Call him hither, good Monsieur Le Beau. + +DUKE FREDERICK Do so: I'll not be by. + +LE BEAU Monsieur the challenger, the princesses call for you. + +ORLANDO I attend them with all respect and duty. + +ROSALIND Young man, have you challenged Charles the wrestler? + +ORLANDO No, fair princess; he is the general challenger: I + come but in, as others do, to try with him the + strength of my youth. + +CELIA Young gentleman, your spirits are too bold for your + years. You have seen cruel proof of this man's + strength: if you saw yourself with your eyes or + knew yourself with your judgment, the fear of your + adventure would counsel you to a more equal + enterprise. We pray you, for your own sake, to + embrace your own safety and give over this attempt. + +ROSALIND Do, young sir; your reputation shall not therefore + be misprised: we will make it our suit to the duke + that the wrestling might not go forward. + +ORLANDO I beseech you, punish me not with your hard + thoughts; wherein I confess me much guilty, to deny + so fair and excellent ladies any thing. But let + your fair eyes and gentle wishes go with me to my + trial: wherein if I be foiled, there is but one + shamed that was never gracious; if killed, but one + dead that was willing to be so: I shall do my + friends no wrong, for I have none to lament me, the + world no injury, for in it I have nothing; only in + the world I fill up a place, which may be better + supplied when I have made it empty. + +ROSALIND The little strength that I have, I would it were with you. + +CELIA And mine, to eke out hers. + +ROSALIND Fare you well: pray heaven I be deceived in you! + +CELIA Your heart's desires be with you! + +CHARLES Come, where is this young gallant that is so + desirous to lie with his mother earth? + +ORLANDO Ready, sir; but his will hath in it a more modest working. + +DUKE FREDERICK You shall try but one fall. + +CHARLES No, I warrant your grace, you shall not entreat him + to a second, that have so mightily persuaded him + from a first. + +ORLANDO An you mean to mock me after, you should not have + mocked me before: but come your ways. + +ROSALIND Now Hercules be thy speed, young man! + +CELIA I would I were invisible, to catch the strong + fellow by the leg. + + [They wrestle] + +ROSALIND O excellent young man! + +CELIA If I had a thunderbolt in mine eye, I can tell who + should down. + + [Shout. CHARLES is thrown] + +DUKE FREDERICK No more, no more. + +ORLANDO Yes, I beseech your grace: I am not yet well breathed. + +DUKE FREDERICK How dost thou, Charles? + +LE BEAU He cannot speak, my lord. + +DUKE FREDERICK Bear him away. What is thy name, young man? + +ORLANDO Orlando, my liege; the youngest son of Sir Rowland de Boys. + +DUKE FREDERICK I would thou hadst been son to some man else: + The world esteem'd thy father honourable, + But I did find him still mine enemy: + Thou shouldst have better pleased me with this deed, + Hadst thou descended from another house. + But fare thee well; thou art a gallant youth: + I would thou hadst told me of another father. + + [Exeunt DUKE FREDERICK, train, and LE BEAU] + +CELIA Were I my father, coz, would I do this? + +ORLANDO I am more proud to be Sir Rowland's son, + His youngest son; and would not change that calling, + To be adopted heir to Frederick. + +ROSALIND My father loved Sir Rowland as his soul, + And all the world was of my father's mind: + Had I before known this young man his son, + I should have given him tears unto entreaties, + Ere he should thus have ventured. + +CELIA Gentle cousin, + Let us go thank him and encourage him: + My father's rough and envious disposition + Sticks me at heart. Sir, you have well deserved: + If you do keep your promises in love + But justly, as you have exceeded all promise, + Your mistress shall be happy. + +ROSALIND Gentleman, + + [Giving him a chain from her neck] + + Wear this for me, one out of suits with fortune, + That could give more, but that her hand lacks means. + Shall we go, coz? + +CELIA Ay. Fare you well, fair gentleman. + +ORLANDO Can I not say, I thank you? My better parts + Are all thrown down, and that which here stands up + Is but a quintain, a mere lifeless block. + +ROSALIND He calls us back: my pride fell with my fortunes; + I'll ask him what he would. Did you call, sir? + Sir, you have wrestled well and overthrown + More than your enemies. + +CELIA Will you go, coz? + +ROSALIND Have with you. Fare you well. + + [Exeunt ROSALIND and CELIA] + +ORLANDO What passion hangs these weights upon my tongue? + I cannot speak to her, yet she urged conference. + O poor Orlando, thou art overthrown! + Or Charles or something weaker masters thee. + + [Re-enter LE BEAU] + +LE BEAU Good sir, I do in friendship counsel you + To leave this place. Albeit you have deserved + High commendation, true applause and love, + Yet such is now the duke's condition + That he misconstrues all that you have done. + The duke is humorous; what he is indeed, + More suits you to conceive than I to speak of. + +ORLANDO I thank you, sir: and, pray you, tell me this: + Which of the two was daughter of the duke + That here was at the wrestling? + +LE BEAU Neither his daughter, if we judge by manners; + But yet indeed the lesser is his daughter + The other is daughter to the banish'd duke, + And here detain'd by her usurping uncle, + To keep his daughter company; whose loves + Are dearer than the natural bond of sisters. + But I can tell you that of late this duke + Hath ta'en displeasure 'gainst his gentle niece, + Grounded upon no other argument + But that the people praise her for her virtues + And pity her for her good father's sake; + And, on my life, his malice 'gainst the lady + Will suddenly break forth. Sir, fare you well: + Hereafter, in a better world than this, + I shall desire more love and knowledge of you. + +ORLANDO I rest much bounden to you: fare you well. + + [Exit LE BEAU] + + Thus must I from the smoke into the smother; + From tyrant duke unto a tyrant brother: + But heavenly Rosalind! + + [Exit] + + + + + AS YOU LIKE IT + + +ACT I + + + +SCENE III A room in the palace. + + + [Enter CELIA and ROSALIND] + +CELIA Why, cousin! why, Rosalind! Cupid have mercy! not a word? + +ROSALIND Not one to throw at a dog. + +CELIA No, thy words are too precious to be cast away upon + curs; throw some of them at me; come, lame me with reasons. + +ROSALIND Then there were two cousins laid up; when the one + should be lamed with reasons and the other mad + without any. + +CELIA But is all this for your father? + +ROSALIND No, some of it is for my child's father. O, how + full of briers is this working-day world! + +CELIA They are but burs, cousin, thrown upon thee in + holiday foolery: if we walk not in the trodden + paths our very petticoats will catch them. + +ROSALIND I could shake them off my coat: these burs are in my heart. + +CELIA Hem them away. + +ROSALIND I would try, if I could cry 'hem' and have him. + +CELIA Come, come, wrestle with thy affections. + +ROSALIND O, they take the part of a better wrestler than myself! + +CELIA O, a good wish upon you! you will try in time, in + despite of a fall. But, turning these jests out of + service, let us talk in good earnest: is it + possible, on such a sudden, you should fall into so + strong a liking with old Sir Rowland's youngest son? + +ROSALIND The duke my father loved his father dearly. + +CELIA Doth it therefore ensue that you should love his son + dearly? By this kind of chase, I should hate him, + for my father hated his father dearly; yet I hate + not Orlando. + +ROSALIND No, faith, hate him not, for my sake. + +CELIA Why should I not? doth he not deserve well? + +ROSALIND Let me love him for that, and do you love him + because I do. Look, here comes the duke. + +CELIA With his eyes full of anger. + + [Enter DUKE FREDERICK, with Lords] + +DUKE FREDERICK Mistress, dispatch you with your safest haste + And get you from our court. + +ROSALIND Me, uncle? + +DUKE FREDERICK You, cousin + Within these ten days if that thou be'st found + So near our public court as twenty miles, + Thou diest for it. + +ROSALIND I do beseech your grace, + Let me the knowledge of my fault bear with me: + If with myself I hold intelligence + Or have acquaintance with mine own desires, + If that I do not dream or be not frantic,-- + As I do trust I am not--then, dear uncle, + Never so much as in a thought unborn + Did I offend your highness. + +DUKE FREDERICK Thus do all traitors: + If their purgation did consist in words, + They are as innocent as grace itself: + Let it suffice thee that I trust thee not. + +ROSALIND Yet your mistrust cannot make me a traitor: + Tell me whereon the likelihood depends. + +DUKE FREDERICK Thou art thy father's daughter; there's enough. + +ROSALIND So was I when your highness took his dukedom; + So was I when your highness banish'd him: + Treason is not inherited, my lord; + Or, if we did derive it from our friends, + What's that to me? my father was no traitor: + Then, good my liege, mistake me not so much + To think my poverty is treacherous. + +CELIA Dear sovereign, hear me speak. + +DUKE FREDERICK Ay, Celia; we stay'd her for your sake, + Else had she with her father ranged along. + +CELIA I did not then entreat to have her stay; + It was your pleasure and your own remorse: + I was too young that time to value her; + But now I know her: if she be a traitor, + Why so am I; we still have slept together, + Rose at an instant, learn'd, play'd, eat together, + And wheresoever we went, like Juno's swans, + Still we went coupled and inseparable. + +DUKE FREDERICK She is too subtle for thee; and her smoothness, + Her very silence and her patience + Speak to the people, and they pity her. + Thou art a fool: she robs thee of thy name; + And thou wilt show more bright and seem more virtuous + When she is gone. Then open not thy lips: + Firm and irrevocable is my doom + Which I have pass'd upon her; she is banish'd. + +CELIA Pronounce that sentence then on me, my liege: + I cannot live out of her company. + +DUKE FREDERICK You are a fool. You, niece, provide yourself: + If you outstay the time, upon mine honour, + And in the greatness of my word, you die. + + [Exeunt DUKE FREDERICK and Lords] + +CELIA O my poor Rosalind, whither wilt thou go? + Wilt thou change fathers? I will give thee mine. + I charge thee, be not thou more grieved than I am. + +ROSALIND I have more cause. + +CELIA Thou hast not, cousin; + Prithee be cheerful: know'st thou not, the duke + Hath banish'd me, his daughter? + +ROSALIND That he hath not. + +CELIA No, hath not? Rosalind lacks then the love + Which teacheth thee that thou and I am one: + Shall we be sunder'd? shall we part, sweet girl? + No: let my father seek another heir. + Therefore devise with me how we may fly, + Whither to go and what to bear with us; + And do not seek to take your change upon you, + To bear your griefs yourself and leave me out; + For, by this heaven, now at our sorrows pale, + Say what thou canst, I'll go along with thee. + +ROSALIND Why, whither shall we go? + +CELIA To seek my uncle in the forest of Arden. + +ROSALIND Alas, what danger will it be to us, + Maids as we are, to travel forth so far! + Beauty provoketh thieves sooner than gold. + +CELIA I'll put myself in poor and mean attire + And with a kind of umber smirch my face; + The like do you: so shall we pass along + And never stir assailants. + +ROSALIND Were it not better, + Because that I am more than common tall, + That I did suit me all points like a man? + A gallant curtle-axe upon my thigh, + A boar-spear in my hand; and--in my heart + Lie there what hidden woman's fear there will-- + We'll have a swashing and a martial outside, + As many other mannish cowards have + That do outface it with their semblances. + +CELIA What shall I call thee when thou art a man? + +ROSALIND I'll have no worse a name than Jove's own page; + And therefore look you call me Ganymede. + But what will you be call'd? + +CELIA Something that hath a reference to my state + No longer Celia, but Aliena. + +ROSALIND But, cousin, what if we assay'd to steal + The clownish fool out of your father's court? + Would he not be a comfort to our travel? + +CELIA He'll go along o'er the wide world with me; + Leave me alone to woo him. Let's away, + And get our jewels and our wealth together, + Devise the fittest time and safest way + To hide us from pursuit that will be made + After my flight. Now go we in content + To liberty and not to banishment. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE I The Forest of Arden. + + + [Enter DUKE SENIOR, AMIENS, and two or three Lords, + like foresters] + +DUKE SENIOR Now, my co-mates and brothers in exile, + Hath not old custom made this life more sweet + Than that of painted pomp? Are not these woods + More free from peril than the envious court? + Here feel we but the penalty of Adam, + The seasons' difference, as the icy fang + And churlish chiding of the winter's wind, + Which, when it bites and blows upon my body, + Even till I shrink with cold, I smile and say + 'This is no flattery: these are counsellors + That feelingly persuade me what I am.' + Sweet are the uses of adversity, + Which, like the toad, ugly and venomous, + Wears yet a precious jewel in his head; + And this our life exempt from public haunt + Finds tongues in trees, books in the running brooks, + Sermons in stones and good in every thing. + I would not change it. + +AMIENS Happy is your grace, + That can translate the stubbornness of fortune + Into so quiet and so sweet a style. + +DUKE SENIOR Come, shall we go and kill us venison? + And yet it irks me the poor dappled fools, + Being native burghers of this desert city, + Should in their own confines with forked heads + Have their round haunches gored. + +First Lord Indeed, my lord, + The melancholy Jaques grieves at that, + And, in that kind, swears you do more usurp + Than doth your brother that hath banish'd you. + To-day my Lord of Amiens and myself + Did steal behind him as he lay along + Under an oak whose antique root peeps out + Upon the brook that brawls along this wood: + To the which place a poor sequester'd stag, + That from the hunter's aim had ta'en a hurt, + Did come to languish, and indeed, my lord, + The wretched animal heaved forth such groans + That their discharge did stretch his leathern coat + Almost to bursting, and the big round tears + Coursed one another down his innocent nose + In piteous chase; and thus the hairy fool + Much marked of the melancholy Jaques, + Stood on the extremest verge of the swift brook, + Augmenting it with tears. + +DUKE SENIOR But what said Jaques? + Did he not moralize this spectacle? + +First Lord O, yes, into a thousand similes. + First, for his weeping into the needless stream; + 'Poor deer,' quoth he, 'thou makest a testament + As worldlings do, giving thy sum of more + To that which had too much:' then, being there alone, + Left and abandon'd of his velvet friends, + ''Tis right:' quoth he; 'thus misery doth part + The flux of company:' anon a careless herd, + Full of the pasture, jumps along by him + And never stays to greet him; 'Ay' quoth Jaques, + 'Sweep on, you fat and greasy citizens; + 'Tis just the fashion: wherefore do you look + Upon that poor and broken bankrupt there?' + Thus most invectively he pierceth through + The body of the country, city, court, + Yea, and of this our life, swearing that we + Are mere usurpers, tyrants and what's worse, + To fright the animals and to kill them up + In their assign'd and native dwelling-place. + +DUKE SENIOR And did you leave him in this contemplation? + +Second Lord We did, my lord, weeping and commenting + Upon the sobbing deer. + +DUKE SENIOR Show me the place: + I love to cope him in these sullen fits, + For then he's full of matter. + +First Lord I'll bring you to him straight. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE II A room in the palace. + + + [Enter DUKE FREDERICK, with Lords] + +DUKE FREDERICK Can it be possible that no man saw them? + It cannot be: some villains of my court + Are of consent and sufferance in this. + +First Lord I cannot hear of any that did see her. + The ladies, her attendants of her chamber, + Saw her abed, and in the morning early + They found the bed untreasured of their mistress. + +Second Lord My lord, the roynish clown, at whom so oft + Your grace was wont to laugh, is also missing. + Hisperia, the princess' gentlewoman, + Confesses that she secretly o'erheard + Your daughter and her cousin much commend + The parts and graces of the wrestler + That did but lately foil the sinewy Charles; + And she believes, wherever they are gone, + That youth is surely in their company. + +DUKE FREDERICK Send to his brother; fetch that gallant hither; + If he be absent, bring his brother to me; + I'll make him find him: do this suddenly, + And let not search and inquisition quail + To bring again these foolish runaways. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE III Before OLIVER'S house. + + + [Enter ORLANDO and ADAM, meeting] + +ORLANDO Who's there? + +ADAM What, my young master? O, my gentle master! + O my sweet master! O you memory + Of old Sir Rowland! why, what make you here? + Why are you virtuous? why do people love you? + And wherefore are you gentle, strong and valiant? + Why would you be so fond to overcome + The bonny priser of the humorous duke? + Your praise is come too swiftly home before you. + Know you not, master, to some kind of men + Their graces serve them but as enemies? + No more do yours: your virtues, gentle master, + Are sanctified and holy traitors to you. + O, what a world is this, when what is comely + Envenoms him that bears it! + +ORLANDO Why, what's the matter? + +ADAM O unhappy youth! + Come not within these doors; within this roof + The enemy of all your graces lives: + Your brother--no, no brother; yet the son-- + Yet not the son, I will not call him son + Of him I was about to call his father-- + Hath heard your praises, and this night he means + To burn the lodging where you use to lie + And you within it: if he fail of that, + He will have other means to cut you off. + I overheard him and his practises. + This is no place; this house is but a butchery: + Abhor it, fear it, do not enter it. + +ORLANDO Why, whither, Adam, wouldst thou have me go? + +ADAM No matter whither, so you come not here. + +ORLANDO What, wouldst thou have me go and beg my food? + Or with a base and boisterous sword enforce + A thievish living on the common road? + This I must do, or know not what to do: + Yet this I will not do, do how I can; + I rather will subject me to the malice + Of a diverted blood and bloody brother. + +ADAM But do not so. I have five hundred crowns, + The thrifty hire I saved under your father, + Which I did store to be my foster-nurse + When service should in my old limbs lie lame + And unregarded age in corners thrown: + Take that, and He that doth the ravens feed, + Yea, providently caters for the sparrow, + Be comfort to my age! Here is the gold; + And all this I give you. Let me be your servant: + Though I look old, yet I am strong and lusty; + For in my youth I never did apply + Hot and rebellious liquors in my blood, + Nor did not with unbashful forehead woo + The means of weakness and debility; + Therefore my age is as a lusty winter, + Frosty, but kindly: let me go with you; + I'll do the service of a younger man + In all your business and necessities. + +ORLANDO O good old man, how well in thee appears + The constant service of the antique world, + When service sweat for duty, not for meed! + Thou art not for the fashion of these times, + Where none will sweat but for promotion, + And having that, do choke their service up + Even with the having: it is not so with thee. + But, poor old man, thou prunest a rotten tree, + That cannot so much as a blossom yield + In lieu of all thy pains and husbandry + But come thy ways; well go along together, + And ere we have thy youthful wages spent, + We'll light upon some settled low content. + +ADAM Master, go on, and I will follow thee, + To the last gasp, with truth and loyalty. + From seventeen years till now almost fourscore + Here lived I, but now live here no more. + At seventeen years many their fortunes seek; + But at fourscore it is too late a week: + Yet fortune cannot recompense me better + Than to die well and not my master's debtor. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE IV The Forest of Arden. + + + [Enter ROSALIND for Ganymede, CELIA for Aliena, + and TOUCHSTONE] + +ROSALIND O Jupiter, how weary are my spirits! + +TOUCHSTONE I care not for my spirits, if my legs were not weary. + +ROSALIND I could find in my heart to disgrace my man's + apparel and to cry like a woman; but I must comfort + the weaker vessel, as doublet and hose ought to show + itself courageous to petticoat: therefore courage, + good Aliena! + +CELIA I pray you, bear with me; I cannot go no further. + +TOUCHSTONE For my part, I had rather bear with you than bear + you; yet I should bear no cross if I did bear you, + for I think you have no money in your purse. + +ROSALIND Well, this is the forest of Arden. + +TOUCHSTONE Ay, now am I in Arden; the more fool I; when I was + at home, I was in a better place: but travellers + must be content. + +ROSALIND Ay, be so, good Touchstone. + + [Enter CORIN and SILVIUS] + + Look you, who comes here; a young man and an old in + solemn talk. + +CORIN That is the way to make her scorn you still. + +SILVIUS O Corin, that thou knew'st how I do love her! + +CORIN I partly guess; for I have loved ere now. + +SILVIUS No, Corin, being old, thou canst not guess, + Though in thy youth thou wast as true a lover + As ever sigh'd upon a midnight pillow: + But if thy love were ever like to mine-- + As sure I think did never man love so-- + How many actions most ridiculous + Hast thou been drawn to by thy fantasy? + +CORIN Into a thousand that I have forgotten. + +SILVIUS O, thou didst then ne'er love so heartily! + If thou remember'st not the slightest folly + That ever love did make thee run into, + Thou hast not loved: + Or if thou hast not sat as I do now, + Wearying thy hearer in thy mistress' praise, + Thou hast not loved: + Or if thou hast not broke from company + Abruptly, as my passion now makes me, + Thou hast not loved. + O Phebe, Phebe, Phebe! + + [Exit] + +ROSALIND Alas, poor shepherd! searching of thy wound, + I have by hard adventure found mine own. + +TOUCHSTONE And I mine. I remember, when I was in love I broke + my sword upon a stone and bid him take that for + coming a-night to Jane Smile; and I remember the + kissing of her batlet and the cow's dugs that her + pretty chopt hands had milked; and I remember the + wooing of a peascod instead of her, from whom I took + two cods and, giving her them again, said with + weeping tears 'Wear these for my sake.' We that are + true lovers run into strange capers; but as all is + mortal in nature, so is all nature in love mortal in folly. + +ROSALIND Thou speakest wiser than thou art ware of. + +TOUCHSTONE Nay, I shall ne'er be ware of mine own wit till I + break my shins against it. + +ROSALIND Jove, Jove! this shepherd's passion + Is much upon my fashion. + +TOUCHSTONE And mine; but it grows something stale with me. + +CELIA I pray you, one of you question yond man + If he for gold will give us any food: + I faint almost to death. + +TOUCHSTONE Holla, you clown! + +ROSALIND Peace, fool: he's not thy kinsman. + +CORIN Who calls? + +TOUCHSTONE Your betters, sir. + +CORIN Else are they very wretched. + +ROSALIND Peace, I say. Good even to you, friend. + +CORIN And to you, gentle sir, and to you all. + +ROSALIND I prithee, shepherd, if that love or gold + Can in this desert place buy entertainment, + Bring us where we may rest ourselves and feed: + Here's a young maid with travel much oppress'd + And faints for succor. + +CORIN Fair sir, I pity her + And wish, for her sake more than for mine own, + My fortunes were more able to relieve her; + But I am shepherd to another man + And do not shear the fleeces that I graze: + My master is of churlish disposition + And little recks to find the way to heaven + By doing deeds of hospitality: + Besides, his cote, his flocks and bounds of feed + Are now on sale, and at our sheepcote now, + By reason of his absence, there is nothing + That you will feed on; but what is, come see. + And in my voice most welcome shall you be. + +ROSALIND What is he that shall buy his flock and pasture? + +CORIN That young swain that you saw here but erewhile, + That little cares for buying any thing. + +ROSALIND I pray thee, if it stand with honesty, + Buy thou the cottage, pasture and the flock, + And thou shalt have to pay for it of us. + +CELIA And we will mend thy wages. I like this place. + And willingly could waste my time in it. + +CORIN Assuredly the thing is to be sold: + Go with me: if you like upon report + The soil, the profit and this kind of life, + I will your very faithful feeder be + And buy it with your gold right suddenly. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE V The Forest. + + + [Enter AMIENS, JAQUES, and others] + + SONG. +AMIENS Under the greenwood tree + Who loves to lie with me, + And turn his merry note + Unto the sweet bird's throat, + Come hither, come hither, come hither: + Here shall he see No enemy + But winter and rough weather. + +JAQUES More, more, I prithee, more. + +AMIENS It will make you melancholy, Monsieur Jaques. + +JAQUES I thank it. More, I prithee, more. I can suck + melancholy out of a song, as a weasel sucks eggs. + More, I prithee, more. + +AMIENS My voice is ragged: I know I cannot please you. + +JAQUES I do not desire you to please me; I do desire you to + sing. Come, more; another stanzo: call you 'em stanzos? + +AMIENS What you will, Monsieur Jaques. + +JAQUES Nay, I care not for their names; they owe me + nothing. Will you sing? + +AMIENS More at your request than to please myself. + +JAQUES Well then, if ever I thank any man, I'll thank you; + but that they call compliment is like the encounter + of two dog-apes, and when a man thanks me heartily, + methinks I have given him a penny and he renders me + the beggarly thanks. Come, sing; and you that will + not, hold your tongues. + +AMIENS Well, I'll end the song. Sirs, cover the while; the + duke will drink under this tree. He hath been all + this day to look you. + +JAQUES And I have been all this day to avoid him. He is + too disputable for my company: I think of as many + matters as he, but I give heaven thanks and make no + boast of them. Come, warble, come. + + SONG. + Who doth ambition shun + + [All together here] + + And loves to live i' the sun, + Seeking the food he eats + And pleased with what he gets, + Come hither, come hither, come hither: + Here shall he see No enemy + But winter and rough weather. + +JAQUES I'll give you a verse to this note that I made + yesterday in despite of my invention. + +AMIENS And I'll sing it. + +JAQUES Thus it goes:-- + + If it do come to pass + That any man turn ass, + Leaving his wealth and ease, + A stubborn will to please, + Ducdame, ducdame, ducdame: + Here shall he see + Gross fools as he, + An if he will come to me. + +AMIENS What's that 'ducdame'? + +JAQUES 'Tis a Greek invocation, to call fools into a + circle. I'll go sleep, if I can; if I cannot, I'll + rail against all the first-born of Egypt. + +AMIENS And I'll go seek the duke: his banquet is prepared. + + [Exeunt severally] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE VI The forest. + + + [Enter ORLANDO and ADAM] + +ADAM Dear master, I can go no further. O, I die for food! + Here lie I down, and measure out my grave. Farewell, + kind master. + +ORLANDO Why, how now, Adam! no greater heart in thee? Live + a little; comfort a little; cheer thyself a little. + If this uncouth forest yield any thing savage, I + will either be food for it or bring it for food to + thee. Thy conceit is nearer death than thy powers. + For my sake be comfortable; hold death awhile at + the arm's end: I will here be with thee presently; + and if I bring thee not something to eat, I will + give thee leave to die: but if thou diest before I + come, thou art a mocker of my labour. Well said! + thou lookest cheerly, and I'll be with thee quickly. + Yet thou liest in the bleak air: come, I will bear + thee to some shelter; and thou shalt not die for + lack of a dinner, if there live any thing in this + desert. Cheerly, good Adam! + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE VII The forest. + + + [A table set out. Enter DUKE SENIOR, AMIENS, and + Lords like outlaws] + +DUKE SENIOR I think he be transform'd into a beast; + For I can no where find him like a man. + +First Lord My lord, he is but even now gone hence: + Here was he merry, hearing of a song. + +DUKE SENIOR If he, compact of jars, grow musical, + We shall have shortly discord in the spheres. + Go, seek him: tell him I would speak with him. + + [Enter JAQUES] + +First Lord He saves my labour by his own approach. + +DUKE SENIOR Why, how now, monsieur! what a life is this, + That your poor friends must woo your company? + What, you look merrily! + +JAQUES A fool, a fool! I met a fool i' the forest, + A motley fool; a miserable world! + As I do live by food, I met a fool + Who laid him down and bask'd him in the sun, + And rail'd on Lady Fortune in good terms, + In good set terms and yet a motley fool. + 'Good morrow, fool,' quoth I. 'No, sir,' quoth he, + 'Call me not fool till heaven hath sent me fortune:' + And then he drew a dial from his poke, + And, looking on it with lack-lustre eye, + Says very wisely, 'It is ten o'clock: + Thus we may see,' quoth he, 'how the world wags: + 'Tis but an hour ago since it was nine, + And after one hour more 'twill be eleven; + And so, from hour to hour, we ripe and ripe, + And then, from hour to hour, we rot and rot; + And thereby hangs a tale.' When I did hear + The motley fool thus moral on the time, + My lungs began to crow like chanticleer, + That fools should be so deep-contemplative, + And I did laugh sans intermission + An hour by his dial. O noble fool! + A worthy fool! Motley's the only wear. + +DUKE SENIOR What fool is this? + +JAQUES O worthy fool! One that hath been a courtier, + And says, if ladies be but young and fair, + They have the gift to know it: and in his brain, + Which is as dry as the remainder biscuit + After a voyage, he hath strange places cramm'd + With observation, the which he vents + In mangled forms. O that I were a fool! + I am ambitious for a motley coat. + +DUKE SENIOR Thou shalt have one. + +JAQUES It is my only suit; + Provided that you weed your better judgments + Of all opinion that grows rank in them + That I am wise. I must have liberty + Withal, as large a charter as the wind, + To blow on whom I please; for so fools have; + And they that are most galled with my folly, + They most must laugh. And why, sir, must they so? + The 'why' is plain as way to parish church: + He that a fool doth very wisely hit + Doth very foolishly, although he smart, + Not to seem senseless of the bob: if not, + The wise man's folly is anatomized + Even by the squandering glances of the fool. + Invest me in my motley; give me leave + To speak my mind, and I will through and through + Cleanse the foul body of the infected world, + If they will patiently receive my medicine. + +DUKE SENIOR Fie on thee! I can tell what thou wouldst do. + +JAQUES What, for a counter, would I do but good? + +DUKE SENIOR Most mischievous foul sin, in chiding sin: + For thou thyself hast been a libertine, + As sensual as the brutish sting itself; + And all the embossed sores and headed evils, + That thou with licence of free foot hast caught, + Wouldst thou disgorge into the general world. + +JAQUES Why, who cries out on pride, + That can therein tax any private party? + Doth it not flow as hugely as the sea, + Till that the weary very means do ebb? + What woman in the city do I name, + When that I say the city-woman bears + The cost of princes on unworthy shoulders? + Who can come in and say that I mean her, + When such a one as she such is her neighbour? + Or what is he of basest function + That says his bravery is not of my cost, + Thinking that I mean him, but therein suits + His folly to the mettle of my speech? + There then; how then? what then? Let me see wherein + My tongue hath wrong'd him: if it do him right, + Then he hath wrong'd himself; if he be free, + Why then my taxing like a wild-goose flies, + Unclaim'd of any man. But who comes here? + + [Enter ORLANDO, with his sword drawn] + +ORLANDO Forbear, and eat no more. + +JAQUES Why, I have eat none yet. + +ORLANDO Nor shalt not, till necessity be served. + +JAQUES Of what kind should this cock come of? + +DUKE SENIOR Art thou thus bolden'd, man, by thy distress, + Or else a rude despiser of good manners, + That in civility thou seem'st so empty? + +ORLANDO You touch'd my vein at first: the thorny point + Of bare distress hath ta'en from me the show + Of smooth civility: yet am I inland bred + And know some nurture. But forbear, I say: + He dies that touches any of this fruit + Till I and my affairs are answered. + +JAQUES An you will not be answered with reason, I must die. + +DUKE SENIOR What would you have? Your gentleness shall force + More than your force move us to gentleness. + +ORLANDO I almost die for food; and let me have it. + +DUKE SENIOR Sit down and feed, and welcome to our table. + +ORLANDO Speak you so gently? Pardon me, I pray you: + I thought that all things had been savage here; + And therefore put I on the countenance + Of stern commandment. But whate'er you are + That in this desert inaccessible, + Under the shade of melancholy boughs, + Lose and neglect the creeping hours of time + If ever you have look'd on better days, + If ever been where bells have knoll'd to church, + If ever sat at any good man's feast, + If ever from your eyelids wiped a tear + And know what 'tis to pity and be pitied, + Let gentleness my strong enforcement be: + In the which hope I blush, and hide my sword. + +DUKE SENIOR True is it that we have seen better days, + And have with holy bell been knoll'd to church + And sat at good men's feasts and wiped our eyes + Of drops that sacred pity hath engender'd: + And therefore sit you down in gentleness + And take upon command what help we have + That to your wanting may be minister'd. + +ORLANDO Then but forbear your food a little while, + Whiles, like a doe, I go to find my fawn + And give it food. There is an old poor man, + Who after me hath many a weary step + Limp'd in pure love: till he be first sufficed, + Oppress'd with two weak evils, age and hunger, + I will not touch a bit. + +DUKE SENIOR Go find him out, + And we will nothing waste till you return. + +ORLANDO I thank ye; and be blest for your good comfort! + + [Exit] + +DUKE SENIOR Thou seest we are not all alone unhappy: + This wide and universal theatre + Presents more woeful pageants than the scene + Wherein we play in. + +JAQUES All the world's a stage, + And all the men and women merely players: + They have their exits and their entrances; + And one man in his time plays many parts, + His acts being seven ages. At first the infant, + Mewling and puking in the nurse's arms. + And then the whining school-boy, with his satchel + And shining morning face, creeping like snail + Unwillingly to school. And then the lover, + Sighing like furnace, with a woeful ballad + Made to his mistress' eyebrow. Then a soldier, + Full of strange oaths and bearded like the pard, + Jealous in honour, sudden and quick in quarrel, + Seeking the bubble reputation + Even in the cannon's mouth. And then the justice, + In fair round belly with good capon lined, + With eyes severe and beard of formal cut, + Full of wise saws and modern instances; + And so he plays his part. The sixth age shifts + Into the lean and slipper'd pantaloon, + With spectacles on nose and pouch on side, + His youthful hose, well saved, a world too wide + For his shrunk shank; and his big manly voice, + Turning again toward childish treble, pipes + And whistles in his sound. Last scene of all, + That ends this strange eventful history, + Is second childishness and mere oblivion, + Sans teeth, sans eyes, sans taste, sans everything. + + [Re-enter ORLANDO, with ADAM] + +DUKE SENIOR Welcome. Set down your venerable burthen, + And let him feed. + +ORLANDO I thank you most for him. + +ADAM So had you need: + I scarce can speak to thank you for myself. + +DUKE SENIOR Welcome; fall to: I will not trouble you + As yet, to question you about your fortunes. + Give us some music; and, good cousin, sing. + + SONG. +AMIENS Blow, blow, thou winter wind. + Thou art not so unkind + As man's ingratitude; + Thy tooth is not so keen, + Because thou art not seen, + Although thy breath be rude. + Heigh-ho! sing, heigh-ho! unto the green holly: + Most friendship is feigning, most loving mere folly: + Then, heigh-ho, the holly! + This life is most jolly. + Freeze, freeze, thou bitter sky, + That dost not bite so nigh + As benefits forgot: + Though thou the waters warp, + Thy sting is not so sharp + As friend remember'd not. + Heigh-ho! sing, &c. + +DUKE SENIOR If that you were the good Sir Rowland's son, + As you have whisper'd faithfully you were, + And as mine eye doth his effigies witness + Most truly limn'd and living in your face, + Be truly welcome hither: I am the duke + That loved your father: the residue of your fortune, + Go to my cave and tell me. Good old man, + Thou art right welcome as thy master is. + Support him by the arm. Give me your hand, + And let me all your fortunes understand. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE I A room in the palace. + + + [Enter DUKE FREDERICK, Lords, and OLIVER] + +DUKE FREDERICK Not see him since? Sir, sir, that cannot be: + But were I not the better part made mercy, + I should not seek an absent argument + Of my revenge, thou present. But look to it: + Find out thy brother, wheresoe'er he is; + Seek him with candle; bring him dead or living + Within this twelvemonth, or turn thou no more + To seek a living in our territory. + Thy lands and all things that thou dost call thine + Worth seizure do we seize into our hands, + Till thou canst quit thee by thy brothers mouth + Of what we think against thee. + +OLIVER O that your highness knew my heart in this! + I never loved my brother in my life. + +DUKE FREDERICK More villain thou. Well, push him out of doors; + And let my officers of such a nature + Make an extent upon his house and lands: + Do this expediently and turn him going. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE II The forest. + + + [Enter ORLANDO, with a paper] + +ORLANDO Hang there, my verse, in witness of my love: + And thou, thrice-crowned queen of night, survey + With thy chaste eye, from thy pale sphere above, + Thy huntress' name that my full life doth sway. + O Rosalind! these trees shall be my books + And in their barks my thoughts I'll character; + That every eye which in this forest looks + Shall see thy virtue witness'd every where. + Run, run, Orlando; carve on every tree + The fair, the chaste and unexpressive she. + + [Exit] + + [Enter CORIN and TOUCHSTONE] + +CORIN And how like you this shepherd's life, Master Touchstone? + +TOUCHSTONE Truly, shepherd, in respect of itself, it is a good + life, but in respect that it is a shepherd's life, + it is naught. In respect that it is solitary, I + like it very well; but in respect that it is + private, it is a very vile life. Now, in respect it + is in the fields, it pleaseth me well; but in + respect it is not in the court, it is tedious. As + is it a spare life, look you, it fits my humour well; + but as there is no more plenty in it, it goes much + against my stomach. Hast any philosophy in thee, shepherd? + +CORIN No more but that I know the more one sickens the + worse at ease he is; and that he that wants money, + means and content is without three good friends; + that the property of rain is to wet and fire to + burn; that good pasture makes fat sheep, and that a + great cause of the night is lack of the sun; that + he that hath learned no wit by nature nor art may + complain of good breeding or comes of a very dull kindred. + +TOUCHSTONE Such a one is a natural philosopher. Wast ever in + court, shepherd? + +CORIN No, truly. + +TOUCHSTONE Then thou art damned. + +CORIN Nay, I hope. + +TOUCHSTONE Truly, thou art damned like an ill-roasted egg, all + on one side. + +CORIN For not being at court? Your reason. + +TOUCHSTONE Why, if thou never wast at court, thou never sawest + good manners; if thou never sawest good manners, + then thy manners must be wicked; and wickedness is + sin, and sin is damnation. Thou art in a parlous + state, shepherd. + +CORIN Not a whit, Touchstone: those that are good manners + at the court are as ridiculous in the country as the + behavior of the country is most mockable at the + court. You told me you salute not at the court, but + you kiss your hands: that courtesy would be + uncleanly, if courtiers were shepherds. + +TOUCHSTONE Instance, briefly; come, instance. + +CORIN Why, we are still handling our ewes, and their + fells, you know, are greasy. + +TOUCHSTONE Why, do not your courtier's hands sweat? and is not + the grease of a mutton as wholesome as the sweat of + a man? Shallow, shallow. A better instance, I say; come. + +CORIN Besides, our hands are hard. + +TOUCHSTONE Your lips will feel them the sooner. Shallow again. + A more sounder instance, come. + +CORIN And they are often tarred over with the surgery of + our sheep: and would you have us kiss tar? The + courtier's hands are perfumed with civet. + +TOUCHSTONE Most shallow man! thou worms-meat, in respect of a + good piece of flesh indeed! Learn of the wise, and + perpend: civet is of a baser birth than tar, the + very uncleanly flux of a cat. Mend the instance, shepherd. + +CORIN You have too courtly a wit for me: I'll rest. + +TOUCHSTONE Wilt thou rest damned? God help thee, shallow man! + God make incision in thee! thou art raw. + +CORIN Sir, I am a true labourer: I earn that I eat, get + that I wear, owe no man hate, envy no man's + happiness, glad of other men's good, content with my + harm, and the greatest of my pride is to see my ewes + graze and my lambs suck. + +TOUCHSTONE That is another simple sin in you, to bring the ewes + and the rams together and to offer to get your + living by the copulation of cattle; to be bawd to a + bell-wether, and to betray a she-lamb of a + twelvemonth to a crooked-pated, old, cuckoldly ram, + out of all reasonable match. If thou beest not + damned for this, the devil himself will have no + shepherds; I cannot see else how thou shouldst + 'scape. + +CORIN Here comes young Master Ganymede, my new mistress's brother. + + [Enter ROSALIND, with a paper, reading] + +ROSALIND From the east to western Ind, + No jewel is like Rosalind. + Her worth, being mounted on the wind, + Through all the world bears Rosalind. + All the pictures fairest lined + Are but black to Rosalind. + Let no fair be kept in mind + But the fair of Rosalind. + +TOUCHSTONE I'll rhyme you so eight years together, dinners and + suppers and sleeping-hours excepted: it is the + right butter-women's rank to market. + +ROSALIND Out, fool! + +TOUCHSTONE For a taste: + If a hart do lack a hind, + Let him seek out Rosalind. + If the cat will after kind, + So be sure will Rosalind. + Winter garments must be lined, + So must slender Rosalind. + They that reap must sheaf and bind; + Then to cart with Rosalind. + Sweetest nut hath sourest rind, + Such a nut is Rosalind. + He that sweetest rose will find + Must find love's prick and Rosalind. + This is the very false gallop of verses: why do you + infect yourself with them? + +ROSALIND Peace, you dull fool! I found them on a tree. + +TOUCHSTONE Truly, the tree yields bad fruit. + +ROSALIND I'll graff it with you, and then I shall graff it + with a medlar: then it will be the earliest fruit + i' the country; for you'll be rotten ere you be half + ripe, and that's the right virtue of the medlar. + +TOUCHSTONE You have said; but whether wisely or no, let the + forest judge. + + [Enter CELIA, with a writing] + +ROSALIND Peace! Here comes my sister, reading: stand aside. + +CELIA [Reads] + + Why should this a desert be? + For it is unpeopled? No: + Tongues I'll hang on every tree, + That shall civil sayings show: + Some, how brief the life of man + Runs his erring pilgrimage, + That the stretching of a span + Buckles in his sum of age; + Some, of violated vows + 'Twixt the souls of friend and friend: + But upon the fairest boughs, + Or at every sentence end, + Will I Rosalinda write, + Teaching all that read to know + The quintessence of every sprite + Heaven would in little show. + Therefore Heaven Nature charged + That one body should be fill'd + With all graces wide-enlarged: + Nature presently distill'd + Helen's cheek, but not her heart, + Cleopatra's majesty, + Atalanta's better part, + Sad Lucretia's modesty. + Thus Rosalind of many parts + By heavenly synod was devised, + Of many faces, eyes and hearts, + To have the touches dearest prized. + Heaven would that she these gifts should have, + And I to live and die her slave. + +ROSALIND O most gentle pulpiter! what tedious homily of love + have you wearied your parishioners withal, and never + cried 'Have patience, good people!' + +CELIA How now! back, friends! Shepherd, go off a little. + Go with him, sirrah. + +TOUCHSTONE Come, shepherd, let us make an honourable retreat; + though not with bag and baggage, yet with scrip and scrippage. + + [Exeunt CORIN and TOUCHSTONE] + +CELIA Didst thou hear these verses? + +ROSALIND O, yes, I heard them all, and more too; for some of + them had in them more feet than the verses would bear. + +CELIA That's no matter: the feet might bear the verses. + +ROSALIND Ay, but the feet were lame and could not bear + themselves without the verse and therefore stood + lamely in the verse. + +CELIA But didst thou hear without wondering how thy name + should be hanged and carved upon these trees? + +ROSALIND I was seven of the nine days out of the wonder + before you came; for look here what I found on a + palm-tree. I was never so be-rhymed since + Pythagoras' time, that I was an Irish rat, which I + can hardly remember. + +CELIA Trow you who hath done this? + +ROSALIND Is it a man? + +CELIA And a chain, that you once wore, about his neck. + Change you colour? + +ROSALIND I prithee, who? + +CELIA O Lord, Lord! it is a hard matter for friends to + meet; but mountains may be removed with earthquakes + and so encounter. + +ROSALIND Nay, but who is it? + +CELIA Is it possible? + +ROSALIND Nay, I prithee now with most petitionary vehemence, + tell me who it is. + +CELIA O wonderful, wonderful, and most wonderful + wonderful! and yet again wonderful, and after that, + out of all hooping! + +ROSALIND Good my complexion! dost thou think, though I am + caparisoned like a man, I have a doublet and hose in + my disposition? One inch of delay more is a + South-sea of discovery; I prithee, tell me who is it + quickly, and speak apace. I would thou couldst + stammer, that thou mightst pour this concealed man + out of thy mouth, as wine comes out of a narrow- + mouthed bottle, either too much at once, or none at + all. I prithee, take the cork out of thy mouth that + may drink thy tidings. + +CELIA So you may put a man in your belly. + +ROSALIND Is he of God's making? What manner of man? Is his + head worth a hat, or his chin worth a beard? + +CELIA Nay, he hath but a little beard. + +ROSALIND Why, God will send more, if the man will be + thankful: let me stay the growth of his beard, if + thou delay me not the knowledge of his chin. + +CELIA It is young Orlando, that tripped up the wrestler's + heels and your heart both in an instant. + +ROSALIND Nay, but the devil take mocking: speak, sad brow and + true maid. + +CELIA I' faith, coz, 'tis he. + +ROSALIND Orlando? + +CELIA Orlando. + +ROSALIND Alas the day! what shall I do with my doublet and + hose? What did he when thou sawest him? What said + he? How looked he? Wherein went he? What makes + him here? Did he ask for me? Where remains he? + How parted he with thee? and when shalt thou see + him again? Answer me in one word. + +CELIA You must borrow me Gargantua's mouth first: 'tis a + word too great for any mouth of this age's size. To + say ay and no to these particulars is more than to + answer in a catechism. + +ROSALIND But doth he know that I am in this forest and in + man's apparel? Looks he as freshly as he did the + day he wrestled? + +CELIA It is as easy to count atomies as to resolve the + propositions of a lover; but take a taste of my + finding him, and relish it with good observance. + I found him under a tree, like a dropped acorn. + +ROSALIND It may well be called Jove's tree, when it drops + forth such fruit. + +CELIA Give me audience, good madam. + +ROSALIND Proceed. + +CELIA There lay he, stretched along, like a wounded knight. + +ROSALIND Though it be pity to see such a sight, it well + becomes the ground. + +CELIA Cry 'holla' to thy tongue, I prithee; it curvets + unseasonably. He was furnished like a hunter. + +ROSALIND O, ominous! he comes to kill my heart. + +CELIA I would sing my song without a burden: thou bringest + me out of tune. + +ROSALIND Do you not know I am a woman? when I think, I must + speak. Sweet, say on. + +CELIA You bring me out. Soft! comes he not here? + + [Enter ORLANDO and JAQUES] + +ROSALIND 'Tis he: slink by, and note him. + +JAQUES I thank you for your company; but, good faith, I had + as lief have been myself alone. + +ORLANDO And so had I; but yet, for fashion sake, I thank you + too for your society. + +JAQUES God be wi' you: let's meet as little as we can. + +ORLANDO I do desire we may be better strangers. + +JAQUES I pray you, mar no more trees with writing + love-songs in their barks. + +ORLANDO I pray you, mar no more of my verses with reading + them ill-favouredly. + +JAQUES Rosalind is your love's name? + +ORLANDO Yes, just. + +JAQUES I do not like her name. + +ORLANDO There was no thought of pleasing you when she was + christened. + +JAQUES What stature is she of? + +ORLANDO Just as high as my heart. + +JAQUES You are full of pretty answers. Have you not been + acquainted with goldsmiths' wives, and conned them + out of rings? + +ORLANDO Not so; but I answer you right painted cloth, from + whence you have studied your questions. + +JAQUES You have a nimble wit: I think 'twas made of + Atalanta's heels. Will you sit down with me? and + we two will rail against our mistress the world and + all our misery. + +ORLANDO I will chide no breather in the world but myself, + against whom I know most faults. + +JAQUES The worst fault you have is to be in love. + +ORLANDO 'Tis a fault I will not change for your best virtue. + I am weary of you. + +JAQUES By my troth, I was seeking for a fool when I found + you. + +ORLANDO He is drowned in the brook: look but in, and you + shall see him. + +JAQUES There I shall see mine own figure. + +ORLANDO Which I take to be either a fool or a cipher. + +JAQUES I'll tarry no longer with you: farewell, good + Signior Love. + +ORLANDO I am glad of your departure: adieu, good Monsieur + Melancholy. + + [Exit JAQUES] + +ROSALIND [Aside to CELIA] I will speak to him, like a saucy + lackey and under that habit play the knave with him. + Do you hear, forester? + +ORLANDO Very well: what would you? + +ROSALIND I pray you, what is't o'clock? + +ORLANDO You should ask me what time o' day: there's no clock + in the forest. + +ROSALIND Then there is no true lover in the forest; else + sighing every minute and groaning every hour would + detect the lazy foot of Time as well as a clock. + +ORLANDO And why not the swift foot of Time? had not that + been as proper? + +ROSALIND By no means, sir: Time travels in divers paces with + divers persons. I'll tell you who Time ambles + withal, who Time trots withal, who Time gallops + withal and who he stands still withal. + +ORLANDO I prithee, who doth he trot withal? + +ROSALIND Marry, he trots hard with a young maid between the + contract of her marriage and the day it is + solemnized: if the interim be but a se'nnight, + Time's pace is so hard that it seems the length of + seven year. + +ORLANDO Who ambles Time withal? + +ROSALIND With a priest that lacks Latin and a rich man that + hath not the gout, for the one sleeps easily because + he cannot study, and the other lives merrily because + he feels no pain, the one lacking the burden of lean + and wasteful learning, the other knowing no burden + of heavy tedious penury; these Time ambles withal. + +ORLANDO Who doth he gallop withal? + +ROSALIND With a thief to the gallows, for though he go as + softly as foot can fall, he thinks himself too soon there. + +ORLANDO Who stays it still withal? + +ROSALIND With lawyers in the vacation, for they sleep between + term and term and then they perceive not how Time moves. + +ORLANDO Where dwell you, pretty youth? + +ROSALIND With this shepherdess, my sister; here in the + skirts of the forest, like fringe upon a petticoat. + +ORLANDO Are you native of this place? + +ROSALIND As the cony that you see dwell where she is kindled. + +ORLANDO Your accent is something finer than you could + purchase in so removed a dwelling. + +ROSALIND I have been told so of many: but indeed an old + religious uncle of mine taught me to speak, who was + in his youth an inland man; one that knew courtship + too well, for there he fell in love. I have heard + him read many lectures against it, and I thank God + I am not a woman, to be touched with so many + giddy offences as he hath generally taxed their + whole sex withal. + +ORLANDO Can you remember any of the principal evils that he + laid to the charge of women? + +ROSALIND There were none principal; they were all like one + another as half-pence are, every one fault seeming + monstrous till his fellow fault came to match it. + +ORLANDO I prithee, recount some of them. + +ROSALIND No, I will not cast away my physic but on those that + are sick. There is a man haunts the forest, that + abuses our young plants with carving 'Rosalind' on + their barks; hangs odes upon hawthorns and elegies + on brambles, all, forsooth, deifying the name of + Rosalind: if I could meet that fancy-monger I would + give him some good counsel, for he seems to have the + quotidian of love upon him. + +ORLANDO I am he that is so love-shaked: I pray you tell me + your remedy. + +ROSALIND There is none of my uncle's marks upon you: he + taught me how to know a man in love; in which cage + of rushes I am sure you are not prisoner. + +ORLANDO What were his marks? + +ROSALIND A lean cheek, which you have not, a blue eye and + sunken, which you have not, an unquestionable + spirit, which you have not, a beard neglected, + which you have not; but I pardon you for that, for + simply your having in beard is a younger brother's + revenue: then your hose should be ungartered, your + bonnet unbanded, your sleeve unbuttoned, your shoe + untied and every thing about you demonstrating a + careless desolation; but you are no such man; you + are rather point-device in your accoutrements as + loving yourself than seeming the lover of any other. + +ORLANDO Fair youth, I would I could make thee believe I love. + +ROSALIND Me believe it! you may as soon make her that you + love believe it; which, I warrant, she is apter to + do than to confess she does: that is one of the + points in the which women still give the lie to + their consciences. But, in good sooth, are you he + that hangs the verses on the trees, wherein Rosalind + is so admired? + +ORLANDO I swear to thee, youth, by the white hand of + Rosalind, I am that he, that unfortunate he. + +ROSALIND But are you so much in love as your rhymes speak? + +ORLANDO Neither rhyme nor reason can express how much. + +ROSALIND Love is merely a madness, and, I tell you, deserves + as well a dark house and a whip as madmen do: and + the reason why they are not so punished and cured + is, that the lunacy is so ordinary that the whippers + are in love too. Yet I profess curing it by counsel. + +ORLANDO Did you ever cure any so? + +ROSALIND Yes, one, and in this manner. He was to imagine me + his love, his mistress; and I set him every day to + woo me: at which time would I, being but a moonish + youth, grieve, be effeminate, changeable, longing + and liking, proud, fantastical, apish, shallow, + inconstant, full of tears, full of smiles, for every + passion something and for no passion truly any + thing, as boys and women are for the most part + cattle of this colour; would now like him, now loathe + him; then entertain him, then forswear him; now weep + for him, then spit at him; that I drave my suitor + from his mad humour of love to a living humour of + madness; which was, to forswear the full stream of + the world, and to live in a nook merely monastic. + And thus I cured him; and this way will I take upon + me to wash your liver as clean as a sound sheep's + heart, that there shall not be one spot of love in't. + +ORLANDO I would not be cured, youth. + +ROSALIND I would cure you, if you would but call me Rosalind + and come every day to my cote and woo me. + +ORLANDO Now, by the faith of my love, I will: tell me + where it is. + +ROSALIND Go with me to it and I'll show it you and by the way + you shall tell me where in the forest you live. + Will you go? + +ORLANDO With all my heart, good youth. + +ROSALIND Nay you must call me Rosalind. Come, sister, will you go? + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE III The forest. + + + [Enter TOUCHSTONE and AUDREY; JAQUES behind] + +TOUCHSTONE Come apace, good Audrey: I will fetch up your + goats, Audrey. And how, Audrey? am I the man yet? + doth my simple feature content you? + +AUDREY Your features! Lord warrant us! what features! + +TOUCHSTONE I am here with thee and thy goats, as the most + capricious poet, honest Ovid, was among the Goths. + +JAQUES [Aside] O knowledge ill-inhabited, worse than Jove + in a thatched house! + +TOUCHSTONE When a man's verses cannot be understood, nor a + man's good wit seconded with the forward child + Understanding, it strikes a man more dead than a + great reckoning in a little room. Truly, I would + the gods had made thee poetical. + +AUDREY I do not know what 'poetical' is: is it honest in + deed and word? is it a true thing? + +TOUCHSTONE No, truly; for the truest poetry is the most + feigning; and lovers are given to poetry, and what + they swear in poetry may be said as lovers they do feign. + +AUDREY Do you wish then that the gods had made me poetical? + +TOUCHSTONE I do, truly; for thou swearest to me thou art + honest: now, if thou wert a poet, I might have some + hope thou didst feign. + +AUDREY Would you not have me honest? + +TOUCHSTONE No, truly, unless thou wert hard-favoured; for + honesty coupled to beauty is to have honey a sauce to sugar. + +JAQUES [Aside] A material fool! + +AUDREY Well, I am not fair; and therefore I pray the gods + make me honest. + +TOUCHSTONE Truly, and to cast away honesty upon a foul slut + were to put good meat into an unclean dish. + +AUDREY I am not a slut, though I thank the gods I am foul. + +TOUCHSTONE Well, praised be the gods for thy foulness! + sluttishness may come hereafter. But be it as it may + be, I will marry thee, and to that end I have been + with Sir Oliver Martext, the vicar of the next + village, who hath promised to meet me in this place + of the forest and to couple us. + +JAQUES [Aside] I would fain see this meeting. + +AUDREY Well, the gods give us joy! + +TOUCHSTONE Amen. A man may, if he were of a fearful heart, + stagger in this attempt; for here we have no temple + but the wood, no assembly but horn-beasts. But what + though? Courage! As horns are odious, they are + necessary. It is said, 'many a man knows no end of + his goods:' right; many a man has good horns, and + knows no end of them. Well, that is the dowry of + his wife; 'tis none of his own getting. Horns? + Even so. Poor men alone? No, no; the noblest deer + hath them as huge as the rascal. Is the single man + therefore blessed? No: as a walled town is more + worthier than a village, so is the forehead of a + married man more honourable than the bare brow of a + bachelor; and by how much defence is better than no + skill, by so much is a horn more precious than to + want. Here comes Sir Oliver. + + [Enter SIR OLIVER MARTEXT] + + Sir Oliver Martext, you are well met: will you + dispatch us here under this tree, or shall we go + with you to your chapel? + +SIR OLIVER MARTEXT Is there none here to give the woman? + +TOUCHSTONE I will not take her on gift of any man. + +SIR OLIVER MARTEXT Truly, she must be given, or the marriage is not lawful. + +JAQUES [Advancing] + + Proceed, proceed I'll give her. + +TOUCHSTONE Good even, good Master What-ye-call't: how do you, + sir? You are very well met: God 'ild you for your + last company: I am very glad to see you: even a + toy in hand here, sir: nay, pray be covered. + +JAQUES Will you be married, motley? + +TOUCHSTONE As the ox hath his bow, sir, the horse his curb and + the falcon her bells, so man hath his desires; and + as pigeons bill, so wedlock would be nibbling. + +JAQUES And will you, being a man of your breeding, be + married under a bush like a beggar? Get you to + church, and have a good priest that can tell you + what marriage is: this fellow will but join you + together as they join wainscot; then one of you will + prove a shrunk panel and, like green timber, warp, warp. + +TOUCHSTONE [Aside] I am not in the mind but I were better to be + married of him than of another: for he is not like + to marry me well; and not being well married, it + will be a good excuse for me hereafter to leave my wife. + +JAQUES Go thou with me, and let me counsel thee. + +TOUCHSTONE 'Come, sweet Audrey: + We must be married, or we must live in bawdry. + Farewell, good Master Oliver: not,-- + O sweet Oliver, + O brave Oliver, + Leave me not behind thee: but,-- + Wind away, + Begone, I say, + I will not to wedding with thee. + + [Exeunt JAQUES, TOUCHSTONE and AUDREY] + +SIR OLIVER MARTEXT 'Tis no matter: ne'er a fantastical knave of them + all shall flout me out of my calling. + + [Exit] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE IV The forest. + + + [Enter ROSALIND and CELIA] + +ROSALIND Never talk to me; I will weep. + +CELIA Do, I prithee; but yet have the grace to consider + that tears do not become a man. + +ROSALIND But have I not cause to weep? + +CELIA As good cause as one would desire; therefore weep. + +ROSALIND His very hair is of the dissembling colour. + +CELIA Something browner than Judas's marry, his kisses are + Judas's own children. + +ROSALIND I' faith, his hair is of a good colour. + +CELIA An excellent colour: your chestnut was ever the only colour. + +ROSALIND And his kissing is as full of sanctity as the touch + of holy bread. + +CELIA He hath bought a pair of cast lips of Diana: a nun + of winter's sisterhood kisses not more religiously; + the very ice of chastity is in them. + +ROSALIND But why did he swear he would come this morning, and + comes not? + +CELIA Nay, certainly, there is no truth in him. + +ROSALIND Do you think so? + +CELIA Yes; I think he is not a pick-purse nor a + horse-stealer, but for his verity in love, I do + think him as concave as a covered goblet or a + worm-eaten nut. + +ROSALIND Not true in love? + +CELIA Yes, when he is in; but I think he is not in. + +ROSALIND You have heard him swear downright he was. + +CELIA 'Was' is not 'is:' besides, the oath of a lover is + no stronger than the word of a tapster; they are + both the confirmer of false reckonings. He attends + here in the forest on the duke your father. + +ROSALIND I met the duke yesterday and had much question with + him: he asked me of what parentage I was; I told + him, of as good as he; so he laughed and let me go. + But what talk we of fathers, when there is such a + man as Orlando? + +CELIA O, that's a brave man! he writes brave verses, + speaks brave words, swears brave oaths and breaks + them bravely, quite traverse, athwart the heart of + his lover; as a puisny tilter, that spurs his horse + but on one side, breaks his staff like a noble + goose: but all's brave that youth mounts and folly + guides. Who comes here? + + [Enter CORIN] + +CORIN Mistress and master, you have oft inquired + After the shepherd that complain'd of love, + Who you saw sitting by me on the turf, + Praising the proud disdainful shepherdess + That was his mistress. + +CELIA Well, and what of him? + +CORIN If you will see a pageant truly play'd, + Between the pale complexion of true love + And the red glow of scorn and proud disdain, + Go hence a little and I shall conduct you, + If you will mark it. + +ROSALIND O, come, let us remove: + The sight of lovers feedeth those in love. + Bring us to this sight, and you shall say + I'll prove a busy actor in their play. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE V Another part of the forest. + + + [Enter SILVIUS and PHEBE] + +SILVIUS Sweet Phebe, do not scorn me; do not, Phebe; + Say that you love me not, but say not so + In bitterness. The common executioner, + Whose heart the accustom'd sight of death makes hard, + Falls not the axe upon the humbled neck + But first begs pardon: will you sterner be + Than he that dies and lives by bloody drops? + + [Enter ROSALIND, CELIA, and CORIN, behind] + +PHEBE I would not be thy executioner: + I fly thee, for I would not injure thee. + Thou tell'st me there is murder in mine eye: + 'Tis pretty, sure, and very probable, + That eyes, that are the frail'st and softest things, + Who shut their coward gates on atomies, + Should be call'd tyrants, butchers, murderers! + Now I do frown on thee with all my heart; + And if mine eyes can wound, now let them kill thee: + Now counterfeit to swoon; why now fall down; + Or if thou canst not, O, for shame, for shame, + Lie not, to say mine eyes are murderers! + Now show the wound mine eye hath made in thee: + Scratch thee but with a pin, and there remains + Some scar of it; lean but upon a rush, + The cicatrice and capable impressure + Thy palm some moment keeps; but now mine eyes, + Which I have darted at thee, hurt thee not, + Nor, I am sure, there is no force in eyes + That can do hurt. + +SILVIUS O dear Phebe, + If ever,--as that ever may be near,-- + You meet in some fresh cheek the power of fancy, + Then shall you know the wounds invisible + That love's keen arrows make. + +PHEBE But till that time + Come not thou near me: and when that time comes, + Afflict me with thy mocks, pity me not; + As till that time I shall not pity thee. + +ROSALIND And why, I pray you? Who might be your mother, + That you insult, exult, and all at once, + Over the wretched? What though you have no beauty,-- + As, by my faith, I see no more in you + Than without candle may go dark to bed-- + Must you be therefore proud and pitiless? + Why, what means this? Why do you look on me? + I see no more in you than in the ordinary + Of nature's sale-work. 'Od's my little life, + I think she means to tangle my eyes too! + No, faith, proud mistress, hope not after it: + 'Tis not your inky brows, your black silk hair, + Your bugle eyeballs, nor your cheek of cream, + That can entame my spirits to your worship. + You foolish shepherd, wherefore do you follow her, + Like foggy south puffing with wind and rain? + You are a thousand times a properer man + Than she a woman: 'tis such fools as you + That makes the world full of ill-favour'd children: + 'Tis not her glass, but you, that flatters her; + And out of you she sees herself more proper + Than any of her lineaments can show her. + But, mistress, know yourself: down on your knees, + And thank heaven, fasting, for a good man's love: + For I must tell you friendly in your ear, + Sell when you can: you are not for all markets: + Cry the man mercy; love him; take his offer: + Foul is most foul, being foul to be a scoffer. + So take her to thee, shepherd: fare you well. + +PHEBE Sweet youth, I pray you, chide a year together: + I had rather hear you chide than this man woo. + +ROSALIND He's fallen in love with your foulness and she'll + fall in love with my anger. If it be so, as fast as + she answers thee with frowning looks, I'll sauce her + with bitter words. Why look you so upon me? + +PHEBE For no ill will I bear you. + +ROSALIND I pray you, do not fall in love with me, + For I am falser than vows made in wine: + Besides, I like you not. If you will know my house, + 'Tis at the tuft of olives here hard by. + Will you go, sister? Shepherd, ply her hard. + Come, sister. Shepherdess, look on him better, + And be not proud: though all the world could see, + None could be so abused in sight as he. + Come, to our flock. + + [Exeunt ROSALIND, CELIA and CORIN] + +PHEBE Dead Shepherd, now I find thy saw of might, + 'Who ever loved that loved not at first sight?' + +SILVIUS Sweet Phebe,-- + +PHEBE Ha, what say'st thou, Silvius? + +SILVIUS Sweet Phebe, pity me. + +PHEBE Why, I am sorry for thee, gentle Silvius. + +SILVIUS Wherever sorrow is, relief would be: + If you do sorrow at my grief in love, + By giving love your sorrow and my grief + Were both extermined. + +PHEBE Thou hast my love: is not that neighbourly? + +SILVIUS I would have you. + +PHEBE Why, that were covetousness. + Silvius, the time was that I hated thee, + And yet it is not that I bear thee love; + But since that thou canst talk of love so well, + Thy company, which erst was irksome to me, + I will endure, and I'll employ thee too: + But do not look for further recompense + Than thine own gladness that thou art employ'd. + +SILVIUS So holy and so perfect is my love, + And I in such a poverty of grace, + That I shall think it a most plenteous crop + To glean the broken ears after the man + That the main harvest reaps: loose now and then + A scatter'd smile, and that I'll live upon. + +PHEBE Know'st now the youth that spoke to me erewhile? + +SILVIUS Not very well, but I have met him oft; + And he hath bought the cottage and the bounds + That the old carlot once was master of. + +PHEBE Think not I love him, though I ask for him: + 'Tis but a peevish boy; yet he talks well; + But what care I for words? yet words do well + When he that speaks them pleases those that hear. + It is a pretty youth: not very pretty: + But, sure, he's proud, and yet his pride becomes him: + He'll make a proper man: the best thing in him + Is his complexion; and faster than his tongue + Did make offence his eye did heal it up. + He is not very tall; yet for his years he's tall: + His leg is but so so; and yet 'tis well: + There was a pretty redness in his lip, + A little riper and more lusty red + Than that mix'd in his cheek; 'twas just the difference + Between the constant red and mingled damask. + There be some women, Silvius, had they mark'd him + In parcels as I did, would have gone near + To fall in love with him; but, for my part, + I love him not nor hate him not; and yet + I have more cause to hate him than to love him: + For what had he to do to chide at me? + He said mine eyes were black and my hair black: + And, now I am remember'd, scorn'd at me: + I marvel why I answer'd not again: + But that's all one; omittance is no quittance. + I'll write to him a very taunting letter, + And thou shalt bear it: wilt thou, Silvius? + +SILVIUS Phebe, with all my heart. + +PHEBE I'll write it straight; + The matter's in my head and in my heart: + I will be bitter with him and passing short. + Go with me, Silvius. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT IV + + + +SCENE I The forest. + + + [Enter ROSALIND, CELIA, and JAQUES] + +JAQUES I prithee, pretty youth, let me be better acquainted + with thee. + +ROSALIND They say you are a melancholy fellow. + +JAQUES I am so; I do love it better than laughing. + +ROSALIND Those that are in extremity of either are abominable + fellows and betray themselves to every modern + censure worse than drunkards. + +JAQUES Why, 'tis good to be sad and say nothing. + +ROSALIND Why then, 'tis good to be a post. + +JAQUES I have neither the scholar's melancholy, which is + emulation, nor the musician's, which is fantastical, + nor the courtier's, which is proud, nor the + soldier's, which is ambitious, nor the lawyer's, + which is politic, nor the lady's, which is nice, nor + the lover's, which is all these: but it is a + melancholy of mine own, compounded of many simples, + extracted from many objects, and indeed the sundry's + contemplation of my travels, in which my often + rumination wraps me m a most humorous sadness. + +ROSALIND A traveller! By my faith, you have great reason to + be sad: I fear you have sold your own lands to see + other men's; then, to have seen much and to have + nothing, is to have rich eyes and poor hands. + +JAQUES Yes, I have gained my experience. + +ROSALIND And your experience makes you sad: I had rather have + a fool to make me merry than experience to make me + sad; and to travel for it too! + + [Enter ORLANDO] + +ORLANDO Good day and happiness, dear Rosalind! + +JAQUES Nay, then, God be wi' you, an you talk in blank verse. + + [Exit] + +ROSALIND Farewell, Monsieur Traveller: look you lisp and + wear strange suits, disable all the benefits of your + own country, be out of love with your nativity and + almost chide God for making you that countenance you + are, or I will scarce think you have swam in a + gondola. Why, how now, Orlando! where have you been + all this while? You a lover! An you serve me such + another trick, never come in my sight more. + +ORLANDO My fair Rosalind, I come within an hour of my promise. + +ROSALIND Break an hour's promise in love! He that will + divide a minute into a thousand parts and break but + a part of the thousandth part of a minute in the + affairs of love, it may be said of him that Cupid + hath clapped him o' the shoulder, but I'll warrant + him heart-whole. + +ORLANDO Pardon me, dear Rosalind. + +ROSALIND Nay, an you be so tardy, come no more in my sight: I + had as lief be wooed of a snail. + +ORLANDO Of a snail? + +ROSALIND Ay, of a snail; for though he comes slowly, he + carries his house on his head; a better jointure, + I think, than you make a woman: besides he brings + his destiny with him. + +ORLANDO What's that? + +ROSALIND Why, horns, which such as you are fain to be + beholding to your wives for: but he comes armed in + his fortune and prevents the slander of his wife. + +ORLANDO Virtue is no horn-maker; and my Rosalind is virtuous. + +ROSALIND And I am your Rosalind. + +CELIA It pleases him to call you so; but he hath a + Rosalind of a better leer than you. + +ROSALIND Come, woo me, woo me, for now I am in a holiday + humour and like enough to consent. What would you + say to me now, an I were your very very Rosalind? + +ORLANDO I would kiss before I spoke. + +ROSALIND Nay, you were better speak first, and when you were + gravelled for lack of matter, you might take + occasion to kiss. Very good orators, when they are + out, they will spit; and for lovers lacking--God + warn us!--matter, the cleanliest shift is to kiss. + +ORLANDO How if the kiss be denied? + +ROSALIND Then she puts you to entreaty, and there begins new matter. + +ORLANDO Who could be out, being before his beloved mistress? + +ROSALIND Marry, that should you, if I were your mistress, or + I should think my honesty ranker than my wit. + +ORLANDO What, of my suit? + +ROSALIND Not out of your apparel, and yet out of your suit. + Am not I your Rosalind? + +ORLANDO I take some joy to say you are, because I would be + talking of her. + +ROSALIND Well in her person I say I will not have you. + +ORLANDO Then in mine own person I die. + +ROSALIND No, faith, die by attorney. The poor world is + almost six thousand years old, and in all this time + there was not any man died in his own person, + videlicit, in a love-cause. Troilus had his brains + dashed out with a Grecian club; yet he did what he + could to die before, and he is one of the patterns + of love. Leander, he would have lived many a fair + year, though Hero had turned nun, if it had not been + for a hot midsummer night; for, good youth, he went + but forth to wash him in the Hellespont and being + taken with the cramp was drowned and the foolish + coroners of that age found it was 'Hero of Sestos.' + But these are all lies: men have died from time to + time and worms have eaten them, but not for love. + +ORLANDO I would not have my right Rosalind of this mind, + for, I protest, her frown might kill me. + +ROSALIND By this hand, it will not kill a fly. But come, now + I will be your Rosalind in a more coming-on + disposition, and ask me what you will. I will grant + it. + +ORLANDO Then love me, Rosalind. + +ROSALIND Yes, faith, will I, Fridays and Saturdays and all. + +ORLANDO And wilt thou have me? + +ROSALIND Ay, and twenty such. + +ORLANDO What sayest thou? + +ROSALIND Are you not good? + +ORLANDO I hope so. + +ROSALIND Why then, can one desire too much of a good thing? + Come, sister, you shall be the priest and marry us. + Give me your hand, Orlando. What do you say, sister? + +ORLANDO Pray thee, marry us. + +CELIA I cannot say the words. + +ROSALIND You must begin, 'Will you, Orlando--' + +CELIA Go to. Will you, Orlando, have to wife this Rosalind? + +ORLANDO I will. + +ROSALIND Ay, but when? + +ORLANDO Why now; as fast as she can marry us. + +ROSALIND Then you must say 'I take thee, Rosalind, for wife.' + +ORLANDO I take thee, Rosalind, for wife. + +ROSALIND I might ask you for your commission; but I do take + thee, Orlando, for my husband: there's a girl goes + before the priest; and certainly a woman's thought + runs before her actions. + +ORLANDO So do all thoughts; they are winged. + +ROSALIND Now tell me how long you would have her after you + have possessed her. + +ORLANDO For ever and a day. + +ROSALIND Say 'a day,' without the 'ever.' No, no, Orlando; + men are April when they woo, December when they wed: + maids are May when they are maids, but the sky + changes when they are wives. I will be more jealous + of thee than a Barbary cock-pigeon over his hen, + more clamorous than a parrot against rain, more + new-fangled than an ape, more giddy in my desires + than a monkey: I will weep for nothing, like Diana + in the fountain, and I will do that when you are + disposed to be merry; I will laugh like a hyen, and + that when thou art inclined to sleep. + +ORLANDO But will my Rosalind do so? + +ROSALIND By my life, she will do as I do. + +ORLANDO O, but she is wise. + +ROSALIND Or else she could not have the wit to do this: the + wiser, the waywarder: make the doors upon a woman's + wit and it will out at the casement; shut that and + 'twill out at the key-hole; stop that, 'twill fly + with the smoke out at the chimney. + +ORLANDO A man that had a wife with such a wit, he might say + 'Wit, whither wilt?' + +ROSALIND Nay, you might keep that cheque for it till you met + your wife's wit going to your neighbour's bed. + +ORLANDO And what wit could wit have to excuse that? + +ROSALIND Marry, to say she came to seek you there. You shall + never take her without her answer, unless you take + her without her tongue. O, that woman that cannot + make her fault her husband's occasion, let her + never nurse her child herself, for she will breed + it like a fool! + +ORLANDO For these two hours, Rosalind, I will leave thee. + +ROSALIND Alas! dear love, I cannot lack thee two hours. + +ORLANDO I must attend the duke at dinner: by two o'clock I + will be with thee again. + +ROSALIND Ay, go your ways, go your ways; I knew what you + would prove: my friends told me as much, and I + thought no less: that flattering tongue of yours + won me: 'tis but one cast away, and so, come, + death! Two o'clock is your hour? + +ORLANDO Ay, sweet Rosalind. + +ROSALIND By my troth, and in good earnest, and so God mend + me, and by all pretty oaths that are not dangerous, + if you break one jot of your promise or come one + minute behind your hour, I will think you the most + pathetical break-promise and the most hollow lover + and the most unworthy of her you call Rosalind that + may be chosen out of the gross band of the + unfaithful: therefore beware my censure and keep + your promise. + +ORLANDO With no less religion than if thou wert indeed my + Rosalind: so adieu. + +ROSALIND Well, Time is the old justice that examines all such + offenders, and let Time try: adieu. + + [Exit ORLANDO] + +CELIA You have simply misused our sex in your love-prate: + we must have your doublet and hose plucked over your + head, and show the world what the bird hath done to + her own nest. + +ROSALIND O coz, coz, coz, my pretty little coz, that thou + didst know how many fathom deep I am in love! But + it cannot be sounded: my affection hath an unknown + bottom, like the bay of Portugal. + +CELIA Or rather, bottomless, that as fast as you pour + affection in, it runs out. + +ROSALIND No, that same wicked bastard of Venus that was begot + of thought, conceived of spleen and born of madness, + that blind rascally boy that abuses every one's eyes + because his own are out, let him be judge how deep I + am in love. I'll tell thee, Aliena, I cannot be out + of the sight of Orlando: I'll go find a shadow and + sigh till he come. + +CELIA And I'll sleep. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT IV + + + +SCENE II The forest. + + + [Enter JAQUES, Lords, and Foresters] + +JAQUES Which is he that killed the deer? + +A Lord Sir, it was I. + +JAQUES Let's present him to the duke, like a Roman + conqueror; and it would do well to set the deer's + horns upon his head, for a branch of victory. Have + you no song, forester, for this purpose? + +Forester Yes, sir. + +JAQUES Sing it: 'tis no matter how it be in tune, so it + make noise enough. + + SONG. +Forester What shall he have that kill'd the deer? + His leather skin and horns to wear. + Then sing him home; + + [The rest shall bear this burden] + + Take thou no scorn to wear the horn; + It was a crest ere thou wast born: + Thy father's father wore it, + And thy father bore it: + The horn, the horn, the lusty horn + Is not a thing to laugh to scorn. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT IV + + + +SCENE III The forest. + + + [Enter ROSALIND and CELIA] + +ROSALIND How say you now? Is it not past two o'clock? and + here much Orlando! + +CELIA I warrant you, with pure love and troubled brain, he + hath ta'en his bow and arrows and is gone forth to + sleep. Look, who comes here. + + [Enter SILVIUS] + +SILVIUS My errand is to you, fair youth; + My gentle Phebe bid me give you this: + I know not the contents; but, as I guess + By the stern brow and waspish action + Which she did use as she was writing of it, + It bears an angry tenor: pardon me: + I am but as a guiltless messenger. + +ROSALIND Patience herself would startle at this letter + And play the swaggerer; bear this, bear all: + She says I am not fair, that I lack manners; + She calls me proud, and that she could not love me, + Were man as rare as phoenix. 'Od's my will! + Her love is not the hare that I do hunt: + Why writes she so to me? Well, shepherd, well, + This is a letter of your own device. + +SILVIUS No, I protest, I know not the contents: + Phebe did write it. + +ROSALIND Come, come, you are a fool + And turn'd into the extremity of love. + I saw her hand: she has a leathern hand. + A freestone-colour'd hand; I verily did think + That her old gloves were on, but 'twas her hands: + She has a huswife's hand; but that's no matter: + I say she never did invent this letter; + This is a man's invention and his hand. + +SILVIUS Sure, it is hers. + +ROSALIND Why, 'tis a boisterous and a cruel style. + A style for-challengers; why, she defies me, + Like Turk to Christian: women's gentle brain + Could not drop forth such giant-rude invention + Such Ethiope words, blacker in their effect + Than in their countenance. Will you hear the letter? + +SILVIUS So please you, for I never heard it yet; + Yet heard too much of Phebe's cruelty. + +ROSALIND She Phebes me: mark how the tyrant writes. + + [Reads] + + Art thou god to shepherd turn'd, + That a maiden's heart hath burn'd? + Can a woman rail thus? + +SILVIUS Call you this railing? + +ROSALIND [Reads] + + Why, thy godhead laid apart, + Warr'st thou with a woman's heart? + Did you ever hear such railing? + Whiles the eye of man did woo me, + That could do no vengeance to me. + Meaning me a beast. + If the scorn of your bright eyne + Have power to raise such love in mine, + Alack, in me what strange effect + Would they work in mild aspect! + Whiles you chid me, I did love; + How then might your prayers move! + He that brings this love to thee + Little knows this love in me: + And by him seal up thy mind; + Whether that thy youth and kind + Will the faithful offer take + Of me and all that I can make; + Or else by him my love deny, + And then I'll study how to die. + +SILVIUS Call you this chiding? + +CELIA Alas, poor shepherd! + +ROSALIND Do you pity him? no, he deserves no pity. Wilt + thou love such a woman? What, to make thee an + instrument and play false strains upon thee! not to + be endured! Well, go your way to her, for I see + love hath made thee a tame snake, and say this to + her: that if she love me, I charge her to love + thee; if she will not, I will never have her unless + thou entreat for her. If you be a true lover, + hence, and not a word; for here comes more company. + + [Exit SILVIUS] + + [Enter OLIVER] + +OLIVER Good morrow, fair ones: pray you, if you know, + Where in the purlieus of this forest stands + A sheep-cote fenced about with olive trees? + +CELIA West of this place, down in the neighbour bottom: + The rank of osiers by the murmuring stream + Left on your right hand brings you to the place. + But at this hour the house doth keep itself; + There's none within. + +OLIVER If that an eye may profit by a tongue, + Then should I know you by description; + Such garments and such years: 'The boy is fair, + Of female favour, and bestows himself + Like a ripe sister: the woman low + And browner than her brother.' Are not you + The owner of the house I did inquire for? + +CELIA It is no boast, being ask'd, to say we are. + +OLIVER Orlando doth commend him to you both, + And to that youth he calls his Rosalind + He sends this bloody napkin. Are you he? + +ROSALIND I am: what must we understand by this? + +OLIVER Some of my shame; if you will know of me + What man I am, and how, and why, and where + This handkercher was stain'd. + +CELIA I pray you, tell it. + +OLIVER When last the young Orlando parted from you + He left a promise to return again + Within an hour, and pacing through the forest, + Chewing the food of sweet and bitter fancy, + Lo, what befell! he threw his eye aside, + And mark what object did present itself: + Under an oak, whose boughs were moss'd with age + And high top bald with dry antiquity, + A wretched ragged man, o'ergrown with hair, + Lay sleeping on his back: about his neck + A green and gilded snake had wreathed itself, + Who with her head nimble in threats approach'd + The opening of his mouth; but suddenly, + Seeing Orlando, it unlink'd itself, + And with indented glides did slip away + Into a bush: under which bush's shade + A lioness, with udders all drawn dry, + Lay couching, head on ground, with catlike watch, + When that the sleeping man should stir; for 'tis + The royal disposition of that beast + To prey on nothing that doth seem as dead: + This seen, Orlando did approach the man + And found it was his brother, his elder brother. + +CELIA O, I have heard him speak of that same brother; + And he did render him the most unnatural + That lived amongst men. + +OLIVER And well he might so do, + For well I know he was unnatural. + +ROSALIND But, to Orlando: did he leave him there, + Food to the suck'd and hungry lioness? + +OLIVER Twice did he turn his back and purposed so; + But kindness, nobler ever than revenge, + And nature, stronger than his just occasion, + Made him give battle to the lioness, + Who quickly fell before him: in which hurtling + From miserable slumber I awaked. + +CELIA Are you his brother? + +ROSALIND Wast you he rescued? + +CELIA Was't you that did so oft contrive to kill him? + +OLIVER 'Twas I; but 'tis not I I do not shame + To tell you what I was, since my conversion + So sweetly tastes, being the thing I am. + +ROSALIND But, for the bloody napkin? + +OLIVER By and by. + When from the first to last betwixt us two + Tears our recountments had most kindly bathed, + As how I came into that desert place:-- + In brief, he led me to the gentle duke, + Who gave me fresh array and entertainment, + Committing me unto my brother's love; + Who led me instantly unto his cave, + There stripp'd himself, and here upon his arm + The lioness had torn some flesh away, + Which all this while had bled; and now he fainted + And cried, in fainting, upon Rosalind. + Brief, I recover'd him, bound up his wound; + And, after some small space, being strong at heart, + He sent me hither, stranger as I am, + To tell this story, that you might excuse + His broken promise, and to give this napkin + Dyed in his blood unto the shepherd youth + That he in sport doth call his Rosalind. + + [ROSALIND swoons] + +CELIA Why, how now, Ganymede! sweet Ganymede! + +OLIVER Many will swoon when they do look on blood. + +CELIA There is more in it. Cousin Ganymede! + +OLIVER Look, he recovers. + +ROSALIND I would I were at home. + +CELIA We'll lead you thither. + I pray you, will you take him by the arm? + +OLIVER Be of good cheer, youth: you a man! you lack a + man's heart. + +ROSALIND I do so, I confess it. Ah, sirrah, a body would + think this was well counterfeited! I pray you, tell + your brother how well I counterfeited. Heigh-ho! + +OLIVER This was not counterfeit: there is too great + testimony in your complexion that it was a passion + of earnest. + +ROSALIND Counterfeit, I assure you. + +OLIVER Well then, take a good heart and counterfeit to be a man. + +ROSALIND So I do: but, i' faith, I should have been a woman by right. + +CELIA Come, you look paler and paler: pray you, draw + homewards. Good sir, go with us. + +OLIVER That will I, for I must bear answer back + How you excuse my brother, Rosalind. + +ROSALIND I shall devise something: but, I pray you, commend + my counterfeiting to him. Will you go? + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT V + + + +SCENE I The forest. + + + [Enter TOUCHSTONE and AUDREY] + +TOUCHSTONE We shall find a time, Audrey; patience, gentle Audrey. + +AUDREY Faith, the priest was good enough, for all the old + gentleman's saying. + +TOUCHSTONE A most wicked Sir Oliver, Audrey, a most vile + Martext. But, Audrey, there is a youth here in the + forest lays claim to you. + +AUDREY Ay, I know who 'tis; he hath no interest in me in + the world: here comes the man you mean. + +TOUCHSTONE It is meat and drink to me to see a clown: by my + troth, we that have good wits have much to answer + for; we shall be flouting; we cannot hold. + + [Enter WILLIAM] + +WILLIAM Good even, Audrey. + +AUDREY God ye good even, William. + +WILLIAM And good even to you, sir. + +TOUCHSTONE Good even, gentle friend. Cover thy head, cover thy + head; nay, prithee, be covered. How old are you, friend? + +WILLIAM Five and twenty, sir. + +TOUCHSTONE A ripe age. Is thy name William? + +WILLIAM William, sir. + +TOUCHSTONE A fair name. Wast born i' the forest here? + +WILLIAM Ay, sir, I thank God. + +TOUCHSTONE 'Thank God;' a good answer. Art rich? + +WILLIAM Faith, sir, so so. + +TOUCHSTONE 'So so' is good, very good, very excellent good; and + yet it is not; it is but so so. Art thou wise? + +WILLIAM Ay, sir, I have a pretty wit. + +TOUCHSTONE Why, thou sayest well. I do now remember a saying, + 'The fool doth think he is wise, but the wise man + knows himself to be a fool.' The heathen + philosopher, when he had a desire to eat a grape, + would open his lips when he put it into his mouth; + meaning thereby that grapes were made to eat and + lips to open. You do love this maid? + +WILLIAM I do, sir. + +TOUCHSTONE Give me your hand. Art thou learned? + +WILLIAM No, sir. + +TOUCHSTONE Then learn this of me: to have, is to have; for it + is a figure in rhetoric that drink, being poured out + of a cup into a glass, by filling the one doth empty + the other; for all your writers do consent that ipse + is he: now, you are not ipse, for I am he. + +WILLIAM Which he, sir? + +TOUCHSTONE He, sir, that must marry this woman. Therefore, you + clown, abandon,--which is in the vulgar leave,--the + society,--which in the boorish is company,--of this + female,--which in the common is woman; which + together is, abandon the society of this female, or, + clown, thou perishest; or, to thy better + understanding, diest; or, to wit I kill thee, make + thee away, translate thy life into death, thy + liberty into bondage: I will deal in poison with + thee, or in bastinado, or in steel; I will bandy + with thee in faction; I will o'errun thee with + policy; I will kill thee a hundred and fifty ways: + therefore tremble and depart. + +AUDREY Do, good William. + +WILLIAM God rest you merry, sir. + + [Exit] + + [Enter CORIN] + +CORIN Our master and mistress seeks you; come, away, away! + +TOUCHSTONE Trip, Audrey! trip, Audrey! I attend, I attend. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT V + + + +SCENE II The forest. + + + [Enter ORLANDO and OLIVER] + +ORLANDO Is't possible that on so little acquaintance you + should like her? that but seeing you should love + her? and loving woo? and, wooing, she should + grant? and will you persever to enjoy her? + +OLIVER Neither call the giddiness of it in question, the + poverty of her, the small acquaintance, my sudden + wooing, nor her sudden consenting; but say with me, + I love Aliena; say with her that she loves me; + consent with both that we may enjoy each other: it + shall be to your good; for my father's house and all + the revenue that was old Sir Rowland's will I + estate upon you, and here live and die a shepherd. + +ORLANDO You have my consent. Let your wedding be to-morrow: + thither will I invite the duke and all's contented + followers. Go you and prepare Aliena; for look + you, here comes my Rosalind. + + [Enter ROSALIND] + +ROSALIND God save you, brother. + +OLIVER And you, fair sister. + + [Exit] + +ROSALIND O, my dear Orlando, how it grieves me to see thee + wear thy heart in a scarf! + +ORLANDO It is my arm. + +ROSALIND I thought thy heart had been wounded with the claws + of a lion. + +ORLANDO Wounded it is, but with the eyes of a lady. + +ROSALIND Did your brother tell you how I counterfeited to + swoon when he showed me your handkerchief? + +ORLANDO Ay, and greater wonders than that. + +ROSALIND O, I know where you are: nay, 'tis true: there was + never any thing so sudden but the fight of two rams + and Caesar's thrasonical brag of 'I came, saw, and + overcame:' for your brother and my sister no sooner + met but they looked, no sooner looked but they + loved, no sooner loved but they sighed, no sooner + sighed but they asked one another the reason, no + sooner knew the reason but they sought the remedy; + and in these degrees have they made a pair of stairs + to marriage which they will climb incontinent, or + else be incontinent before marriage: they are in + the very wrath of love and they will together; clubs + cannot part them. + +ORLANDO They shall be married to-morrow, and I will bid the + duke to the nuptial. But, O, how bitter a thing it + is to look into happiness through another man's + eyes! By so much the more shall I to-morrow be at + the height of heart-heaviness, by how much I shall + think my brother happy in having what he wishes for. + +ROSALIND Why then, to-morrow I cannot serve your turn for Rosalind? + +ORLANDO I can live no longer by thinking. + +ROSALIND I will weary you then no longer with idle talking. + Know of me then, for now I speak to some purpose, + that I know you are a gentleman of good conceit: I + speak not this that you should bear a good opinion + of my knowledge, insomuch I say I know you are; + neither do I labour for a greater esteem than may in + some little measure draw a belief from you, to do + yourself good and not to grace me. Believe then, if + you please, that I can do strange things: I have, + since I was three year old, conversed with a + magician, most profound in his art and yet not + damnable. If you do love Rosalind so near the heart + as your gesture cries it out, when your brother + marries Aliena, shall you marry her: I know into + what straits of fortune she is driven; and it is + not impossible to me, if it appear not inconvenient + to you, to set her before your eyes tomorrow human + as she is and without any danger. + +ORLANDO Speakest thou in sober meanings? + +ROSALIND By my life, I do; which I tender dearly, though I + say I am a magician. Therefore, put you in your + best array: bid your friends; for if you will be + married to-morrow, you shall, and to Rosalind, if you will. + + [Enter SILVIUS and PHEBE] + + Look, here comes a lover of mine and a lover of hers. + +PHEBE Youth, you have done me much ungentleness, + To show the letter that I writ to you. + +ROSALIND I care not if I have: it is my study + To seem despiteful and ungentle to you: + You are there followed by a faithful shepherd; + Look upon him, love him; he worships you. + +PHEBE Good shepherd, tell this youth what 'tis to love. + +SILVIUS It is to be all made of sighs and tears; + And so am I for Phebe. + +PHEBE And I for Ganymede. + +ORLANDO And I for Rosalind. + +ROSALIND And I for no woman. + +SILVIUS It is to be all made of faith and service; + And so am I for Phebe. + +PHEBE And I for Ganymede. + +ORLANDO And I for Rosalind. + +ROSALIND And I for no woman. + +SILVIUS It is to be all made of fantasy, + All made of passion and all made of wishes, + All adoration, duty, and observance, + All humbleness, all patience and impatience, + All purity, all trial, all observance; + And so am I for Phebe. + +PHEBE And so am I for Ganymede. + +ORLANDO And so am I for Rosalind. + +ROSALIND And so am I for no woman. + +PHEBE If this be so, why blame you me to love you? + +SILVIUS If this be so, why blame you me to love you? + +ORLANDO If this be so, why blame you me to love you? + +ROSALIND Who do you speak to, 'Why blame you me to love you?' + +ORLANDO To her that is not here, nor doth not hear. + +ROSALIND Pray you, no more of this; 'tis like the howling + of Irish wolves against the moon. + + [To SILVIUS] + + I will help you, if I can: + + [To PHEBE] + + I would love you, if I could. To-morrow meet me all together. + + [To PHEBE] + + I will marry you, if ever I marry woman, and I'll be + married to-morrow: + + [To ORLANDO] + + I will satisfy you, if ever I satisfied man, and you + shall be married to-morrow: + + [To SILVIUS] + + I will content you, if what pleases you contents + you, and you shall be married to-morrow. + + [To ORLANDO] + + As you love Rosalind, meet: + + [To SILVIUS] + + as you love Phebe, meet: and as I love no woman, + I'll meet. So fare you well: I have left you commands. + +SILVIUS I'll not fail, if I live. + +PHEBE Nor I. + +ORLANDO Nor I. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT V + + + +SCENE III The forest. + + + [Enter TOUCHSTONE and AUDREY] + +TOUCHSTONE To-morrow is the joyful day, Audrey; to-morrow will + we be married. + +AUDREY I do desire it with all my heart; and I hope it is + no dishonest desire to desire to be a woman of the + world. Here comes two of the banished duke's pages. + + [Enter two Pages] + +First Page Well met, honest gentleman. + +TOUCHSTONE By my troth, well met. Come, sit, sit, and a song. + +Second Page We are for you: sit i' the middle. + +First Page Shall we clap into't roundly, without hawking or + spitting or saying we are hoarse, which are the only + prologues to a bad voice? + +Second Page I'faith, i'faith; and both in a tune, like two + gipsies on a horse. + + SONG. + It was a lover and his lass, + With a hey, and a ho, and a hey nonino, + That o'er the green corn-field did pass + In the spring time, the only pretty ring time, + When birds do sing, hey ding a ding, ding: + Sweet lovers love the spring. + + Between the acres of the rye, + With a hey, and a ho, and a hey nonino + These pretty country folks would lie, + In spring time, &c. + + This carol they began that hour, + With a hey, and a ho, and a hey nonino, + How that a life was but a flower + In spring time, &c. + + And therefore take the present time, + With a hey, and a ho, and a hey nonino; + For love is crowned with the prime + In spring time, &c. + +TOUCHSTONE Truly, young gentlemen, though there was no great + matter in the ditty, yet the note was very + untuneable. + +First Page You are deceived, sir: we kept time, we lost not our time. + +TOUCHSTONE By my troth, yes; I count it but time lost to hear + such a foolish song. God be wi' you; and God mend + your voices! Come, Audrey. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT V + + + +SCENE IV The forest. + + + [Enter DUKE SENIOR, AMIENS, JAQUES, ORLANDO, OLIVER, + and CELIA] + +DUKE SENIOR Dost thou believe, Orlando, that the boy + Can do all this that he hath promised? + +ORLANDO I sometimes do believe, and sometimes do not; + As those that fear they hope, and know they fear. + + [Enter ROSALIND, SILVIUS, and PHEBE] + +ROSALIND Patience once more, whiles our compact is urged: + You say, if I bring in your Rosalind, + You will bestow her on Orlando here? + +DUKE SENIOR That would I, had I kingdoms to give with her. + +ROSALIND And you say, you will have her, when I bring her? + +ORLANDO That would I, were I of all kingdoms king. + +ROSALIND You say, you'll marry me, if I be willing? + +PHEBE That will I, should I die the hour after. + +ROSALIND But if you do refuse to marry me, + You'll give yourself to this most faithful shepherd? + +PHEBE So is the bargain. + +ROSALIND You say, that you'll have Phebe, if she will? + +SILVIUS Though to have her and death were both one thing. + +ROSALIND I have promised to make all this matter even. + Keep you your word, O duke, to give your daughter; + You yours, Orlando, to receive his daughter: + Keep your word, Phebe, that you'll marry me, + Or else refusing me, to wed this shepherd: + Keep your word, Silvius, that you'll marry her. + If she refuse me: and from hence I go, + To make these doubts all even. + + [Exeunt ROSALIND and CELIA] + +DUKE SENIOR I do remember in this shepherd boy + Some lively touches of my daughter's favour. + +ORLANDO My lord, the first time that I ever saw him + Methought he was a brother to your daughter: + But, my good lord, this boy is forest-born, + And hath been tutor'd in the rudiments + Of many desperate studies by his uncle, + Whom he reports to be a great magician, + Obscured in the circle of this forest. + + [Enter TOUCHSTONE and AUDREY] + +JAQUES There is, sure, another flood toward, and these + couples are coming to the ark. Here comes a pair of + very strange beasts, which in all tongues are called fools. + +TOUCHSTONE Salutation and greeting to you all! + +JAQUES Good my lord, bid him welcome: this is the + motley-minded gentleman that I have so often met in + the forest: he hath been a courtier, he swears. + +TOUCHSTONE If any man doubt that, let him put me to my + purgation. I have trod a measure; I have flattered + a lady; I have been politic with my friend, smooth + with mine enemy; I have undone three tailors; I have + had four quarrels, and like to have fought one. + +JAQUES And how was that ta'en up? + +TOUCHSTONE Faith, we met, and found the quarrel was upon the + seventh cause. + +JAQUES How seventh cause? Good my lord, like this fellow. + +DUKE SENIOR I like him very well. + +TOUCHSTONE God 'ild you, sir; I desire you of the like. I + press in here, sir, amongst the rest of the country + copulatives, to swear and to forswear: according as + marriage binds and blood breaks: a poor virgin, + sir, an ill-favoured thing, sir, but mine own; a poor + humour of mine, sir, to take that that no man else + will: rich honesty dwells like a miser, sir, in a + poor house; as your pearl in your foul oyster. + +DUKE SENIOR By my faith, he is very swift and sententious. + +TOUCHSTONE According to the fool's bolt, sir, and such dulcet diseases. + +JAQUES But, for the seventh cause; how did you find the + quarrel on the seventh cause? + +TOUCHSTONE Upon a lie seven times removed:--bear your body more + seeming, Audrey:--as thus, sir. I did dislike the + cut of a certain courtier's beard: he sent me word, + if I said his beard was not cut well, he was in the + mind it was: this is called the Retort Courteous. + If I sent him word again 'it was not well cut,' he + would send me word, he cut it to please himself: + this is called the Quip Modest. If again 'it was + not well cut,' he disabled my judgment: this is + called the Reply Churlish. If again 'it was not + well cut,' he would answer, I spake not true: this + is called the Reproof Valiant. If again 'it was not + well cut,' he would say I lied: this is called the + Counter-cheque Quarrelsome: and so to the Lie + Circumstantial and the Lie Direct. + +JAQUES And how oft did you say his beard was not well cut? + +TOUCHSTONE I durst go no further than the Lie Circumstantial, + nor he durst not give me the Lie Direct; and so we + measured swords and parted. + +JAQUES Can you nominate in order now the degrees of the lie? + +TOUCHSTONE O sir, we quarrel in print, by the book; as you have + books for good manners: I will name you the degrees. + The first, the Retort Courteous; the second, the + Quip Modest; the third, the Reply Churlish; the + fourth, the Reproof Valiant; the fifth, the + Countercheque Quarrelsome; the sixth, the Lie with + Circumstance; the seventh, the Lie Direct. All + these you may avoid but the Lie Direct; and you may + avoid that too, with an If. I knew when seven + justices could not take up a quarrel, but when the + parties were met themselves, one of them thought but + of an If, as, 'If you said so, then I said so;' and + they shook hands and swore brothers. Your If is the + only peacemaker; much virtue in If. + +JAQUES Is not this a rare fellow, my lord? he's as good at + any thing and yet a fool. + +DUKE SENIOR He uses his folly like a stalking-horse and under + the presentation of that he shoots his wit. + + [Enter HYMEN, ROSALIND, and CELIA] + + [Still Music] + +HYMEN Then is there mirth in heaven, + When earthly things made even + Atone together. + Good duke, receive thy daughter + Hymen from heaven brought her, + Yea, brought her hither, + That thou mightst join her hand with his + Whose heart within his bosom is. + +ROSALIND [To DUKE SENIOR] To you I give myself, for I am yours. + + [To ORLANDO] + + To you I give myself, for I am yours. + +DUKE SENIOR If there be truth in sight, you are my daughter. + +ORLANDO If there be truth in sight, you are my Rosalind. + +PHEBE If sight and shape be true, + Why then, my love adieu! + +ROSALIND I'll have no father, if you be not he: + I'll have no husband, if you be not he: + Nor ne'er wed woman, if you be not she. + +HYMEN Peace, ho! I bar confusion: + 'Tis I must make conclusion + Of these most strange events: + Here's eight that must take hands + To join in Hymen's bands, + If truth holds true contents. + You and you no cross shall part: + You and you are heart in heart + You to his love must accord, + Or have a woman to your lord: + You and you are sure together, + As the winter to foul weather. + Whiles a wedlock-hymn we sing, + Feed yourselves with questioning; + That reason wonder may diminish, + How thus we met, and these things finish. + + SONG. + Wedding is great Juno's crown: + O blessed bond of board and bed! + 'Tis Hymen peoples every town; + High wedlock then be honoured: + Honour, high honour and renown, + To Hymen, god of every town! + +DUKE SENIOR O my dear niece, welcome thou art to me! + Even daughter, welcome, in no less degree. + +PHEBE I will not eat my word, now thou art mine; + Thy faith my fancy to thee doth combine. + + [Enter JAQUES DE BOYS] + +JAQUES DE BOYS Let me have audience for a word or two: + I am the second son of old Sir Rowland, + That bring these tidings to this fair assembly. + Duke Frederick, hearing how that every day + Men of great worth resorted to this forest, + Address'd a mighty power; which were on foot, + In his own conduct, purposely to take + His brother here and put him to the sword: + And to the skirts of this wild wood he came; + Where meeting with an old religious man, + After some question with him, was converted + Both from his enterprise and from the world, + His crown bequeathing to his banish'd brother, + And all their lands restored to them again + That were with him exiled. This to be true, + I do engage my life. + +DUKE SENIOR Welcome, young man; + Thou offer'st fairly to thy brothers' wedding: + To one his lands withheld, and to the other + A land itself at large, a potent dukedom. + First, in this forest, let us do those ends + That here were well begun and well begot: + And after, every of this happy number + That have endured shrewd days and nights with us + Shall share the good of our returned fortune, + According to the measure of their states. + Meantime, forget this new-fall'n dignity + And fall into our rustic revelry. + Play, music! And you, brides and bridegrooms all, + With measure heap'd in joy, to the measures fall. + +JAQUES Sir, by your patience. If I heard you rightly, + The duke hath put on a religious life + And thrown into neglect the pompous court? + +JAQUES DE BOYS He hath. + +JAQUES To him will I : out of these convertites + There is much matter to be heard and learn'd. + + [To DUKE SENIOR] + + You to your former honour I bequeath; + Your patience and your virtue well deserves it: + + [To ORLANDO] + + You to a love that your true faith doth merit: + + [To OLIVER] + + You to your land and love and great allies: + + [To SILVIUS] + + You to a long and well-deserved bed: + + [To TOUCHSTONE] + + And you to wrangling; for thy loving voyage + Is but for two months victuall'd. So, to your pleasures: + I am for other than for dancing measures. + +DUKE SENIOR Stay, Jaques, stay. + +JAQUES To see no pastime I what you would have + I'll stay to know at your abandon'd cave. + + [Exit] + +DUKE SENIOR Proceed, proceed: we will begin these rites, + As we do trust they'll end, in true delights. + + [A dance] + + + + + AS YOU LIKE IT + + EPILOGUE + + +ROSALIND It is not the fashion to see the lady the epilogue; + but it is no more unhandsome than to see the lord + the prologue. If it be true that good wine needs + no bush, 'tis true that a good play needs no + epilogue; yet to good wine they do use good bushes, + and good plays prove the better by the help of good + epilogues. What a case am I in then, that am + neither a good epilogue nor cannot insinuate with + you in the behalf of a good play! I am not + furnished like a beggar, therefore to beg will not + become me: my way is to conjure you; and I'll begin + with the women. I charge you, O women, for the love + you bear to men, to like as much of this play as + please you: and I charge you, O men, for the love + you bear to women--as I perceive by your simpering, + none of you hates them--that between you and the + women the play may please. If I were a woman I + would kiss as many of you as had beards that pleased + me, complexions that liked me and breaths that I + defied not: and, I am sure, as many as have good + beards or good faces or sweet breaths will, for my + kind offer, when I make curtsy, bid me farewell. + + [Exeunt] diff --git a/chromium/third_party/snappy/src/testdata/baddata1.snappy b/chromium/third_party/snappy/src/testdata/baddata1.snappy new file mode 100644 index 00000000000..99d970fb4b2 Binary files /dev/null and b/chromium/third_party/snappy/src/testdata/baddata1.snappy differ diff --git a/chromium/third_party/snappy/src/testdata/baddata2.snappy b/chromium/third_party/snappy/src/testdata/baddata2.snappy new file mode 100644 index 00000000000..8f5cb13ee23 Binary files /dev/null and b/chromium/third_party/snappy/src/testdata/baddata2.snappy differ diff --git a/chromium/third_party/snappy/src/testdata/baddata3.snappy b/chromium/third_party/snappy/src/testdata/baddata3.snappy new file mode 100644 index 00000000000..774aead4dcd Binary files /dev/null and b/chromium/third_party/snappy/src/testdata/baddata3.snappy differ diff --git a/chromium/third_party/snappy/src/testdata/cp.html b/chromium/third_party/snappy/src/testdata/cp.html new file mode 100644 index 00000000000..1d0ca37eb97 --- /dev/null +++ b/chromium/third_party/snappy/src/testdata/cp.html @@ -0,0 +1,645 @@ + +Compression Pointers + + + + + +
+

Compression Pointers

+ + + +
+ +

+Compression resources, conferences, and some research +groups and companies, are listed towards the end of this page.

+ +Use this handy form to add something to this page, or to simply say you liked this page +

+ + + + + +

+ +

What's New?

+ + +Jean-loup Gailly -- Mr. gzip, +PNG, CCR (1996-06-10) + +
+ +MPEG Pointers and Resources + +
+ +Robert M. Gray -- Signal +compression, VQ, image quality evaluation (1996-04-22) +
+ +Compression and +Classification Group -- ISL,EE,Stanford (1996-04-22) +
+ +Signal Processing +and the International Information Infrastructure -- Web sites (1996-04-22) +
+ +Valenta, Vladimir -- (1996-04-22) +
+ + +Jordan, Frederic -- Parallel Image Compression (1996-04-12) +
+Electro-Optical Technologies, Inc. -- Consultant (1996-04-12) +
+quicktime.apple.com -- Quicktime site (1996-03-11) +
+IBM Hardware -- Compression chips (1996-03-11) +
+ + + + + + + + + + + + + + + + + + + + + + + + +

+ + +

+ + +

People

+

A

+ +Adler, Mark -- Info-ZIP; Zip, UnZip, gzip and zlib co-author; PNG group +

+ +

B

+ +Baker, Matthew -- Region based video compression +

+Bamberger, Roberto H. +

+Bell, Daniel -- Region based image compression +

+Bell, Tim -- compression, computer science for children, and computers and music. +

+Bellard, Fabrice -- Author of LZEXE +

+Berghorn, Willy +

+Bhaskaran, Vasudev -- Image and Video compression +

+Bloom, Charles -- text compression, LZ methods, PPM methods... +

+Brito, Roger -- Arithmetic Coding, LZW, Text Compression +

+Budge, Scott E. -- medical/lossy image compression +

+Burnett, Ian -- Speech coding, prototype waveform techniques +

+ + +

C

+ +Chan, Christopher -- universal lossy source coding, adaptive VQ +

+Chao, Hong-yang -- Lightning strike image compressor +

+Chao, Stewart +

+Cherriman, Peter +

+Cheung, S.C. -- Scalable video compression algorithms (18th Feb 1996) +

+ +Christopoulos, Charilaos -- Image and Video compression +

+Chrysafis, Christos +

+Chung, Wilson C. -- R-D image and video coding, subband/wavelet, filter banks +

+Clark, Alan -- primary contact for V.42bis. Developed BTLZ variant of LZW +

+Cleary, John -- PPM, PPM*, K* +

+Cohn, Martin +

+ +Cormack, Gordon V. -- DMC +

+Cramer, Chris -- neural network image compression +

+ +

D

+Danskin, John -- Protocol compression, document compression (9th Feb 1996) +

+Davis, Geoff -- wavelets, image compression, medical +

+Dilger, Andreas -- fractal block coding of video sequences +

+ + +

E

+Estes, Robert +

+ + + +

F

+Fisher, Yuval -- Fractal Image Compression +

+Ford, Adrian -- Subjective and Objective Compression quality (5th Mar 1996) +

+ +

G

+Jean-loup Gailly -- +Mr. gzip, PNG, CCR (1996-06-10) +

+ +Gersho, Allen -- Vector Quantisation, Image Compression +

+Goertzel, Ben +

+Gooch, Mark -- High Performance Hardware Compression (7th Feb 1996) +

+Goyal, Vivek -- overcomplete representations, adaptive transform coding, VQ +

+Robert M. Gray -- Signal +compression, VQ, image quality evaluation +

+ +

H

+Hafner, Ullrich -- WFA image compression +

+Hirschberg, Dan -- algorithm theory, compression +

+Holland, Scott +

+Horspool, R. Nigel -- text compression, ECG compression + +

I

+Inglis, Stuart -- image compression, OCR, lossy/lossless document compression +

+ +

J

+Jones, Douglas -- splay-tree based compression and encryption +

+Jones, Simon -- Lossless compression, High Performance Hardware (7th Feb 1996) +

+Jordan, Frederic -- Parallel Image Compression (12th April 1996) +

+Jung, Robert K. -- ARJ +

+jutta +

+ + + +

K

+Kominek, John -- Fractal and spline based compression +

+Kjelso, Morten -- Main memory compression, High performance hardware +

+Kuhn, Markus -- JBIG implementation +

+Kuo, C.-C. Jay +

+Kuru, Esa +

+Kyfonidis, Theodoros +

+ +

L

+Lamparter, Bernd +

+Langdon, Glen +

+Larsson, Jesper -- algorithms and data structures, text compression +

+ + +

M

+Manber, Udi +

+Mangen, Jean-Michel -- image compression, wavelets, satellite +

+Moffat, Alistair -- text and index compression, coding methods, information retrieval, document databases +

+Montgomery, Christopher -- OggSquish, audio compression +

+Mueller, Urban Dominik -- XPK system +

+

N

+Neal, Radford +

+Nevill-Manning, Craig +

+Nicholls, Jeremy +

+Noah, Matt -- speech, ATC, ACELP and IMBE +

+Nuri, Veyis -- wavelets, data compression, DSP (speech & image) + +

O

+Oleg -- Lots of code +

+Ortega, Antonio -- Video compression, Packet video, Adaptive quantization +

+Owen, Charles +

+ +

P

+Provine, +Joseph -- Model based coding +

+ +

R

+Robinson, John -- Binary Tree Predictive Coding +

+Roelofs, Greg -- Info-ZIP; primary UnZip author; PNG group +

+Rose, Kenneth +

+Russo, Roberto Maria -- Multiplatform Data Compression +

+ +

S

+Schmidt, Bill +

+Shaw, Sandy C. +

+Sharifi, Kamran -- Video over ATM networks +

+Shende, Sunil M. +

+Silverstein, D. Amnon +

+Smoot, Steve -- MPEG +

+Storer, James A. +

+Streit, Jurgen -- Low bitrate coding +

+Strutz, Tilo -- Wavelet image compressor, demonstration execs +

+ + +

T

+Tate, Steve +

+Teahan, Bill -- PPM, PPM*, master of the Calgary Corpus +

+Thomson, Duncan -- ECG compression with ANNs +

+Tilton, James C. +

+Tomczyk, Marek +

+Turpin, Andrew -- Prefix Codes +

+ +

V

+Vetterli, Martin -- wavelets, subband coding, video compression, computational complexity +

+Vitter, Jeff +

+Voukelatos, Stathis +

+de Vries, Nico -- AIP-NL, UltraCompressor II development +

+ +

W

+ +Wareham, Paul -- Region-oriented video coding +

+Wegener, Al -- DSP, lossless audio compression and AC-2 +

+Wei, Dong -- Wavelet compression +

+Williams, Ross +

+Witten, Ian -- PPM, mg, arithmetic coding +

+Wolff, Gerry +

+Woo, Woon-Tack -- stereo image and video compression (12th Feb 1996) +

+Wu, Xiaolin -- CALIC +

+ + +

Z

+Zobel, Justin -- index compression, database compression +

+ +
+
+ + + + +

Conferences

+Data Compression Conference (DCC), Snowbird, Utah, USA.
+

+ + + +

Resources

+
+Where to get answers... +
+
International Telecommunication Union (ITU) -- standards documents (CCITT) +
+
comp.compression -- Frequently Asked Questions -- Come here 1st! +
+JPEG - Frequently Asked Questions +
+MPEG - Frequently Asked Questions +
+Standards - Frequenty Asked Questions +
+usenet newsgroup: comp.compression.research +
+
+Archive Compression Test -- Summary of all archivers +
+
+Fractal compression bibliography -- bibtex file +
+
+LZ/Complexity Seminars -- (in German) +
+
+Comparitive Compression Ratios -- Sofar...B&W, Gray Scale, Text Compression +
+
+VCN (Video, Compression, Networking) +Glossary +
+
+Digital Library -- search for compression +
+ + +
+
+Reports/Ph.D. Theses +
+Paul Howards Ph.D. thesis
+
The Design and Analysis of Efficient Lossless Data Compression Systems +
+ + + + +
+
+Source code +
+Arithmetic coding routines +
        (from Moffat, Neal and Witten, Proc. DCC, April 1995) +
+
+CACM Arithmetic coding package +
        (Witten, Neal and Cleary, CACM 30:520-541, June 1987) +
+
+JBIG Source code Includes a Q-coder +
+
Markus Kuhn's JBIG implementation +
+
+k-arithmetic coder +
+
+Lossless Data Compression toolkit 1.1 +
+
+Splay Trees Code -- by Douglas W. Jones +
+
Block compression code -- Excellent text compressor +
+ + + +
+
+Test Files +
+Test Images -- CCITT images (pbm), Lena etc. (Sun raster) +
+
+Stockholm test images -- You have to buy a CDROM, thats all I know! :-( +
         mail me at singlis@cs.waikato.ac.nz if you know anything about them. +
+
+Calgary Text Compression Corpus (Text Compression, Bell, Cleary and Witten, 1990) +
+ + +
+ + + + +

Research Projects, Standards & Companies

+ +

+

+Research/Free software Groups +
Compression and +Classification Group -- ISL,EE,Stanford (22th April 1996) + +
Voice email -- Lossless audio compression (18th Feb 1996) + + +
Electro-Optical Technologies, Inc. -- Consultant (12th April 1996) + +
quicktime.apple.com -- Quicktime site (11th Mar 1996) + +
IMAGE etc. -- Commercial image compression software (Fractals/Wavelets) (29th Feb 1996) + +
NCAR CCM Compression and Visualisation -- (18th Feb 1996) +
+
SPIHT -- Wavelet Natural Image Compressor (12th Feb 1996) +
+
Real-Time Lossless Compression Systems -- Loughborough University +
+
Web site for Multirate Signal Processing -- University of Wisconsin, Madison +
+
Info-ZIP -- free, +portable Zip and UnZip utilities +
+
CEDIS -- NASA, Maryland, Image/data compression +
+
CIC-3 Image Compression -- FBI Fingerprints +
+
Signal Compression Lab at UCSB +
+
University of +Washington compression lab -- VQ, Wavelets, Shlomo +
+ + + +

+

+Snippets +
Signal Processing +and the International Information Infrastructure -- Web sites (22th April 1996) +
Increasing Web bandwith -- comparing GIF, JPEG, Fractal compression +
+
Fractal Links on Yahoo +
+
Digital Speech Compression GSM 06.10 RPE-LTP -- DDJ +
+
CREW -- Continuous tone loss(y/less) wavelet compression +
+
CALIC -- Context-based adaptive lossless image compressor +
+
Berkeley MPEG -- MPEG tools +
+
MPEG Pointers and Resources +
+ + + + + + +

+

+Wavelets +
+ + EPIC (Efficient Pyramid Image Coder) -- by Eero Simoncelli +
+
+Tucker, Michael -- FASTWAVE, audio/image compression +
+
+HARC -- Lossy Wavelet Compression technology +
+
+UC Berkeley Wavelet Group +
+
+Khoros Wavetlet and Compression Toolbox +
+
+The Wavelet Digest +
+
+Rice DSP Publications Archive -- Wavelets, Time Frequency/Scale +
+ + +

+

+Fractals +
+Fractal Image Compression -- Software, Pointers, Conferences +
+
+Fractal Design Corporation +
+
+New Fractal Image Compression program +
+ + +

+

+Companies +
IBM Hardware -- Compression chips (11th Mar 1996) + +
Summus Wavelet Technology -- Wavelet image and video compressors (11th Mar 1996) +
Fractal Image Compression -- Mitsubishi (18th Feb 1996) + +
Terran Interactive -- Video compression for the Mac (1st Feb 1996) +
+ +
DV Mpeg -- Windows drivers (18th Feb 1996) +
+ +
Crawford Compression Services -- MPEG post-production (18th Feb 1996) +
+ +
Intelligent Compression Technologies (18th Feb 1996) +
+ +
Pegasus Imaging -- Compression software/dev. kits (12th Feb 1996) +
+
Aladdin Systems -- StuffIt compression products +
+
Stac Electronics +
+
DCP Research -- Hardware solutions +
+
Aware Inc. -- Specialised compression company +
+
IVS - INRIA Videoconferencing System +
+
Telvox Teleinformatica -- Multiplatform Data Compressor +
+
Compression Technologies, +Inc -- Canada +
+
Optivision -- MPEG +
+
PKWARE -- Makers of PKZIP +
+
Multimedia Imaging Services +
+ + +

+

+Audio compression +
Fraunhofer Institut fr Integrierte Schaltungen +
+
Shorten +
+
digital speech compression +
+
Audio compression references +
+
SpeakFreely - compression +
+
SpeakFreely - Contents +
diff --git a/chromium/third_party/snappy/src/testdata/fields.c b/chromium/third_party/snappy/src/testdata/fields.c new file mode 100644 index 00000000000..63cdc030a1f --- /dev/null +++ b/chromium/third_party/snappy/src/testdata/fields.c @@ -0,0 +1,431 @@ +#ifndef lint +static char Rcs_Id[] = + "$Id: fields.c,v 1.7 1994/01/06 05:26:37 geoff Exp $"; +#endif + +/* + * $Log: fields.c,v $ + * Revision 1.7 1994/01/06 05:26:37 geoff + * Get rid of all references to System V string routines, for portability + * (sigh). + * + * Revision 1.6 1994/01/05 20:13:43 geoff + * Add the maxf parameter + * + * Revision 1.5 1994/01/04 02:40:21 geoff + * Make the increments settable (field_line_inc and field_field_inc). + * Add support for the FLD_NOSHRINK flag. + * + * Revision 1.4 1993/09/27 17:48:02 geoff + * Fix some lint complaints and some parenthesization errors. + * + * Revision 1.3 1993/09/09 01:11:11 geoff + * Add a return value to fieldwrite. Add support for backquotes and for + * unstripped backslashes. + * + * Revision 1.2 1993/08/26 00:02:50 geoff + * Fix a stupid null-pointer bug + * + * Revision 1.1 1993/08/25 21:32:05 geoff + * Initial revision + * + */ + +#include +#include "config.h" +#include "fields.h" + +field_t * fieldread P ((FILE * file, char * delims, + int flags, int maxf)); + /* Read a line with fields from a file */ +field_t * fieldmake P ((char * line, int allocated, char * delims, + int flags, int maxf)); + /* Make a field structure from a line */ +static field_t * fieldparse P ((field_t * fieldp, char * line, char * delims, + int flags, int maxf)); + /* Parse the fields in a line */ +static int fieldbackch P ((char * str, char ** out, int strip)); + /* Process backslash sequences */ +int fieldwrite P ((FILE * file, field_t * fieldp, int delim)); + /* Write a line with fields to a file */ +void fieldfree P ((field_t * fieldp)); + /* Free a field returned by fieldread */ + +unsigned int field_field_inc = 20; /* Increment to increase # fields by */ +unsigned int field_line_inc = 512; /* Incr to increase line length by */ + +#ifndef USG +#define strchr index +#endif /* USG */ + +extern void free (); +extern char * malloc (); +extern char * realloc (); +extern char * strchr (); +extern int strlen (); + +/* + * Read one line of the given file into a buffer, break it up into + * fields, and return them to the caller. The field_t structure + * returned must eventually be freed with fieldfree. + */ +field_t * fieldread (file, delims, flags, maxf) + FILE * file; /* File to read lines from */ + char * delims; /* Characters to use for field delimiters */ + int flags; /* Option flags; see fields.h */ + int maxf; /* Maximum number of fields to parse */ + { + register char * linebuf; /* Buffer to hold the line read in */ + int linemax; /* Maximum line buffer size */ + int linesize; /* Current line buffer size */ + + linebuf = (char *) malloc (field_line_inc); + if (linebuf == NULL) + return NULL; + linemax = field_line_inc; + linesize = 0; + /* + * Read in the line. + */ + while (fgets (&linebuf[linesize], linemax - linesize, file) + != NULL) + { + linesize += strlen (&linebuf[linesize]); + if (linebuf[linesize - 1] == '\n') + break; + else + { + linemax += field_line_inc; + linebuf = (char *) realloc (linebuf, linemax); + if (linebuf == NULL) + return NULL; + } + } + if (linesize == 0) + { + free (linebuf); + return NULL; + } + return fieldmake (linebuf, 1, delims, flags, maxf); + } + +field_t * fieldmake (line, allocated, delims, flags, maxf) + char * line; /* Line to make into a field structure */ + int allocated; /* NZ if line allocated with malloc */ + char * delims; /* Characters to use for field delimiters */ + int flags; /* Option flags; see fields.h */ + int maxf; /* Maximum number of fields to parse */ + { + register field_t * fieldp; /* Structure describing the fields */ + int linesize; /* Current line buffer size */ + + fieldp = (field_t *) malloc (sizeof (field_t)); + if (fieldp == NULL) + return NULL; + fieldp->nfields = 0; + fieldp->linebuf = allocated ? line : NULL; + fieldp->fields = NULL; + fieldp->hadnl = 0; + linesize = strlen (line); + if (line[linesize - 1] == '\n') + { + line[--linesize] = '\0'; + fieldp->hadnl = 1; + } + /* + * Shrink the line buffer if necessary. + */ + if (allocated && (flags & FLD_NOSHRINK) == 0) + { + line = fieldp->linebuf = + (char *) realloc (fieldp->linebuf, linesize + 1); + if (fieldp->linebuf == NULL) + { + fieldfree (fieldp); + return NULL; + } + } + return fieldparse (fieldp, line, delims, flags, maxf); + } + +static field_t * fieldparse (fieldp, line, delims, flags, maxf) + register field_t * fieldp; /* Field structure to parse into */ + register char * line; /* Line to be parsed */ + char * delims; /* Characters to use for field delimiters */ + int flags; /* Option flags; see fields.h */ + int maxf; /* Maximum number of fields to parse */ + { + int fieldmax; /* Max size of fields array */ + char * lineout; /* Where to store xlated char in line */ + char quote; /* Quote character in use */ + + fieldp->nfields = 0; + fieldmax = + (maxf != 0 && maxf < field_field_inc) ? maxf + 2 : field_field_inc; + fieldp->fields = (char **) malloc (fieldmax * sizeof (char *)); + if (fieldp->fields == NULL) + { + fieldfree (fieldp); + return NULL; + } + if ((flags + & (FLD_SHQUOTES | FLD_SNGLQUOTES | FLD_BACKQUOTES | FLD_DBLQUOTES)) + == FLD_SHQUOTES) + flags |= FLD_SNGLQUOTES | FLD_BACKQUOTES | FLD_DBLQUOTES; + while (1) + { + if (flags & FLD_RUNS) + { + while (*line != '\0' && strchr (delims, *line) != NULL) + line++; /* Skip runs of delimiters */ + if (*line == '\0') + break; + } + fieldp->fields[fieldp->nfields] = lineout = line; + /* + * Skip to the next delimiter. At the end of skipping, "line" will + * point to either a delimiter or a null byte. + */ + if (flags + & (FLD_SHQUOTES | FLD_SNGLQUOTES | FLD_BACKQUOTES + | FLD_DBLQUOTES | FLD_BACKSLASH)) + { + while (*line != '\0') + { + if (strchr (delims, *line) != NULL) + break; + else if (((flags & FLD_SNGLQUOTES) && *line == '\'') + || ((flags & FLD_BACKQUOTES) && *line == '`') + || ((flags & FLD_DBLQUOTES) && *line == '"')) + { + if ((flags & FLD_SHQUOTES) == 0 + && line != fieldp->fields[fieldp->nfields]) + quote = '\0'; + else + quote = *line; + } + else + quote = '\0'; + if (quote == '\0') + { + if (*line == '\\' && (flags & FLD_BACKSLASH)) + { + line++; + if (*line == '\0') + break; + line += fieldbackch (line, &lineout, + flags & FLD_STRIPQUOTES); + } + else + *lineout++ = *line++; + } + else + { + /* Process quoted string */ + if ((flags & FLD_STRIPQUOTES) == 0) + *lineout++ = quote; + ++line; + while (*line != '\0') + { + if (*line == quote) + { + if ((flags & FLD_STRIPQUOTES) == 0) + *lineout++ = quote; + line++; /* Go on past quote */ + if ((flags & FLD_SHQUOTES) == 0) + { + while (*line != '\0' + && strchr (delims, *line) == NULL) + line++; /* Skip to delimiter */ + } + break; + } + else if (*line == '\\') + { + if (flags & FLD_BACKSLASH) + { + line++; + if (*line == '\0') + break; + else + line += fieldbackch (line, &lineout, + flags & FLD_STRIPQUOTES); + } + else + { + *lineout++ = '\\'; + if (*++line == '\0') + break; + *lineout++ = *line; + } + } + else + *lineout++ = *line++; + } + } + } + } + else + { + while (*line != '\0' && strchr (delims, *line) == NULL) + line++; /* Skip to delimiter */ + lineout = line; + } + fieldp->nfields++; + if (*line++ == '\0') + break; + if (maxf != 0 && fieldp->nfields > maxf) + break; + *lineout = '\0'; + if (fieldp->nfields >= fieldmax) + { + fieldmax += field_field_inc; + fieldp->fields = + (char **) realloc (fieldp->fields, fieldmax * sizeof (char *)); + if (fieldp->fields == NULL) + { + fieldfree (fieldp); + return NULL; + } + } + } + /* + * Shrink the field pointers and return the field structure. + */ + if ((flags & FLD_NOSHRINK) == 0 && fieldp->nfields >= fieldmax) + { + fieldp->fields = (char **) realloc (fieldp->fields, + (fieldp->nfields + 1) * sizeof (char *)); + if (fieldp->fields == NULL) + { + fieldfree (fieldp); + return NULL; + } + } + fieldp->fields[fieldp->nfields] = NULL; + return fieldp; + } + +static int fieldbackch (str, out, strip) + register char * str; /* First char of backslash sequence */ + register char ** out; /* Where to store result */ + int strip; /* NZ to convert the sequence */ + { + register int ch; /* Character being developed */ + char * origstr; /* Original value of str */ + + if (!strip) + { + *(*out)++ = '\\'; + if (*str != 'x' && *str != 'X' && (*str < '0' || *str > '7')) + { + *(*out)++ = *str; + return *str != '\0'; + } + } + switch (*str) + { + case '\0': + *(*out)++ = '\0'; + return 0; + case 'a': + *(*out)++ = '\007'; + return 1; + case 'b': + *(*out)++ = '\b'; + return 1; + case 'f': + *(*out)++ = '\f'; + return 1; + case 'n': + *(*out)++ = '\n'; + return 1; + case 'r': + *(*out)++ = '\r'; + return 1; + case 'v': + *(*out)++ = '\v'; + return 1; + case 'X': + case 'x': + /* Hexadecimal sequence */ + origstr = str++; + ch = 0; + if (*str >= '0' && *str <= '9') + ch = *str++ - '0'; + else if (*str >= 'a' && *str <= 'f') + ch = *str++ - 'a' + 0xa; + else if (*str >= 'A' && *str <= 'F') + ch = *str++ - 'A' + 0xa; + if (*str >= '0' && *str <= '9') + ch = (ch << 4) | (*str++ - '0'); + else if (*str >= 'a' && *str <= 'f') + ch = (ch << 4) | (*str++ - 'a' + 0xa); + else if (*str >= 'A' && *str <= 'F') + ch = (ch << 4) | (*str++ - 'A' + 0xa); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + /* Octal sequence */ + origstr = str; + ch = *str++ - '0'; + if (*str >= '0' && *str <= '7') + ch = (ch << 3) | (*str++ - '0'); + if (*str >= '0' && *str <= '7') + ch = (ch << 3) | (*str++ - '0'); + break; + default: + *(*out)++ = *str; + return 1; + } + if (strip) + { + *(*out)++ = ch; + return str - origstr; + } + else + { + for (ch = 0; origstr < str; ch++) + *(*out)++ = *origstr++; + return ch; + } + } + +int fieldwrite (file, fieldp, delim) + FILE * file; /* File to write to */ + register field_t * fieldp; /* Field structure to write */ + int delim; /* Delimiter to place between fields */ + { + int error; /* NZ if an error occurs */ + register int fieldno; /* Number of field being written */ + + error = 0; + for (fieldno = 0; fieldno < fieldp->nfields; fieldno++) + { + if (fieldno != 0) + error |= putc (delim, file) == EOF; + error |= fputs (fieldp->fields[fieldno], file) == EOF; + } + if (fieldp->hadnl) + error |= putc ('\n', file) == EOF; + return error; + } + +void fieldfree (fieldp) + register field_t * fieldp; /* Field structure to free */ + { + + if (fieldp == NULL) + return; + if (fieldp->linebuf != NULL) + free ((char *) fieldp->linebuf); + if (fieldp->fields != NULL) + free ((char *) fieldp->fields); + free ((char *) fieldp); + } diff --git a/chromium/third_party/snappy/src/testdata/geo.protodata b/chromium/third_party/snappy/src/testdata/geo.protodata new file mode 100644 index 00000000000..c4e3e0d8aeb Binary files /dev/null and b/chromium/third_party/snappy/src/testdata/geo.protodata differ diff --git a/chromium/third_party/snappy/src/testdata/grammar.lsp b/chromium/third_party/snappy/src/testdata/grammar.lsp new file mode 100644 index 00000000000..c60a993889a --- /dev/null +++ b/chromium/third_party/snappy/src/testdata/grammar.lsp @@ -0,0 +1,94 @@ +;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- + +(define-language + :grammar + '(((S $any) -> (S1 $any)) + ((S (Compound $s1 $s2)) -> (S1 $s1) (Conjunction) (S1 $s2)) + + ((S1 (Statement $v)) -> (NP $subj) (VP $subj $tense $v)) + ((S1 (Acknowledge $a)) -> (Acknowledge $a)) + ((S1 (Command $v)) -> (VP Self present $v)) + ((S1 (Question $v)) -> (Aux $tense) (NP $subj) (VP $subj $tense $v)) + ((S1 (Question $v)) -> (Be $tense) (NP $subj) (Be-Arg $subj $tense $v)) + + ((Be-Arg $subj $tense (Occur $tense (loc $subj $loc))) -> + (Loc-Adjunct $tense (loc $subj $loc))) + + ((VP $subj $tense (Occur $tense $v)) -> (VP1 $subj $tense $v)) + ((VP $subj $tense (Occur $tense $v)) -> (Aux $tense)(VP1 $subj present $v)) + + ((VP1 $subj $tense $v) -> (VP2 $subj $tense $v) (Adjunct? $v)) + + ((VP2 $subj $tense ($rel $subj $loc)) -> + (Verb/in $rel $tense)) + ((VP2 $subj $tense ($rel $subj $loc $obj)) -> + (Verb/tr $rel $tense) (NP $obj)) + ((VP2 $subj $tense ($rel $subj $loc $obj $obj2)) -> + (Verb/di $rel $tense) (NP $obj) (NP $obj2)) + ((VP2 $subj $tense (loc $subj $loc)) -> + (Be $tense) (Loc-Adjunct $tense (loc $subj $loc))) + + ((NP $n) -> (Pronoun $n)) + ((NP $n) -> (Article) (Noun $n)) + ((NP $n) -> (Noun $n)) + ((NP ($x $y)) -> (Number $x) (Number $y)) + + ((PP ($prep $n)) -> (Prep $prep) (NP $n)) + ((Adjunct? $v) ->) + ((Adjunct? $v) -> (Loc-Adjunct $tense $v)) + #+Allegro ((Loc-Adjunct $tense ($rel $subj $loc @rest)) -> (PP $loc)) + #+Allegro ((Loc-Adjunct $tense ($rel $subj $loc @rest)) -> (Adjunct $loc)) + #+Lucid ((Loc-Adjunct $tense ($rel $subj $loc . $rest)) -> (PP $loc)) + #+Lucid ((Loc-Adjunct $tense ($rel $subj $loc . $rest)) -> (Adjunct $loc)) + + ) + :lexicon + '( + ((Acknowledge $a) -> (yes true) (no false) (maybe unknown) (huh unparsed)) + ((Adjunct $loc) -> here there (nearby near) near left right up down) + ((Article) -> a an the) + ((Aux $tense) -> (will future) (did past) (do $finite)) + ((Be $tense) -> (am present) (are present) (is present) (be $finite) + (was past) (were past)) + ((Conjunction) -> and --) + ((Noun $n) -> gold Wumpus pit breeze stench glitter nothing) + ((Number $n) -> 0 1 2 3 4 5 6 7 8 9) + ((Prep $prep) -> in at to near) + ((Pronoun $n) -> (you self) (me master) (I master)) + + ((Verb/in $rel $tense) -> (go move $finite) (went move past) + (move move $finite) (move move past) (shoot shoot $finite)) + ((Verb/tr $rel $tense) -> (move carry $finite) (moved carry past) + (carry carry $finite) (carry carried past) + (grab grab $finite) (grab grabbed past) (get grab $finite) + (got grab past) (release release $finite) (release release past) + (drop release $finite) (dropped release past) (shoot shoot-at $finite) + (shot shoot-at past) (kill shoot-at $finite) (killed shoot-at past) + (smell perceive $finite) (feel perceive $finite) (felt perceive past)) + ((Verb/di $rel $tense) -> (bring bring $finite) (brought bring past) + (get bring $finite) (got bring past)) + )) + +(defparameter *sentences* + '((I will shoot the wumpus at 4 4) + (yes) + (You went right -- I will go left) + (carry the gold) + (yes and no) + (did you bring me the gold) + (a breeze is here -- I am near 5 3) + (a stench is in 3 5) + (a pit is nearby) + (is the wumpus near) + (Did you go to 3 8) + (Yes -- Nothing is there) + (Shoot -- Shoot left) + (Kill the wumpus -- shoot up))) + +(defun ss (&optional (sentences *sentences*)) + "Run some test sentences, and count how many were not parsed." + (count-if-not + #'(lambda (s) + (format t "~2&>>> ~(~{~a ~}~)~%" s) + (write (second (parse s)) :pretty t)) + *sentences*)) diff --git a/chromium/third_party/snappy/src/testdata/house.jpg b/chromium/third_party/snappy/src/testdata/house.jpg new file mode 100644 index 00000000000..6b3aae8cdea Binary files /dev/null and b/chromium/third_party/snappy/src/testdata/house.jpg differ diff --git a/chromium/third_party/snappy/src/testdata/html b/chromium/third_party/snappy/src/testdata/html new file mode 100644 index 00000000000..ef768ccde9f --- /dev/null +++ b/chromium/third_party/snappy/src/testdata/html @@ -0,0 +1 @@ + content: @ 1099872000000000: 'HTTP/1.1 200 OK\r\nX-Google-Crawl-Date: Mon, 08 Nov 2004 17:22:09 GMT\r\nContent-Type: text/html\r\nConnection: close\r\nX-Powered-By: PHP/4.3.8\r\nServer: Apache/1.3.31 (Unix) mod_gzip/1.3.19.1a PHP/4.3.8\r\nDate: Mon, 08 Nov 2004 17:19:07 GMT\r\n\r\n \r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n +#endif + +#if 1 +#include +#endif + +#define SNAPPY_MAJOR 1 +#define SNAPPY_MINOR 0 +#define SNAPPY_PATCHLEVEL 5 +#define SNAPPY_VERSION \ + ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) + +#include + +namespace snappy { + +#if 0 +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#else +typedef signed char int8; +typedef unsigned char uint8; +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned int uint32; +typedef long long int64; +typedef unsigned long long uint64; +#endif + +typedef std::string string; + +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) + +} // namespace snappy + +#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ -- cgit v1.2.1