Blame libdjvu/ByteStream.h

Packit df99a1
//C-  -*- C++ -*-
Packit df99a1
//C- -------------------------------------------------------------------
Packit df99a1
//C- DjVuLibre-3.5
Packit df99a1
//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
Packit df99a1
//C- Copyright (c) 2001  AT&T
Packit df99a1
//C-
Packit df99a1
//C- This software is subject to, and may be distributed under, the
Packit df99a1
//C- GNU General Public License, either Version 2 of the license,
Packit df99a1
//C- or (at your option) any later version. The license should have
Packit df99a1
//C- accompanied the software or you may obtain a copy of the license
Packit df99a1
//C- from the Free Software Foundation at http://www.fsf.org .
Packit df99a1
//C-
Packit df99a1
//C- This program is distributed in the hope that it will be useful,
Packit df99a1
//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit df99a1
//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit df99a1
//C- GNU General Public License for more details.
Packit df99a1
//C- 
Packit df99a1
//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
Packit df99a1
//C- Lizardtech Software.  Lizardtech Software has authorized us to
Packit df99a1
//C- replace the original DjVu(r) Reference Library notice by the following
Packit df99a1
//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
Packit df99a1
//C-
Packit df99a1
//C-  ------------------------------------------------------------------
Packit df99a1
//C- | DjVu (r) Reference Library (v. 3.5)
Packit df99a1
//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
Packit df99a1
//C- | The DjVu Reference Library is protected by U.S. Pat. No.
Packit df99a1
//C- | 6,058,214 and patents pending.
Packit df99a1
//C- |
Packit df99a1
//C- | This software is subject to, and may be distributed under, the
Packit df99a1
//C- | GNU General Public License, either Version 2 of the license,
Packit df99a1
//C- | or (at your option) any later version. The license should have
Packit df99a1
//C- | accompanied the software or you may obtain a copy of the license
Packit df99a1
//C- | from the Free Software Foundation at http://www.fsf.org .
Packit df99a1
//C- |
Packit df99a1
//C- | The computer code originally released by LizardTech under this
Packit df99a1
//C- | license and unmodified by other parties is deemed "the LIZARDTECH
Packit df99a1
//C- | ORIGINAL CODE."  Subject to any third party intellectual property
Packit df99a1
//C- | claims, LizardTech grants recipient a worldwide, royalty-free, 
Packit df99a1
//C- | non-exclusive license to make, use, sell, or otherwise dispose of 
Packit df99a1
//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the 
Packit df99a1
//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU 
Packit df99a1
//C- | General Public License.   This grant only confers the right to 
Packit df99a1
//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to 
Packit df99a1
//C- | the extent such infringement is reasonably necessary to enable 
Packit df99a1
//C- | recipient to make, have made, practice, sell, or otherwise dispose 
Packit df99a1
//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to 
Packit df99a1
//C- | any greater extent that may be necessary to utilize further 
Packit df99a1
//C- | modifications or combinations.
Packit df99a1
//C- |
Packit df99a1
//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
Packit df99a1
//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
Packit df99a1
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
Packit df99a1
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Packit df99a1
//C- +------------------------------------------------------------------
Packit df99a1
Packit df99a1
#ifndef _BYTESTREAM_H
Packit df99a1
#define _BYTESTREAM_H
Packit df99a1
#ifdef HAVE_CONFIG_H
Packit df99a1
#include "config.h"
Packit df99a1
#endif
Packit df99a1
#if NEED_GNUG_PRAGMAS
Packit df99a1
# pragma interface
Packit df99a1
#endif
Packit df99a1
Packit df99a1
/** @name ByteStream.h
Packit df99a1
    
Packit df99a1
    Files #"ByteStream.h"# and #"ByteStream.cpp"# define input/output classes
Packit df99a1
    similar in spirit to the well known C++ #iostream# classes.  Class
Packit df99a1
    \Ref{ByteStream} is an abstract base class for all byte streams.  It
Packit df99a1
    defines a virtual interface and also provides useful functions.  These
Packit df99a1
    files provide two subclasses. Class \Ref{ByteStream::Stdio} provides a
Packit df99a1
    simple interface to the Ansi C buffered input/output functions. Class
Packit df99a1
    \Ref{ByteStream::Memory} provides stream-like access to a dynamical array
Packit df99a1
    maintained in memory. Class \Ref{ByteStream::Static} provides read-only
Packit df99a1
    stream-like access to a user allocated data buffer.
Packit df99a1
Packit df99a1
    {\bf Notes} --- These classes were partly written because we did not want to
Packit df99a1
    depend on the standard C++ library.  The main reason however is related to
Packit df99a1
    the browser interface. We want to have a tight control over the
Packit df99a1
    implementation of subclasses because we want to use a byte stream to
Packit df99a1
    represent data passed by a web browser to a plugin.  This operation
Packit df99a1
    involves multi-threading issues that many implementations of the standard
Packit df99a1
    C++ library would squarely ignore.
Packit df99a1
Packit df99a1
    @memo 
Packit df99a1
    Input/output classes
Packit df99a1
    @author
Packit df99a1
    L\'eon Bottou <leonb@research.att.com> -- initial implementation\\
Packit df99a1
    Andrei Erofeev <eaf@geocities.com> -- 
Packit df99a1
Packit df99a1
// From: Leon Bottou, 1/31/2002
Packit df99a1
// This file has very little to do with my initial implementation.
Packit df99a1
// It has been practically rewritten by Lizardtech for i18n changes.
Packit df99a1
// Our original implementation consisted of multiple classes.
Packit df99a1
// <http://prdownloads.sourceforge.net/djvu/DjVu2_2b-src.tgz>.
Packit df99a1
Packit df99a1
*/
Packit df99a1
//@{
Packit df99a1
Packit df99a1
Packit df99a1
#include "Arrays.h"
Packit df99a1
#include <stdio.h>
Packit df99a1
Packit df99a1
#ifdef HAVE_NAMESPACES
Packit df99a1
namespace DJVU {
Packit df99a1
# ifdef NOT_DEFINED // Just to fool emacs c++ mode
Packit df99a1
}
Packit df99a1
#endif
Packit df99a1
#endif
Packit df99a1
Packit df99a1
class GURL;
Packit df99a1
class GUTF8String;
Packit df99a1
class GNativeString;
Packit df99a1
Packit df99a1
/** Abstract class for a stream of bytes.  Class #ByteStream# represent an
Packit df99a1
    object from which (resp. to which) bytes can be read (resp. written) as
Packit df99a1
    with a regular file.  Virtual functions #read# and #write# must implement
Packit df99a1
    these two basic operations.  In addition, function #tell# returns an
Packit df99a1
    offset identifying the current position, and function #seek# may be used
Packit df99a1
    to change the current position.
Packit df99a1
Packit df99a1
    {\bf Note}. Both the copy constructor and the copy operator are declared
Packit df99a1
    as private members. It is therefore not possible to make multiple copies
Packit df99a1
    of instances of this class, as implied by the class semantic.  
Packit df99a1
*/
Packit df99a1
class DJVUAPI ByteStream : public GPEnabled
Packit df99a1
{
Packit df99a1
public:
Packit df99a1
  class Stdio;
Packit df99a1
  class Static;
Packit df99a1
  class Memory;
Packit df99a1
  class Wrapper;
Packit df99a1
  enum codepage_type {RAW,AUTO,NATIVE,UTF8} cp;
Packit df99a1
Packit df99a1
  /** @name Virtual Functions.
Packit df99a1
      These functions are usually implemented by each subclass of #ByteStream#.
Packit df99a1
  */
Packit df99a1
  //@{
Packit df99a1
public:
Packit df99a1
  /** Virtual destructor. */
Packit df99a1
  virtual ~ByteStream();
Packit df99a1
  /** Reads data from a ByteStream.  This function {\em must} be implemented
Packit df99a1
      by each subclass of #ByteStream#.  At most #size# bytes are read from
Packit df99a1
      the ByteStream and stored in the memory area pointed to by #buffer#.
Packit df99a1
      Function #read# returns immediately if #size# is zero. The actual number
Packit df99a1
      of bytes read is returned.  Function #read# returns a number of bytes
Packit df99a1
      smaller than #size# if the end-of-file mark is reached before filling
Packit df99a1
      the buffer. Subsequent invocations will always return value #0#.
Packit df99a1
      Function #read# may also return a value greater than zero but smaller
Packit df99a1
      than #size# for internal reasons. Programs must be ready to handle these
Packit df99a1
      cases or use function \Ref{readall}. Exception \Ref{GException} is
Packit df99a1
      thrown with a plain text error message whenever an error occurs. */
Packit df99a1
  virtual size_t read(void *buffer, size_t size);
Packit df99a1
  /** Writes data to a ByteStream.  This function {\em must} be implemented by
Packit df99a1
      each subclass of #ByteStream#.  At most #size# bytes from buffer
Packit df99a1
      #buffer# are written to the ByteStream.  Function #write# returns
Packit df99a1
      immediately if #size# is zero.  The actual number of bytes written is
Packit df99a1
      returned. Function #write# may also return a value greater than zero but
Packit df99a1
      smaller than #size# for internal reasons. Programs must be ready to
Packit df99a1
      handle these cases or use function \Ref{writall}. Exception
Packit df99a1
      \Ref{GException} is thrown with a plain text error message whenever an
Packit df99a1
      error occurs. */
Packit df99a1
  virtual size_t write(const void *buffer, size_t size);
Packit df99a1
  /** Returns the offset of the current position in the ByteStream.  This
Packit df99a1
      function {\em must} be implemented by each subclass of #ByteStream#. */
Packit df99a1
  virtual long tell(void) const  = 0;
Packit df99a1
  /** Sets the current position for reading or writing the ByteStream.  Class
Packit df99a1
      #ByteStream# provides a default implementation able to seek forward by
Packit df99a1
      calling function #read# until reaching the desired position.  Subclasses
Packit df99a1
      implementing better seek capabilities must override this default
Packit df99a1
      implementation.  The new current position is computed by applying
Packit df99a1
      displacement #offset# to the position represented by argument
Packit df99a1
      #whence#. The following values are recognized for argument #whence#:
Packit df99a1
      \begin{description}
Packit df99a1
      \item[#SEEK_SET#] Argument #offset# indicates the position relative to
Packit df99a1
      the beginning of the ByteStream.
Packit df99a1
      \item[#SEEK_CUR#] Argument #offset# is a signed displacement relative to
Packit df99a1
      the current position.
Packit df99a1
      \item[#SEEK_END#] Argument #offset# is a displacement relative to the end
Packit df99a1
      of the file. It is then advisable to provide a negative value for #offset#.
Packit df99a1
      \end{description}
Packit df99a1
      Results are undefined whenever the new position is greater than the
Packit df99a1
      total size of the ByteStream.
Packit df99a1
Packit df99a1
      {\bf Error reporting}:
Packit df99a1
      If #seek()# succeeds, #0# is returned. Otherwise it either returns
Packit df99a1
      #-1# (if #nothrow# is set to #FALSE#) or throws the \Ref{GException}
Packit df99a1
      exception. */
Packit df99a1
  virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false);
Packit df99a1
  /** Flushes all buffers in the ByteStream.  Calling this function
Packit df99a1
      guarantees that pending data have been actually written (i.e. passed to
Packit df99a1
      the operating system). Class #ByteStream# provides a default
Packit df99a1
      implementation which does nothing. */
Packit df99a1
  virtual void flush(void);
Packit df99a1
  //@}
Packit df99a1
  /** @name Utility Functions.  
Packit df99a1
      Class #ByteStream# implements these functions using the virtual
Packit df99a1
      interface functions only.  All subclasses of #ByteStream# inherit these
Packit df99a1
      functions. */
Packit df99a1
  //@{
Packit df99a1
public:
Packit df99a1
  /** Reads data and blocks until everything has been read.  This function is
Packit df99a1
      essentially similar to function #read#.  Unlike function #read# however,
Packit df99a1
      function #readall# will never return a value smaller than #size# unless
Packit df99a1
      an end-of-file mark is reached.  This is implemented by repeatedly
Packit df99a1
      calling function #read# until everything is read or until we reach an
Packit df99a1
      end-of-file mark.  Note that #read# and #readall# are equivalent when
Packit df99a1
      #size# is one. */
Packit df99a1
  size_t readall(void *buffer, size_t size);
Packit df99a1
  /** Writes data and blocks until everything has been written.  This function
Packit df99a1
      is essentially similar to function #write#.  Unlike function #write#
Packit df99a1
      however, function #writall# will only return after all #size# bytes have
Packit df99a1
      been written.  This is implemented by repeatedly calling function
Packit df99a1
      #write# until everything is written.  Note that #write# and #writall#
Packit df99a1
      are equivalent when #size# is one. */
Packit df99a1
  size_t writall(const void *buffer, size_t size);
Packit df99a1
  /** Copy data from another ByteStream.  A maximum of #size# bytes are read
Packit df99a1
      from the ByteStream #bsfrom# and are written to the ByteStream #*this#
Packit df99a1
      at the current position.  Less than #size# bytes may be written if an
Packit df99a1
      end-of-file mark is reached on #bsfrom#.  This function returns the
Packit df99a1
      total number of bytes copied.  Setting argument #size# to zero (the
Packit df99a1
      default value) has a special meaning: the copying process will continue
Packit df99a1
      until reaching the end-of-file mark on ByteStream #bsfrom#, regardless
Packit df99a1
      of the number of bytes transferred.  */
Packit df99a1
  size_t copy(ByteStream &bsfrom, size_t size=0);
Packit df99a1
  /// Allows printf() type operations to a bytestream.
Packit df99a1
  size_t format(const char *fmt, ... );
Packit df99a1
  /// Allows scanf() type operations on a bytestream.
Packit df99a1
  int scanf(const char *fmt, ... );
Packit df99a1
  /** Writes the string as is, to the specified stream. */
Packit df99a1
  size_t writestring(const GUTF8String &s);
Packit df99a1
  /** Writes the string as is, to the specified stream. */
Packit df99a1
  size_t writestring(const GNativeString &s);
Packit df99a1
  /** Formats the message string, looks up the external representation
Packit df99a1
      and writes it to the specified stream. */
Packit df99a1
  void formatmessage( const char *fmt, ... );
Packit df99a1
  /** Looks up the message and writes it to the specified stream. */
Packit df99a1
  void writemessage( const char *message );
Packit df99a1
  /** Writes a one-byte integer to a ByteStream. */
Packit df99a1
  void write8 (unsigned int card8);
Packit df99a1
  /** Writes a two-bytes integer to a ByteStream.
Packit df99a1
      The integer most significant byte is written first,
Packit df99a1
      regardless of the processor endianness. */
Packit df99a1
  void write16(unsigned int card16);
Packit df99a1
  /** Writes a three-bytes integer to a ByteStream.
Packit df99a1
      The integer most significant byte is written first,
Packit df99a1
      regardless of the processor endianness. */
Packit df99a1
  void write24(unsigned int card24);
Packit df99a1
  /** Writes a four-bytes integer to a ByteStream. 
Packit df99a1
      The integer most significant bytes are written first,
Packit df99a1
      regardless of the processor endianness. */
Packit df99a1
  void write32(unsigned int card32);
Packit df99a1
  /** Reads a one-byte integer from a ByteStream. */
Packit df99a1
  unsigned int read8 ();
Packit df99a1
  /** Reads a two-bytes integer from a ByteStream.
Packit df99a1
      The integer most significant byte is read first,
Packit df99a1
      regardless of the processor endianness. */
Packit df99a1
  unsigned int read16();
Packit df99a1
  /** Reads a three-bytes integer from a ByteStream.
Packit df99a1
      The integer most significant byte is read first,
Packit df99a1
      regardless of the processor endianness. */
Packit df99a1
  unsigned int read24();
Packit df99a1
  /** Reads a four-bytes integer from a ByteStream.
Packit df99a1
      The integer most significant bytes are read first,
Packit df99a1
      regardless of the processor endianness. */
Packit df99a1
  unsigned int read32();
Packit df99a1
  /** Returns the total number of bytes contained in the buffer, file, etc.
Packit df99a1
      Valid offsets for function #seek# range from 0 to the value returned
Packit df99a1
      by this function. */
Packit df99a1
  virtual int size(void) const;
Packit df99a1
  /// Use at your own risk, only guarenteed to work for ByteStream::Memorys.
Packit df99a1
  TArray<char> get_data(void);
Packit df99a1
  /** Reads data from a random position. This function reads at most #sz#
Packit df99a1
      bytes at position #pos# into #buffer# and returns the actual number of
Packit df99a1
      bytes read.  The current position is unchanged. */
Packit df99a1
  virtual size_t readat(void *buffer, size_t sz, int pos);
Packit df99a1
  //@}
Packit df99a1
protected:
Packit df99a1
  ByteStream(void) : cp(AUTO) {};
Packit df99a1
private:
Packit df99a1
  // Cancel C++ default stuff
Packit df99a1
  ByteStream(const ByteStream &);
Packit df99a1
  ByteStream & operator=(const ByteStream &);
Packit df99a1
public:
Packit df99a1
  /** Constructs an empty Memory ByteStream.  The buffer itself is organized
Packit df99a1
      as an array of 4096 byte blocks.  The buffer is initially empty. You
Packit df99a1
      must first use function #write# to store data into the buffer, use
Packit df99a1
      function #seek# to rewind the current position, and function #read# to
Packit df99a1
      read the data back. */
Packit df99a1
  static GP<ByteStream> create(void);
Packit df99a1
  /** Constructs a Memory ByteStream by copying initial data.  The
Packit df99a1
      Memory buffer is initialized with #size# bytes copied from the
Packit df99a1
      memory area pointed to by #buffer#. */
Packit df99a1
  static GP<ByteStream> create(void const * const buffer, const size_t size);
Packit df99a1
  /** Constructs a ByteStream for accessing the file named #url#.
Packit df99a1
      Arguments #url# and #mode# are similar to the arguments of the well
Packit df99a1
      known stdio function #fopen#. In addition a url of #-# will be
Packit df99a1
      interpreted as the standard output or the standard input according to
Packit df99a1
      #mode#.  This constructor will open a stdio file and construct a
Packit df99a1
      ByteStream object accessing this file. Destroying the ByteStream object
Packit df99a1
      will flush and close the associated stdio file.  Exception
Packit df99a1
      \Ref{GException} is thrown with a plain text error message if the stdio
Packit df99a1
      file cannot be opened. */
Packit df99a1
  static GP<ByteStream> create(
Packit df99a1
    const GURL &url, char const * const mode);
Packit df99a1
  /** Same as the above, but uses stdin or stdout */
Packit df99a1
  static GP<ByteStream> create( char const * const mode);
Packit df99a1
Packit df99a1
  /** Constructs a ByteStream for accessing the stdio file #f#.
Packit df99a1
      Argument #mode# indicates the type of the stdio file, as in the
Packit df99a1
      well known stdio function #fopen#.  Destroying the ByteStream
Packit df99a1
      object will not close the stdio file #f# unless closeme is true. */
Packit df99a1
  static GP<ByteStream> create(
Packit df99a1
    const int fd, char const * const mode, const bool closeme);
Packit df99a1
Packit df99a1
  /** Constructs a ByteStream for accessing the stdio file #f#.
Packit df99a1
      Argument #mode# indicates the type of the stdio file, as in the
Packit df99a1
      well known stdio function #fopen#.  Destroying the ByteStream
Packit df99a1
      object will not close the stdio file #f# unless closeme is true. */
Packit df99a1
  static GP<ByteStream> create(
Packit df99a1
    FILE * const f, char const * const mode, const bool closeme);
Packit df99a1
  /** Creates a ByteStream object for allocating the memory area of
Packit df99a1
      length #sz# starting at address #buffer#.  This call impliments 
Packit df99a1
      a read-only ByteStream interface for a memory area specified by
Packit df99a1
      the user at construction time. Calls to function #read# directly
Packit df99a1
      access this memory area.  The user must therefore make sure that its
Packit df99a1
      content remain valid long enough.  */
Packit df99a1
  static GP<ByteStream> create_static(void const *buffer, size_t size);
Packit df99a1
  
Packit df99a1
  /** Easy access to preallocated stdin/stdout/stderr bytestreams */
Packit df99a1
  static GP<ByteStream> get_stdin(char const * mode=0);
Packit df99a1
  static GP<ByteStream> get_stdout(char const * mode=0);  
Packit df99a1
  static GP<ByteStream> get_stderr(char const * mode=0);
Packit df99a1
Packit df99a1
  /** This is the conventional name for EOF exceptions */
Packit df99a1
  static const char *EndOfFile;
Packit df99a1
  /** Returns the contents of the file as a GNativeString */
Packit df99a1
  GNativeString getAsNative(void);
Packit df99a1
  /** Returns the contents of the file as a GUTF8String */
Packit df99a1
  GUTF8String getAsUTF8(void);
Packit df99a1
};
Packit df99a1
Packit df99a1
inline size_t
Packit df99a1
ByteStream::readat(void *buffer, size_t sz, int pos)
Packit df99a1
{
Packit df99a1
  size_t retval;
Packit df99a1
  long tpos=tell();
Packit df99a1
  seek(pos, SEEK_SET, true);
Packit df99a1
  retval=readall(buffer,sz);
Packit df99a1
  seek(tpos, SEEK_SET, true);
Packit df99a1
  return retval;
Packit df99a1
}
Packit df99a1
Packit df99a1
inline int
Packit df99a1
ByteStream::size(void) const
Packit df99a1
{
Packit df99a1
  ByteStream *bs=const_cast<ByteStream *>(this);
Packit df99a1
  int bsize=(-1);
Packit df99a1
  long pos=tell();
Packit df99a1
  if(bs->seek(0,SEEK_END,true))
Packit df99a1
  {
Packit df99a1
    bsize=(int)tell();
Packit df99a1
    (void)(bs->seek(pos,SEEK_SET,false));
Packit df99a1
  }
Packit df99a1
  return bsize;
Packit df99a1
}
Packit df99a1
Packit df99a1
/** ByteStream::Wrapper implements wrapping bytestream.  This is useful
Packit df99a1
    for derived classes that take a GP<ByteStream> as a creation argument,
Packit df99a1
    and the backwards compatible bytestreams.  */
Packit df99a1
class DJVUAPI ByteStream::Wrapper : public ByteStream
Packit df99a1
{
Packit df99a1
protected:
Packit df99a1
  GP<ByteStream> gbs;
Packit df99a1
  ByteStream *bs;
Packit df99a1
  Wrapper(void) : bs(0) {}
Packit df99a1
  Wrapper(const GP<ByteStream> &xbs) : gbs(xbs), bs(xbs) {}
Packit df99a1
public:
Packit df99a1
  ~Wrapper();
Packit df99a1
  ByteStream * operator & () const {return bs;}
Packit df99a1
  ByteStream * operator & () {return bs;}
Packit df99a1
  virtual size_t read(void *buffer, size_t size)
Packit df99a1
    { return bs->read(buffer,size); }
Packit df99a1
  virtual size_t write(const void *buffer, size_t size)
Packit df99a1
    { return bs->write(buffer,size); }
Packit df99a1
  virtual long tell(void) const
Packit df99a1
    { return bs->tell(); }
Packit df99a1
  virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false)
Packit df99a1
    { return bs->seek(offset,whence,nothrow); }
Packit df99a1
  virtual void flush(void)
Packit df99a1
    { bs->flush(); }
Packit df99a1
};
Packit df99a1
Packit df99a1
Packit df99a1
//@}
Packit df99a1
Packit df99a1
// ------------ THE END
Packit df99a1
Packit df99a1
#ifdef HAVE_NAMESPACES
Packit df99a1
}
Packit df99a1
# ifndef NOT_USING_DJVU_NAMESPACE
Packit df99a1
using namespace DJVU;
Packit df99a1
# endif
Packit df99a1
#endif
Packit df99a1
#endif
Packit df99a1