Changeset 206 for trunk/libdjvu


Ignore:
Timestamp:
Jul 25, 2007, 5:59:35 PM (14 years ago)
Author:
Eugene Romanenko
Message:

DJVU plugin: djvulibre updated to version 3.5.19

Location:
trunk/libdjvu
Files:
1 deleted
108 edited

Legend:

Unmodified
Added
Removed
  • trunk/libdjvu/Arrays.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: Arrays.cpp,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: Arrays.cpp,v 1.9 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/Arrays.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: Arrays.h,v 1.11 2005/12/28 07:54:50 leonb Exp $
    55 // $Name: $
     56// $Id: Arrays.h,v 1.12 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _ARRAYS_H_
     
    124126    Andrei Erofeev <eaf@geocities.com> -- Copy-on-demand implementation.
    125127    @version
    126     #$Id: Arrays.h,v 1.11 2005/12/28 07:54:50 leonb Exp $# */
     128    #$Id: Arrays.h,v 1.12 2007/03/25 20:48:29 leonb Exp $# */
    127129//@{
    128130
  • trunk/libdjvu/BSByteStream.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: BSByteStream.cpp,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: BSByteStream.cpp,v 1.9 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/BSByteStream.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: BSByteStream.h,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: BSByteStream.h,v 1.9 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _BSBYTESTREAM_H
     
    143145    Simple Burrows-Wheeler general purpose compressor.
    144146    @version
    145     #$Id: BSByteStream.h,v 1.8 2003/11/07 22:08:20 leonb Exp $# */
     147    #$Id: BSByteStream.h,v 1.9 2007/03/25 20:48:29 leonb Exp $# */
    146148//@{
    147149
  • trunk/libdjvu/BSEncodeByteStream.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: BSEncodeByteStream.cpp,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: BSEncodeByteStream.cpp,v 1.9 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/ByteStream.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: ByteStream.cpp,v 1.20 2005/12/24 12:45:01 leonb Exp $
    55 // $Name: $
     56// $Id: ByteStream.cpp,v 1.23 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759// From: Leon Bottou, 1/31/2002
     
    251253{
    252254public:
    253   class Allocate;
    254   class Duplicate;
    255   friend class Duplicate;
    256255
    257256  /** Creates a Static object for allocating the memory area of
     
    267266      by this function. */
    268267  virtual int size(void) const;
    269   virtual GP<ByteStream> duplicate(const size_t xsize) const;
    270   /// Returns false, unless a subclass of ByteStream::Static
    271   virtual bool is_static(void) const { return true; }
    272268protected:
    273269  const char *data;
     
    279275ByteStream::Static::~Static() {}
    280276
    281 class ByteStream::Static::Allocate : public ByteStream::Static
    282 {
    283 public:
    284   friend class ByteStream;
    285 protected:
    286   char *buf;
    287   GPBuffer<char> gbuf;
    288 public:
    289   Allocate(const size_t size) : Static(0,size), gbuf(buf,size) { data=buf; }
    290   virtual ~Allocate();
    291 };
    292 
    293 ByteStream::Static::Allocate::~Allocate() {}
    294 
    295277inline int
    296278ByteStream::Static::size(void) const
    297279{
    298280  return bsize;
    299 }
    300 
    301 class ByteStream::Static::Duplicate : public ByteStream::Static
    302 {
    303 protected:
    304   GP<ByteStream> gbs;
    305 public:
    306   Duplicate(const ByteStream::Static &bs, const size_t size);
    307 };
    308 
    309 ByteStream::Static::Duplicate::Duplicate(
    310   const ByteStream::Static &bs, const size_t xsize)
    311 : ByteStream::Static(0,0)
    312 {
    313   if(xsize&&(bs.bsize<bs.where))
    314   {
    315     const size_t bssize=(size_t)bs.bsize-(size_t)bs.where;
    316     bsize=(size_t)((xsize>bssize)?bssize:xsize);
    317     gbs=const_cast<ByteStream::Static *>(&bs);
    318     data=bs.data+bs.where;
    319   }
    320 }
    321 
    322 GP<ByteStream>
    323 ByteStream::Static::duplicate(const size_t xsize) const
    324 {
    325   return new ByteStream::Static::Duplicate(*this,xsize);
    326281}
    327282
     
    12021157}
    12031158
    1204 GP<ByteStream>
    1205 ByteStream::duplicate(const size_t xsize) const
    1206 {
    1207   GP<ByteStream> retval;
    1208   const long int pos=tell();
    1209   const int tsize=size();
    1210   ByteStream &self=*(const_cast<ByteStream *>(this));
    1211   if(tsize < 0 || pos < 0 || (unsigned int)tsize < 1+(unsigned int)pos)
    1212   {
    1213     retval=ByteStream::create();
    1214     retval->copy(self,xsize);
    1215     retval->seek(0L);
    1216   }else
    1217   {
    1218     const size_t s=(size_t)tsize-(size_t)pos;
    1219     const int size=(!xsize||(s<xsize))?s:xsize;
    1220     ByteStream::Static::Allocate *bs=new ByteStream::Static::Allocate(size);
    1221     retval=bs;
    1222     self.readall(bs->buf,size);
    1223   }
    1224   self.seek(pos,SEEK_SET,true);
    1225   return retval;
    1226 }
    1227 
    1228 
    12291159#if HAS_MEMMAP
    12301160MemoryMapByteStream::MemoryMapByteStream(void)
     
    12481178{
    12491179  GUTF8String retval;
     1180  data = (char*)(-1);
    12501181#if defined(PROT_READ) && defined(MAP_SHARED)
    12511182  struct stat statbuf;
    1252   if(!fstat(fd,&statbuf))
    1253   {
    1254     if(statbuf.st_size)
     1183  if(!fstat(fd,&statbuf) && statbuf.st_size)
    12551184    {
    12561185      bsize=statbuf.st_size;
    12571186      data=(char *)mmap(0,statbuf.st_size,PROT_READ,MAP_SHARED,fd,0);
    12581187    }
    1259   }else
    1260   {
    1261     if(closeme)
    1262     {
    1263       close(fd);
    1264     }
    1265     retval= ERR_MSG("ByteStream.open_fail2");
    1266   }
    1267 #else
    1268   retval= ERR_MSG("ByteStream.open_fail2");
    1269 #endif
     1188#endif
     1189  if(data == (char *)(-1))
     1190    retval = ERR_MSG("ByteStream.open_fail2");
    12701191  if(closeme)
    1271   {
    12721192    close(fd);
    1273   }
    12741193  return retval;
    12751194}
  • trunk/libdjvu/ByteStream.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: ByteStream.h,v 1.13 2006/01/31 15:28:30 leonb Exp $
    55 // $Name: $
     56// $Id: ByteStream.h,v 1.15 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _BYTESTREAM_H
     
    98100
    99101    @version
    100     #$Id: ByteStream.h,v 1.13 2006/01/31 15:28:30 leonb Exp $# */
     102    #$Id: ByteStream.h,v 1.15 2007/03/25 20:48:29 leonb Exp $# */
    101103//@{
    102104
     
    227229      of the number of bytes transferred.  */
    228230  size_t copy(ByteStream &bsfrom, size_t size=0);
    229   /** Create a new #ByteStream# that copies the data from this #ByteStream#
    230       starting from the current position, upto #size# bytes.  Setting the
    231       #size# to zero means copy to the end-of-file mark. */
    232   GP<ByteStream> duplicate(const size_t size=0) const;
    233231  /// Allows printf() type operations to a bytestream.
    234232  size_t format(const char *fmt, ... );
     
    282280      bytes read.  The current position is unchanged. */
    283281  virtual size_t readat(void *buffer, size_t sz, int pos);
    284   /// Returns false, unless a subclass of ByteStream::Static
    285   virtual bool is_static(void) const { return false; }
    286282  //@}
    287283protected:
  • trunk/libdjvu/DataPool.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DataPool.cpp,v 1.11 2004/08/06 15:11:29 leonb Exp $
    55 // $Name: $
     56// $Id: DataPool.cpp,v 1.14 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    766768  pool->init();
    767769
    768       // It's nice to have IFF data analyzed in this case too.
     770  // It's nice to have IFF data analyzed in this case too.
    769771  pool->add_trigger(0, 32, static_trigger_cb, pool);
    770772
    771   pool->data=gstr->duplicate();
    772   pool->added_data(0,pool->data->size());   
    773 //  char buffer[1024];
    774 //  int length;
    775 //  while((length=str.read(buffer, 1024)))
    776 //     pool->add_data(buffer, length);
     773  char buffer[1024];
     774  int length;
     775  while((length=gstr->read(buffer, 1024)))
     776    pool->add_data(buffer, length);
    777777  pool->set_eof();
     778
    778779  return retval;
    779780}
     
    937938      else if (length<0 || start+length>=file_size)
    938939        length=file_size-start;
    939 
     940     
    940941      eof_flag=true;
    941 
    942       if(str->is_static())
    943       {
    944         data=str;
    945         added_data(0,length);
    946       }else
    947       {
    948         data=0;
    949       }
    950 
     942      data=0;
     943     
    951944      FCPools::get()->add_pool(furl, this);
    952945
     
    11561149             {
    11571150               pool->clear_stream(true);
    1158                if ((exc.get_cause() != GUTF8String( ERR_MSG("DataPool.reenter") ) ) || level)
     1151               if ((exc.get_cause() != GUTF8String( ERR_MSG("DataPool.reenter") ) )
     1152                   || level)
    11591153                 G_RETHROW;
    11601154             } G_ENDCATCH;
     
    11631157         }
    11641158     }
    1165    else if(data && data->is_static() && eof_flag)
    1166      {
    1167        DEBUG_MSG("DataPool::get_data(): static\n");
    1168        DEBUG_MAKE_INDENT(3);
    1169        // We're not connected to anybody => handle the data
    1170        int size=block_list->get_range(offset, sz);
    1171        if (size>0)
    1172          {
    1173            // Hooray! Some data is there
    1174            GCriticalSectionLock lock(&data_lock);
    1175            data->seek(offset, SEEK_SET);
    1176            return data->readall(buffer, size);
    1177          }
    1178        return 0;
    1179      }
    11801159   else if (furl.is_local_file_url())
    11811160     {
     
    14261405         furl=GURL();
    14271406
    1428          const GP<ByteStream> gbs=f->stream;
     1407         const GP<ByteStream> gbs = f->stream;
    14291408         gbs->seek(0, SEEK_SET);
    1430          data=gbs->duplicate();
    1431          added_data(0,data->size());   
     1409         
     1410         char buffer[1024];
     1411         int length;
     1412         while((length = f->stream->read(buffer, 1024)))
     1413           add_data(buffer, length);
    14321414         set_eof();
    1433 //         char buffer[1024];
    1434 //         int length;
    1435 //         while((length=f->stream->read(buffer, 1024)))
    1436 //               add_data(buffer, length);
    1437               // No need to set EOF. It should already be set.
    1438         OpenFiles::get()->stream_released(f->stream, this);
     1415         
     1416         OpenFiles::get()->stream_released(f->stream, this);
    14391417      }
    14401418      fstream=0;
     
    15031481
    15041482void
    1505 // DataPool::add_trigger(int thresh, void (* callback)(GP<GPEnabled> &), GP<GPEnabled> cl_data)
    15061483DataPool::add_trigger(int thresh, void (* callback)(void *), void * cl_data)
    15071484{
     
    15141491void
    15151492DataPool::add_trigger(int tstart, int tlength,
    1516 //                    void (* callback)(GP<GPEnabled> &), GP<GPEnabled> cl_data)
    15171493                      void (* callback)(void *), void * cl_data)
    15181494{
     
    15371513            GCriticalSectionLock lock(&triggers_lock);
    15381514            triggers_list.append(trigger);
    1539          } else if (!furl.is_local_file_url())
     1515         }
     1516         else if (!furl.is_local_file_url())
    15401517         {
    15411518               // We're not connected to anything and maintain our own data
     
    15441521            else
    15451522            {
    1546                GCriticalSectionLock lock(&triggers_lock);
    1547                triggers_list.append(new Trigger(tstart, tlength, callback, cl_data));
     1523              GP<Trigger> trigger=new Trigger(tstart, tlength, callback, cl_data);
     1524              GCriticalSectionLock lock(&triggers_lock);
     1525              triggers_list.append(trigger);
    15481526            }
    15491527         }
     
    15531531
    15541532void
    1555 // DataPool::del_trigger(void (* callback)(GP<GPEnabled> &), GP<GPEnabled> cl_data)
    15561533DataPool::del_trigger(void (* callback)(void *), void * cl_data)
    15571534{
     
    16601637   }
    16611638}
     1639
     1640
     1641
    16621642
    16631643
     
    17951775DataPool::get_stream(void)
    17961776{
    1797   if(data && data->is_static())
    1798   {
    1799     GCriticalSectionLock lock(&data_lock);
    1800     data->seek(0, SEEK_SET);
    1801     return data->duplicate(length);
    1802   }else
    1803   {
    1804     return new PoolByteStream(this);
    1805   }
     1777  return new PoolByteStream(this);
    18061778}
    18071779
  • trunk/libdjvu/DataPool.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DataPool.h,v 1.10 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DataPool.h,v 1.12 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DATAPOOL_H
     
    9799    @memo Thread safe data storage
    98100    @author Andrei Erofeev <eaf@geocities.com>
    99     @version #$Id: DataPool.h,v 1.10 2003/11/07 22:08:20 leonb Exp $#
     101    @version #$Id: DataPool.h,v 1.12 2007/03/25 20:48:29 leonb Exp $#
    100102*/
    101103
     
    509511          @param cl_data Argument to pass to the callback when it's called. */
    510512   void         add_trigger(int start, int length,
    511 //                          void (* callback)(GP<GPEnabled> &), GP<GPEnabled> cl_data);
    512513                            void (* callback)(void *), void * cl_data);
    513514
     
    519520          every offset from #0# to #thresh#, if #thresh# is positive, or
    520521          when #EOF# condition has been set otherwise. */
    521 //   void               add_trigger(int thresh, void (* callback)(GP<GPEnabled> &), GP<GPEnabled> cl_data);
    522    void         add_trigger(int thresh, void (* callback)(void *), void * cl_data);
     522
     523   void         add_trigger(int thresh,
     524                            void (* callback)(void *), void * cl_data);
    523525
    524526      /** Use this function to unregister callbacks, which are no longer
     
    526528          is about to be destroyed. */
    527529   void         del_trigger(void (* callback)(void *), void *  cl_data);
    528 //   void               del_trigger(void (* callback)(GP<GPEnabled> &), GP<GPEnabled>  cl_data);
     530
    529531      //@}
    530532
     
    555557          same URL or bytestream. */
    556558   bool simple_compare(DataPool &pool) const;
     559
     560
    557561private:
    558562   bool         eof_flag;
  • trunk/libdjvu/DjVmDir.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVmDir.cpp,v 1.11 2005/12/30 15:22:16 leonb Exp $
    55 // $Name: $
     56// $Id: DjVmDir.cpp,v 1.13 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    559561{
    560562   GCriticalSectionLock lock((GCriticalSection *) &class_lock);
    561 
    562563   GPosition pos;
    563564   return (title2file.contains(title, pos))?title2file[pos]:(GP<DjVmDir::File>(0));
     
    783784   DEBUG_MSG("DjVmDir::set_file_title(): id='" << id << "', title='" << title << "'\n");
    784785   DEBUG_MAKE_INDENT(3);
    785    
    786    GCriticalSectionLock lock((GCriticalSection *) &class_lock);
    787 
     786   GCriticalSectionLock lock((GCriticalSection *) &class_lock);
    788787   GPosition pos;
    789    
    790       // First see, if the title is unique
    791    for(pos=files_list;pos;++pos)
    792    {
    793       GP<File> file=files_list[pos];
    794       if (file->id!=id && file->title==title)
    795         G_THROW( ERR_MSG("DjVmDir.title_in_use") "\t" + GUTF8String(title));
    796    }
    797 
    798788      // Check if ID is valid
    799789   if (!id2file.contains(id, pos))
  • trunk/libdjvu/DjVmDir.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVmDir.h,v 1.11 2005/12/30 15:22:16 leonb Exp $
    55 // $Name: $
     56// $Id: DjVmDir.h,v 1.12 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVMDIR_H
     
    112114    @author Andrei Erofeev <eaf@geocities.com>
    113115    @version
    114     #$Id: DjVmDir.h,v 1.11 2005/12/30 15:22:16 leonb Exp $# */
     116    #$Id: DjVmDir.h,v 1.12 2007/03/25 20:48:29 leonb Exp $# */
    115117//@{
    116118
  • trunk/libdjvu/DjVmDir0.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVmDir0.cpp,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVmDir0.cpp,v 1.9 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVmDir0.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVmDir0.h,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVmDir0.h,v 1.9 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVMDIR0_H
     
    9092    @memo Directory of DjVu all-in-one-file DjVu documents.
    9193    @author Andrei Erofeev <eaf@geocities.com>
    92     @version #$Id: DjVmDir0.h,v 1.8 2003/11/07 22:08:20 leonb Exp $# */
     94    @version #$Id: DjVmDir0.h,v 1.9 2007/03/25 20:48:29 leonb Exp $# */
    9395
    9496//@{
  • trunk/libdjvu/DjVmDoc.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVmDoc.cpp,v 1.10 2005/05/25 20:24:52 leonb Exp $
    55 // $Name: $
     56// $Id: DjVmDoc.cpp,v 1.11 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVmDoc.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVmDoc.h,v 1.10 2005/05/25 20:24:52 leonb Exp $
    55 // $Name: $
     56// $Id: DjVmDoc.h,v 1.11 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVMDOC_H
     
    8688    @memo DjVu multipage documents reader/writer.
    8789    @author Andrei Erofeev <eaf@geocities.com>
    88     @version #$Id: DjVmDoc.h,v 1.10 2005/05/25 20:24:52 leonb Exp $#
     90    @version #$Id: DjVmDoc.h,v 1.11 2007/03/25 20:48:29 leonb Exp $#
    8991*/
    9092
  • trunk/libdjvu/DjVmNav.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVmNav.cpp,v 1.1 2005/05/25 17:36:53 leonb Exp $
    55 // $Name: $
     56// $Id: DjVmNav.cpp,v 1.2 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVmNav.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVmNav.h,v 1.1 2005/05/25 17:36:53 leonb Exp $
    55 // $Name: $
     56// $Id: DjVmNav.h,v 1.2 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVMNAV_H
  • trunk/libdjvu/DjVuAnno.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuAnno.cpp,v 1.13 2006/01/09 15:28:46 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuAnno.cpp,v 1.14 2007/03/25 20:48:29 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuAnno.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuAnno.h,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuAnno.h,v 1.9 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUANNO_H
     
    8688    @author Andrei Erofeev <eaf@geocities.com>
    8789    @version
    88     #$Id: DjVuAnno.h,v 1.8 2003/11/07 22:08:20 leonb Exp $# */
     90    #$Id: DjVuAnno.h,v 1.9 2007/03/25 20:48:30 leonb Exp $# */
    8991//@{
    9092
  • trunk/libdjvu/DjVuDocEditor.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuDocEditor.cpp,v 1.13 2005/05/25 20:24:52 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuDocEditor.cpp,v 1.15 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    458460     if(source != this)
    459461     {
    460        file_pool=DataPool::create(file_pool->get_stream()->duplicate());
     462       file_pool=DataPool::create(file_pool->get_stream());
    461463     }
    462464   }
  • trunk/libdjvu/DjVuDocEditor.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuDocEditor.h,v 1.9 2005/05/25 20:24:52 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuDocEditor.h,v 1.10 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUDOCEDITOR_H
     
    8385    @memo DjVu document editor class.
    8486    @author Andrei Erofeev <eaf@geocities.com>
    85     @version #$Id: DjVuDocEditor.h,v 1.9 2005/05/25 20:24:52 leonb Exp $#
     87    @version #$Id: DjVuDocEditor.h,v 1.10 2007/03/25 20:48:30 leonb Exp $#
    8688*/
    8789
  • trunk/libdjvu/DjVuDocument.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuDocument.cpp,v 1.15 2006/01/19 15:20:41 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuDocument.cpp,v 1.17 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    11041106          GUTF8String chkid;
    11051107          if (!iff.get_chunk(chkid) || chkid!="FORM:THUM")
    1106             G_THROW( ERR_MSG("DjVuDocument.bad_thumb") );
    1107          
     1108            G_THROW( ERR_MSG("DjVuDocument.bad_thumb") );         
    11081109          for(int i=0;i<req->thumb_chunk;i++)
    11091110          {
     
    11251126          // to download it next time
    11261127          add_to_cache(req->thumb_file);
    1127          
    11281128          req->thumb_file=0;
    11291129          req->image_file=0;
  • trunk/libdjvu/DjVuDocument.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuDocument.h,v 1.10 2005/05/25 20:24:52 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuDocument.h,v 1.11 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUDOCUMENT_H
     
    9193    @memo DjVu document class.
    9294    @author Andrei Erofeev <eaf@geocities.com>
    93     @version #$Id: DjVuDocument.h,v 1.10 2005/05/25 20:24:52 leonb Exp $#
     95    @version #$Id: DjVuDocument.h,v 1.11 2007/03/25 20:48:30 leonb Exp $#
    9496*/
    9597
  • trunk/libdjvu/DjVuDumpHelper.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuDumpHelper.cpp,v 1.9 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuDumpHelper.cpp,v 1.10 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuDumpHelper.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuDumpHelper.h,v 1.9 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuDumpHelper.h,v 1.10 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUDUMPHELPER_H
     
    7678    Andrei Erofeev <eaf@geocities.com> -- as a class.
    7779    @version
    78     #$Id: DjVuDumpHelper.h,v 1.9 2003/11/07 22:08:20 leonb Exp $# */
     80    #$Id: DjVuDumpHelper.h,v 1.10 2007/03/25 20:48:30 leonb Exp $# */
    7981//@{
    8082
  • trunk/libdjvu/DjVuErrorList.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuErrorList.cpp,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuErrorList.cpp,v 1.9 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuErrorList.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuErrorList.h,v 1.9 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuErrorList.h,v 1.10 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUERRORLIST_H
     
    8284    @memo DjVuErrorList class.
    8385    @author Bill C Riemers <docbill@sourceforge.net>
    84     @version #$Id: DjVuErrorList.h,v 1.9 2003/11/07 22:08:20 leonb Exp $#
     86    @version #$Id: DjVuErrorList.h,v 1.10 2007/03/25 20:48:30 leonb Exp $#
    8587*/
    8688
  • trunk/libdjvu/DjVuFile.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuFile.cpp,v 1.12 2005/12/24 12:45:01 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuFile.cpp,v 1.15 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    12091211      iffout.copy(achunk);
    12101212      iffout.close_chunk();
    1211 //      desc.format( ERR_MSG("DjVuFile.text") );
    1212     }
    1213 
     1213    }
     1214  else if (chkid == "CELX")
     1215    {
     1216      G_THROW( ERR_MSG("DjVuFile.securedjvu") );
     1217    }
     1218 
    12141219  // Return description
    12151220  return desc;
     
    15071512    if (!iff.get_chunk(chkid))
    15081513      REPORT_EOF(true)
    1509      
     1514
    15101515    int chunks=0;
    15111516    int last_chunk=0;
     1517#ifndef SLOW_BUT_EXACT_DETECTION_OF_NDIR
     1518    int found_incl=0;
     1519#endif
    15121520    G_TRY
    15131521    {
     
    15241532          break;
    15251533        }
     1534#ifndef SLOW_BUT_EXACT_DETECTION_OF_NDIR
     1535        if (chkid=="INCL")
     1536          found_incl = 1;
     1537        if (chunks>2 && !found_incl && !data_pool->is_eof())
     1538          return 0;
     1539#endif
    15261540        iff.seek_close_chunk();
    15271541      }
  • trunk/libdjvu/DjVuFile.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuFile.h,v 1.10 2005/12/24 12:45:01 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuFile.h,v 1.11 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUFILE_H
     
    103105    @memo Classes representing DjVu files.
    104106    @author Andrei Erofeev <eaf@geocities.com>
    105     @version #$Id: DjVuFile.h,v 1.10 2005/12/24 12:45:01 leonb Exp $#
     107    @version #$Id: DjVuFile.h,v 1.11 2007/03/25 20:48:30 leonb Exp $#
    106108*/
    107109
  • trunk/libdjvu/DjVuFileCache.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuFileCache.cpp,v 1.9 2004/08/06 15:11:29 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuFileCache.cpp,v 1.10 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuFileCache.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuFileCache.h,v 1.8 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuFileCache.h,v 1.9 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUFILECACHE_H
     
    9496    @memo Simple DjVuFile caching class.
    9597    @author Andrei Erofeev <eaf@geocities.com>
    96     @version #$Id: DjVuFileCache.h,v 1.8 2003/11/07 22:08:20 leonb Exp $#
     98    @version #$Id: DjVuFileCache.h,v 1.9 2007/03/25 20:48:30 leonb Exp $#
    9799*/
    98100
  • trunk/libdjvu/DjVuGlobal.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuGlobal.cpp,v 1.7 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuGlobal.cpp,v 1.8 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuGlobal.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuGlobal.h,v 1.10 2004/08/04 02:36:59 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuGlobal.h,v 1.11 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUGLOBAL_H
     
    101103    Global definitions.
    102104    @version
    103     #$Id: DjVuGlobal.h,v 1.10 2004/08/04 02:36:59 leonb Exp $#
     105    #$Id: DjVuGlobal.h,v 1.11 2007/03/25 20:48:30 leonb Exp $#
    104106    @author
    105107    L\'eon Bottou <leonb@research.att.com> -- empty file.\\
  • trunk/libdjvu/DjVuGlobalMemory.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuGlobalMemory.cpp,v 1.6 2003/11/07 22:08:20 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuGlobalMemory.cpp,v 1.7 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuImage.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuImage.cpp,v 1.13 2006/01/19 15:20:41 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuImage.cpp,v 1.14 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    10761078    GRect all=inall;
    10771079    if( dimg.get_rotate() )
    1078     {
     1080      {
    10791081        GRectMapper mapper;
    10801082        mapper.rotate(-dimg.get_rotate());
     
    10821084        mapper.map(all);
    10831085    }
    1084 
     1086   
    10851087  // Sanity
    10861088  if (! ( all.contains(rect.xmin, rect.ymin) &&
     
    11361138          const GRect &inrect, const GRect &inall, double gamma )
    11371139{
    1138     GRect rect=inrect;
    1139     GRect all=inall;
    1140     if( dimg.get_rotate()%4 )
     1140  GRect rect=inrect;
     1141  GRect all=inall;
     1142  if( dimg.get_rotate()%4 )
    11411143    {
    1142         GRectMapper mapper;
     1144      GRectMapper mapper;
    11431145      mapper.rotate(-dimg.get_rotate());
    1144         mapper.map(rect);
    1145         mapper.map(all);
    1146     }
    1147 
     1146      mapper.map(rect);
     1147      mapper.map(all);
     1148    }
     1149 
    11481150  // Sanity
    11491151  if (! ( all.contains(rect.xmin, rect.ymin) &&
     
    11541156  w = dimg.get_real_width();
    11551157  h = dimg.get_real_height();
    1156  
    11571158
    11581159  rw = all.width();
     
    12531254        rotate_count = rotate_count - djvuinfo->orientation;
    12541255      ///decode
    1255         djvuanno->decode(bs);
    1256             ///map hyperlinks correctly for rotation           
     1256      djvuanno->decode(bs);
     1257      ///map hyperlinks correctly for rotation           
    12571258      if( rotate_count & 3 )
    12581259        {   
    1259             GRect input, output;
     1260          GRect input, output;
    12601261          input = GRect(0,0,get_width(),get_height());
    12611262          if (rotate_count & 1)
     
    12631264          else
    12641265            output = GRect(0,0,get_width(),get_height());
    1265             GRectMapper mapper;
    1266             mapper.clear();
    1267             mapper.set_input(input);
    1268             mapper.set_output(output);               
     1266          GRectMapper mapper;
     1267          mapper.clear();
     1268          mapper.set_input(input);
     1269          mapper.set_output(output);               
    12691270          mapper.rotate(-rotate_count);
    1270             GPList<GMapArea> &list=djvuanno->ant->map_areas;
    1271             for(GPosition pos=list;pos;++pos)
    1272                 list[pos]->unmap(mapper);
    1273             }
    1274         return djvuanno;
     1271          GPList<GMapArea> &list=djvuanno->ant->map_areas;
     1272          for(GPosition pos=list;pos;++pos)
     1273            list[pos]->unmap(mapper);
     1274        }
     1275      return djvuanno;
    12751276    }
    12761277    else
    1277         return NULL;
     1278      return NULL;
    12781279}
    12791280
  • trunk/libdjvu/DjVuImage.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuImage.h,v 1.9 2005/04/27 16:34:13 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuImage.h,v 1.10 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUIMAGE_H
     
    101103    Andrei Erofeev <eaf@geocities.com> - multipage support
    102104    @version
    103     #$Id: DjVuImage.h,v 1.9 2005/04/27 16:34:13 leonb Exp $# */
     105    #$Id: DjVuImage.h,v 1.10 2007/03/25 20:48:30 leonb Exp $# */
    104106//@{
    105107
  • trunk/libdjvu/DjVuInfo.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuInfo.cpp,v 1.10 2005/12/24 12:45:01 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuInfo.cpp,v 1.11 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    129131  // Fixup
    130132  if (gamma<0.3)
    131      gamma=0.3;
     133    gamma=0.3;
    132134  if (gamma>5.0)
    133      gamma=5.0;
     135    gamma=5.0;
    134136  if (dpi < 25 || dpi > 6000)
    135137    dpi = 300;
    136138  switch (flags & 0x7)
    137   {
     139    {
    138140    case 6:  orientation=1; break;
    139141    case 2:  orientation=2; break;
    140142    case 5:  orientation=3; break;
    141143    default: orientation=0; break;
    142   }
     144    }
    143145}
    144146
     
    155157  unsigned char flags;
    156158  switch (orientation)
    157   {
     159    {
    158160    default: flags=0; break;
    159161    case 1:  flags=6; break;
    160162    case 2:  flags=2; break;
    161163    case 3:  flags=5; break;
    162   }
     164    }
    163165  bs.write8(flags);
    164166}
  • trunk/libdjvu/DjVuInfo.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuInfo.h,v 1.15 2005/12/24 12:45:01 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuInfo.h,v 1.16 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUINFO_H
     
    7476    L\'eon Bottou <leonb@research.att.com>
    7577    @version
    76     #$Id: DjVuInfo.h,v 1.15 2005/12/24 12:45:01 leonb Exp $# */
     78    #$Id: DjVuInfo.h,v 1.16 2007/03/25 20:48:30 leonb Exp $# */
    7779//@{
    7880
  • trunk/libdjvu/DjVuMessage.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuMessage.cpp,v 1.17 2005/08/07 21:32:28 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuMessage.cpp,v 1.19 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    119121
    120122// directory names for searching messages
    121 static const char opensourcedir[]="osi";
    122123#ifdef AUTOCONF
    123 //static const char DjVuDataDir[] = DIR_DATADIR "/djvu";
    124 static const char ModuleDjVuDir[] ="share/djvu";
     124// !!! ER !!! static const char DjVuDataDir[] = DIR_DATADIR "/djvu/osi";
     125static const char ModuleDjVuDir[] ="share/djvu/osi";
    125126#else /* !AUTOCONF */
    126127static const char ModuleDjVuDir[] ="profiles";
     
    263264           GList<GURL> &list)
    264265{
    265   if( !url.is_empty()
    266       && !map.contains(url.get_string()) && url.is_dir() )
     266  if( !url.is_empty() && !map.contains(url.get_string()) )
    267267    {
    268268      map[url.get_string()]=0;
     
    302302#endif
    303303#if defined(AUTOCONF)
    304    // GURL dpath = GURL::Filename::UTF8(DjVuDataDir);
    305    // appendPath(dpath,pathsmap,paths);
     304    // ER !!! GURL dpath = GURL::Filename::UTF8(DjVuDataDir);
     305    // !!! appendPath(dpath,pathsmap,paths);
    306306#endif
    307307#ifdef WIN32
     
    353353    }
    354354    GList<GURL> localepaths;
    355     GList<GURL> osilocalepaths;
    356355
    357356    // Need to do it the right way!
     
    394393                  if(path.is_dir())
    395394                    localepaths.append(path);
    396                   path=GURL::UTF8(GUTF8String(opensourcedir)+"/"+src,paths[pos]);
    397                   if(path.is_dir())
    398                     osilocalepaths.append(path);
    399395                }
    400396              }
     
    405401          }
    406402          if(!pos)
    407           {
     403            {
    408404            for(pos=paths;pos;++pos)
    409             {
     405              {
    410406              path=GURL::UTF8(sublocale,paths[pos]);
    411407              if(path.is_dir())
    412               {
    413408                localepaths.append(path);
    414               }
    415               path=GURL::UTF8(GUTF8String(opensourcedir)+"/"+sublocale,paths[pos]);
    416               if(path.is_dir())
    417               {
    418                 osilocalepaths.append(path);
    419               }
    420409            }
    421410          }
     
    430419    for(pos=paths;pos;++pos)
    431420      appendPath(paths[pos],pathsmap,realpaths);
    432     for(pos=osilocalepaths;pos;++pos)
    433       appendPath(osilocalepaths[pos],pathsmap,realpaths);
    434     for(pos=paths;pos;++pos)
    435       {
    436         path=GURL::UTF8(opensourcedir,paths[pos]);
    437         appendPath(path,pathsmap,realpaths);
    438       }
    439421  }
    440422  return realpaths;
  • trunk/libdjvu/DjVuMessage.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuMessage.h,v 1.9 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuMessage.h,v 1.10 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759
  • trunk/libdjvu/DjVuMessageLite.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuMessageLite.cpp,v 1.13 2005/04/27 16:34:13 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuMessageLite.cpp,v 1.14 2007/03/25 20:48:30 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuMessageLite.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuMessageLite.h,v 1.9 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuMessageLite.h,v 1.10 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef __DJVU_MESSAGE_LITE_H__
  • trunk/libdjvu/DjVuNavDir.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuNavDir.cpp,v 1.8 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuNavDir.cpp,v 1.9 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuNavDir.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuNavDir.h,v 1.8 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuNavDir.h,v 1.9 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUNAVDIR_H
     
    8890    @memo DjVu Navigation Directory
    8991    @author Andrei Erofeev <eaf@geocities.com>
    90     @version #$Id: DjVuNavDir.h,v 1.8 2003/11/07 22:08:21 leonb Exp $#
     92    @version #$Id: DjVuNavDir.h,v 1.9 2007/03/25 20:48:31 leonb Exp $#
    9193*/
    9294
  • trunk/libdjvu/DjVuPalette.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuPalette.cpp,v 1.12 2006/02/21 16:10:29 docbill Exp $
    55 // $Name: $
     56// $Id: DjVuPalette.cpp,v 1.13 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuPalette.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuPalette.h,v 1.9 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuPalette.h,v 1.10 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUPALETTE_H_
     
    8587    DjVuPalette header file
    8688    @version
    87     #$Id: DjVuPalette.h,v 1.9 2003/11/07 22:08:21 leonb Exp $#
     89    #$Id: DjVuPalette.h,v 1.10 2007/03/25 20:48:31 leonb Exp $#
    8890    @author:
    8991    L\'eon Bottou <leonb@research.att.com> */
  • trunk/libdjvu/DjVuPort.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuPort.cpp,v 1.10 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuPort.cpp,v 1.11 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuPort.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuPort.h,v 1.8 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuPort.h,v 1.9 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUPORT_H
     
    120122    @author Andrei Erofeev <eaf@geocities.com>\\
    121123            L\'eon Bottou <leonb@research.att.com>
    122     @version #$Id: DjVuPort.h,v 1.8 2003/11/07 22:08:21 leonb Exp $# */
     124    @version #$Id: DjVuPort.h,v 1.9 2007/03/25 20:48:31 leonb Exp $# */
    123125//@{
    124126
  • trunk/libdjvu/DjVuText.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuText.cpp,v 1.10 2004/07/07 19:23:36 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuText.cpp,v 1.11 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuText.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuText.h,v 1.10 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuText.h,v 1.11 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVUTEXT_H
     
    8385    @author Andrei Erofeev <eaf@geocities.com>
    8486    @version
    85     #$Id: DjVuText.h,v 1.10 2003/11/07 22:08:21 leonb Exp $# */
     87    #$Id: DjVuText.h,v 1.11 2007/03/25 20:48:31 leonb Exp $# */
    8688//@{
    8789
  • trunk/libdjvu/DjVuToPS.cpp

    r17 r206  
    22//C- -------------------------------------------------------------------
    33//C- DjVuLibre-3.5
    4 //C- Copyright (c) 2002-2003  Leon Bottou and Yann Le Cun.
     4//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
    55//C- Copyright (c) 2001  AT&T
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuToPS.cpp,v 1.23 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuToPS.cpp,v 1.24 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/DjVuToPS.h

    r17 r206  
    22//C- -------------------------------------------------------------------
    33//C- DjVuLibre-3.5
    4 //C- Copyright (c) 2002-2003  Leon Bottou and Yann Le Cun.
     4//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
    55//C- Copyright (c) 2001  AT&T
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: DjVuToPS.h,v 1.14 2004/03/05 16:48:53 leonb Exp $
    55 // $Name: $
     56// $Id: DjVuToPS.h,v 1.15 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _DJVU_TO_PS_H_
     
    7375            Florin Nicsa <Florin.Nicsa@insa-lyon.fr>
    7476    @version
    75     #$Id: DjVuToPS.h,v 1.14 2004/03/05 16:48:53 leonb Exp $#
     77    #$Id: DjVuToPS.h,v 1.15 2007/03/25 20:48:31 leonb Exp $#
    7678*/
    7779//@{
  • trunk/libdjvu/GBitmap.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GBitmap.cpp,v 1.11 2005/12/24 12:45:01 leonb Exp $
    55 // $Name: $
     56// $Id: GBitmap.cpp,v 1.13 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    7072#include <string.h>
    7173
    72 // File "$Id: GBitmap.cpp,v 1.11 2005/12/24 12:45:01 leonb Exp $"
     74// File "$Id: GBitmap.cpp,v 1.13 2007/03/25 20:48:31 leonb Exp $"
    7375// - Author: Leon Bottou, 05/1997
    7476
     
    299301  int acolumns = read_integer(lookahead, ref);
    300302  int arows = read_integer(lookahead, ref);
     303  int maxval = 1;
    301304  init(arows, acolumns, aborder);
    302305  // go reading file
     
    310313          return;
    311314        case '2':
    312           grays = 1 + read_integer(lookahead, ref);
    313           if (grays > 256)
    314             G_THROW("Cannot read PGM with depth greater than 8 bits.");
    315           read_pgm_text(ref);
     315          maxval = read_integer(lookahead, ref);
     316          if (maxval > 65535)
     317            G_THROW("Cannot read PGM with depth greater than 16 bits.");
     318          grays = (maxval>255 ? 256 : maxval+1);
     319          read_pgm_text(ref, maxval);
    316320          return;
    317321        case '4':
     
    320324          return;
    321325        case '5':
    322           grays = 1 + read_integer(lookahead, ref);
    323           if (grays > 256)
    324             grays = 256;
    325           read_pgm_raw(ref);
     326          maxval = read_integer(lookahead, ref);
     327          if (maxval > 65535)
     328            G_THROW("Cannot read PGM with depth greater than 16 bits.");
     329          grays = (maxval>255 ? 256 : maxval+1);
     330          read_pgm_raw(ref, maxval);
    326331          return;
    327332        }
     
    794799
    795800void
    796 GBitmap::read_pgm_text(ByteStream &bs)
     801GBitmap::read_pgm_text(ByteStream &bs, int maxval)
    797802{
    798803  unsigned char *row = bytes_data + border;
    799804  row += (nrows-1) * bytes_per_row;
    800805  char lookahead = '\n';
     806  GTArray<unsigned char> ramp(0, maxval);
     807  for (int i=0; i<=maxval; i++)
     808    ramp[i] = (i<maxval ? ((grays-1)*(maxval-i) + maxval/2) / maxval : 0);
    801809  for (int n = nrows-1; n>=0; n--)
    802810    {
    803811      for (int c = 0; c<ncolumns; c++)
    804         row[c] = grays - 1 - read_integer(lookahead, bs);
     812        row[c] = ramp[read_integer(lookahead, bs)];
    805813      row -= bytes_per_row;
    806814    }
     
    834842
    835843void
    836 GBitmap::read_pgm_raw(ByteStream &bs)
    837 {
     844GBitmap::read_pgm_raw(ByteStream &bs, int maxval)
     845{
     846  int maxbin = (maxval>255) ? 65536 : 256;
     847  GTArray<unsigned char> ramp(0, maxbin-1);
     848  for (int i=0; i<maxbin; i++)
     849    ramp[i] = (i<maxval ? ((grays-1)*(maxval-i) + maxval/2) / maxval : 0);
     850  unsigned char *bramp = ramp;
    838851  unsigned char *row = bytes_data + border;
    839852  row += (nrows-1) * bytes_per_row;
    840853  for (int n = nrows-1; n>=0; n--)
    841854    {
    842       for (int c = 0; c<ncolumns; c++)
    843         {
    844           unsigned char x;
    845           bs.read((void*)&x, 1);
    846           row[c] = grays - 1 - x;
     855      if (maxbin > 256)
     856        {
     857          for (int c = 0; c<ncolumns; c++)
     858            {
     859              unsigned char x[2];
     860              bs.read((void*)&x, 2);
     861              row[c] = bramp[x[0]*256+x[1]];
     862            }
     863        }
     864      else
     865        {
     866          for (int c = 0; c<ncolumns; c++)
     867            {
     868              unsigned char x;
     869              bs.read((void*)&x, 1);
     870              row[c] = bramp[x];
     871            }
    847872        }
    848873      row -= bytes_per_row;
  • trunk/libdjvu/GBitmap.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GBitmap.h,v 1.9 2004/04/17 23:56:11 leonb Exp $
    55 // $Name: $
     56// $Id: GBitmap.h,v 1.13 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GBITMAP_H_
     
    102104    L\'eon Bottou <leonb@research.att.com>
    103105    @version
    104     #$Id: GBitmap.h,v 1.9 2004/04/17 23:56:11 leonb Exp $#
     106    #$Id: GBitmap.h,v 1.13 2007/03/25 20:48:31 leonb Exp $#
    105107
    106108 */
     
    482484  void decode(unsigned char *runs);
    483485  void read_pbm_text(ByteStream &ref);
    484   void read_pgm_text(ByteStream &ref);
     486  void read_pgm_text(ByteStream &ref, int maxval);
    485487  void read_pbm_raw(ByteStream &ref);
    486   void read_pgm_raw(ByteStream &ref);
     488  void read_pgm_raw(ByteStream &ref, int maxval);
    487489  void read_rle_raw(ByteStream &ref);
    488490  static void append_long_run(unsigned char *&data, int count);
     
    568570GBitmap::operator[](int row)
    569571{
    570   if (!bytes) uncompress();
     572  if (!bytes)
     573    uncompress();
    571574  if (row<0 || row>=nrows) {
    572575#ifndef NDEBUG
     
    582585GBitmap::operator[](int row) const
    583586{
    584   if (!bytes) ((GBitmap*)this)->uncompress();
     587  if (!bytes)
     588    ((GBitmap*)this)->uncompress();
    585589  if (row<0 || row>=nrows) {
    586590#ifndef NDEBUG
  • trunk/libdjvu/GContainer.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GContainer.cpp,v 1.13 2005/11/12 15:52:25 leonb Exp $
    55 // $Name: $
     56// $Id: GContainer.cpp,v 1.15 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    7981
    8082GArrayBase::GArrayBase(const GArrayBase &ref)
    81   : traits(ref.traits),
    82     gdata(data,0,1),
     83  : traits(ref.traits), data(0),
    8384    minlo(ref.minlo), maxhi(ref.maxhi),
    8485    lobound(ref.lobound), hibound(ref.hibound)
    8586{
    8687  if (maxhi >= minlo)
    87     gdata.resize(traits.size * (maxhi - minlo + 1),1);
     88    data = ::operator new(traits.size * (maxhi - minlo + 1));
    8889  if (hibound >= lobound)
    8990    traits.copy(traits.lea(data, lobound-minlo),
     
    9495
    9596GArrayBase::GArrayBase(const GCONT Traits &traits)
    96   : traits(traits),
    97     gdata(data,0,1),
     97  : traits(traits), data(0),
    9898    minlo(0), maxhi(-1),
    9999    lobound(0), hibound(-1)
     
    103103
    104104GArrayBase::GArrayBase(const GCONT Traits &traits, int lobound, int hibound)
    105   : traits(traits),
    106     gdata(data,0,1),
     105  : traits(traits), data(0),
    107106    minlo(0), maxhi(-1),
    108107    lobound(0), hibound(-1)
     
    184183        traits.fini( traits.lea(data, lobound-minlo), hibound-lobound+1 );
    185184      if (data)
    186         gdata.resize(0,1);
     185        ::operator delete (data);
     186      data = 0;
    187187      lobound = minlo = 0;
    188188      hibound = maxhi = -1;
     
    221221  int end = hi;
    222222  int bytesize = traits.size * (nmaxhi-nminlo+1);
    223   void *ndata;
    224   GPBufferBase gndata(ndata,bytesize,1);
     223  void *ndata = ::operator new(bytesize);
    225224#if GCONTAINER_ZERO_FILL
    226225  memset(ndata, 0, bytesize);  // slower but cleaner
    227226#endif
    228   if (lo < lobound)
    229     { traits.init( traits.lea(ndata,lo-nminlo), lobound-lo ); beg=lobound; }
    230   else if (lobound < lo)
    231     { traits.fini( traits.lea(data,lobound-minlo), lo-lobound); }
    232   if (hibound < hi)
    233     { traits.init( traits.lea(ndata,hibound-nminlo+1), hi-hibound ); end=hibound; }
    234   else if (hi < hibound)
    235     { traits.fini( traits.lea(data, hi-minlo+1), hibound-hi ); }
    236   if (end >= beg)
    237     { traits.copy( traits.lea(ndata, beg-nminlo),
    238                    traits.lea(data, beg-minlo),
    239                    end-beg+1, 1 ); }
     227  G_TRY
     228    {
     229      if (lo < lobound)
     230        { traits.init( traits.lea(ndata,lo-nminlo), lobound-lo ); beg=lobound; }
     231      else if (lobound < lo)
     232        { traits.fini( traits.lea(data,lobound-minlo), lo-lobound); }
     233      if (hibound < hi)
     234        { traits.init( traits.lea(ndata,hibound-nminlo+1), hi-hibound ); end=hibound; }
     235      else if (hi < hibound)
     236        { traits.fini( traits.lea(data, hi-minlo+1), hibound-hi ); }
     237      if (end >= beg)
     238        { traits.copy( traits.lea(ndata, beg-nminlo),
     239                       traits.lea(data, beg-minlo),
     240                       end-beg+1, 1 ); }
     241    }
     242  G_CATCH_ALL
     243    {
     244      if (ndata)
     245        ::operator delete(ndata);
     246      G_RETHROW;
     247    }
     248  G_ENDCATCH;
    240249  // free and replace
    241   void *tmp=data;
    242   data=ndata;
    243   ndata=tmp;
     250  if (data)
     251    ::operator delete(data);
     252  data = ndata;
    244253  minlo = nminlo;
    245254  maxhi = nmaxhi;
     
    305314        nmaxhi += (nmaxhi < 8 ? 8 : (nmaxhi > 32768 ? 32768 : nmaxhi));
    306315      int bytesize = traits.size * (nmaxhi-minlo+1);
    307       void *ndata; //  = operator new (bytesize);
    308       GPBufferBase gndata(ndata,bytesize,1);
    309       memset(ndata, 0, bytesize);  // slower but cleaner
    310       if (hibound >= lobound)
    311         traits.copy( traits.lea(ndata, lobound-minlo),
    312                      traits.lea(data, lobound-minlo),
    313                      hibound-lobound+1, 1 );
     316      void *ndata = ::operator new (bytesize);
     317#if GCONTAINER_ZERO_FILL
     318      memset(ndata, 0, bytesize);
     319#endif
     320      G_TRY
     321        {
     322          if (hibound >= lobound)
     323            traits.copy( traits.lea(ndata, lobound-minlo),
     324                         traits.lea(data, lobound-minlo),
     325                         hibound-lobound+1, 1 );
     326        }
     327      G_CATCH_ALL
     328        {
     329          if (ndata)
     330            ::operator delete (ndata);
     331          G_RETHROW;
     332        }
     333      G_ENDCATCH;
     334      if (data)
     335        ::operator delete(data);
     336      data = ndata;
    314337      maxhi = nmaxhi;
    315       void *tmp=data;
    316       data = ndata;
    317       ndata=tmp;
    318338    }
    319339  // Shift data
  • trunk/libdjvu/GContainer.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GContainer.h,v 1.17 2006/02/21 16:10:29 docbill Exp $
    55 // $Name: $
     56// $Id: GContainer.h,v 1.19 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GCONTAINER_H_
     
    131133    Andrei Erofeev <eaf@geocities.com> -- bug fixes.
    132134    @version
    133     #$Id: GContainer.h,v 1.17 2006/02/21 16:10:29 docbill Exp $# */
     135    #$Id: GContainer.h,v 1.19 2007/03/25 20:48:31 leonb Exp $# */
    134136//@{
     137
     138
     139
     140// ------------------------------------------------------------
     141// HASH FUNCTIONS
     142// ------------------------------------------------------------
     143
     144
     145/** @name Hash functions
     146    These functions let you use template class \Ref{GMap} with the
     147    corresponding elementary types. The returned hash code may be reduced to
     148    an arbitrary range by computing its remainder modulo the upper bound of
     149    the range.
     150    @memo Hash functions for elementary types. */
     151//@{
     152
     153/** Hashing function (unsigned int). */
     154static inline unsigned int
     155hash(const unsigned int & x)
     156{
     157  return x;
     158}
     159
     160/** Hashing function (int). */
     161static inline unsigned int
     162hash(const int & x)
     163{
     164  return (unsigned int)x;
     165}
     166
     167/** Hashing function (long). */
     168static inline unsigned int
     169hash(const long & x)
     170{
     171  return (unsigned int)x;
     172}
     173
     174/** Hashing function (unsigned long). */
     175static inline unsigned int
     176hash(const unsigned long & x)
     177{
     178  return (unsigned int)x;
     179}
     180
     181/** Hashing function (const void *). */
     182static inline unsigned int
     183hash(const void * const & x)
     184{
     185  return (unsigned long) x;
     186}
     187
     188/** Hashing function (float). */
     189static inline unsigned int
     190hash(const float & x)
     191{
     192  // optimizer will get rid of unnecessary code 
     193  unsigned int *addr = (unsigned int*)&x;
     194  if (sizeof(float)<2*sizeof(unsigned int))
     195    return addr[0];
     196  else
     197    return addr[0]^addr[1];
     198}
     199
     200/** Hashing function (double). */
     201static inline unsigned int
     202hash(const double & x)
     203{
     204  // optimizer will get rid of unnecessary code
     205  unsigned int *addr = (unsigned int*)&x;
     206  if (sizeof(double)<2*sizeof(unsigned int))
     207    return addr[0];
     208  else if (sizeof(double)<4*sizeof(unsigned int))
     209    return addr[0]^addr[1];
     210  else
     211    return addr[0]^addr[1]^addr[2]^addr[3];   
     212}
    135213
    136214
     
    333411  const Traits &traits;
    334412  void  *data;
    335   GPBufferBase gdata;
    336413  int   minlo;
    337414  int   maxhi;
     
    12651342
    12661343
    1267 // ------------------------------------------------------------
    1268 // HASH FUNCTIONS
    1269 // ------------------------------------------------------------
    1270 
    1271 
    1272 /** @name Hash functions
    1273     These functions let you use template class \Ref{GMap} with the
    1274     corresponding elementary types. The returned hash code may be reduced to
    1275     an arbitrary range by computing its remainder modulo the upper bound of
    1276     the range.
    1277     @memo Hash functions for elementary types. */
    1278 //@{
    1279 
    1280 /** Hashing function (unsigned int). */
    1281 static inline unsigned int
    1282 hash(const unsigned int & x)
    1283 {
    1284   return x;
    1285 }
    1286 
    1287 /** Hashing function (int). */
    1288 static inline unsigned int
    1289 hash(const int & x)
    1290 {
    1291   return (unsigned int)x;
    1292 }
    1293 
    1294 /** Hashing function (long). */
    1295 static inline unsigned int
    1296 hash(const long & x)
    1297 {
    1298   return (unsigned int)x;
    1299 }
    1300 
    1301 /** Hashing function (unsigned long). */
    1302 static inline unsigned int
    1303 hash(const unsigned long & x)
    1304 {
    1305   return (unsigned int)x;
    1306 }
    1307 
    1308 /** Hashing function (const void *). */
    1309 static inline unsigned int
    1310 hash(const void * const & x)
    1311 {
    1312   return (unsigned long) x;
    1313 }
    1314 
    1315 /** Hashing function (float). */
    1316 static inline unsigned int
    1317 hash(const float & x)
    1318 {
    1319   // optimizer will get rid of unnecessary code 
    1320   unsigned int *addr = (unsigned int*)&x;
    1321   if (sizeof(float)<2*sizeof(unsigned int))
    1322     return addr[0];
    1323   else
    1324     return addr[0]^addr[1];
    1325 }
    1326 
    1327 /** Hashing function (double). */
    1328 static inline unsigned int
    1329 hash(const double & x)
    1330 {
    1331   // optimizer will get rid of unnecessary code
    1332   unsigned int *addr = (unsigned int*)&x;
    1333   if (sizeof(double)<2*sizeof(unsigned int))
    1334     return addr[0];
    1335   else if (sizeof(double)<4*sizeof(unsigned int))
    1336     return addr[0]^addr[1];
    1337   else
    1338     return addr[0]^addr[1]^addr[2]^addr[3];   
    1339 }
    1340 
    13411344
    13421345//@}
  • trunk/libdjvu/GException.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GException.cpp,v 1.14 2004/08/06 15:11:29 leonb Exp $
    55 // $Name: $
     56// $Id: GException.cpp,v 1.15 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/GException.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GException.h,v 1.11 2005/11/12 15:52:25 leonb Exp $
    55 // $Name: $
     56// $Id: GException.h,v 1.12 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GEXCEPTION_H_
     
    117119    Andrei Erofeev <eaf@geocities.com> -- fixed message memory allocation.
    118120    @version
    119     #$Id: GException.h,v 1.11 2005/11/12 15:52:25 leonb Exp $# */
     121    #$Id: GException.h,v 1.12 2007/03/25 20:48:31 leonb Exp $# */
    120122//@{
    121123
  • trunk/libdjvu/GIFFManager.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GIFFManager.cpp,v 1.8 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GIFFManager.cpp,v 1.9 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/GIFFManager.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GIFFManager.h,v 1.8 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GIFFManager.h,v 1.9 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GIFFMANAGER_H
     
    9597    Andrei Erofeev <eaf@geocities.com> -- Initial implementation.
    9698    @version
    97     #$Id: GIFFManager.h,v 1.8 2003/11/07 22:08:21 leonb Exp $# */
     99    #$Id: GIFFManager.h,v 1.9 2007/03/25 20:48:31 leonb Exp $# */
    98100
    99101/** #GIFFChunk# is the base class for other IFF chunks understood by
  • trunk/libdjvu/GMapAreas.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GMapAreas.cpp,v 1.9 2004/05/05 15:12:42 leonb Exp $
    55 // $Name: $
     56// $Id: GMapAreas.cpp,v 1.10 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/GMapAreas.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GMapAreas.h,v 1.8 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GMapAreas.h,v 1.9 2007/03/25 20:48:31 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GMAPAREAS_H
     
    98100    @author Andrei Erofeev <eaf@geocities.com>
    99101    @version
    100     #$Id: GMapAreas.h,v 1.8 2003/11/07 22:08:21 leonb Exp $# */
     102    #$Id: GMapAreas.h,v 1.9 2007/03/25 20:48:31 leonb Exp $# */
    101103//@{
    102104
  • trunk/libdjvu/GOS.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GOS.cpp,v 1.13 2005/12/23 15:14:16 leonb Exp $
    55 // $Name: $
     56// $Id: GOS.cpp,v 1.14 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/GOS.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GOS.h,v 1.8 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GOS.h,v 1.9 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GOS_H_
     
    8183    L\'eon Bottou <leonb@research.att.com> -- Initial implementation
    8284    @version
    83     #$Id: GOS.h,v 1.8 2003/11/07 22:08:21 leonb Exp $#
     85    #$Id: GOS.h,v 1.9 2007/03/25 20:48:32 leonb Exp $#
    8486*/
    8587//@{
  • trunk/libdjvu/GPixmap.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GPixmap.cpp,v 1.13 2005/12/24 12:45:01 leonb Exp $
    55 // $Name: $
     56// $Id: GPixmap.cpp,v 1.16 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    464466{
    465467  // Read header
    466   int raw = 0;
    467   char magic[2];
    468   magic[0] = magic[1] = 0;
    469   bs.readall((void*)magic, sizeof(magic));
    470   if (magic[0]=='P' && magic[1]=='3')
    471   {
    472     raw = 0;
    473   }else if (magic[0]=='P' && magic[1]=='6')
    474   {
    475     raw = 1;
    476   }else
    477   {
     468  bool raw = false;
     469  bool grey = false;
     470  int magic = bs.read16();
     471  switch (magic)
     472    {
     473    case ('P'<<8)+'2':
     474      grey = true;
     475      break;
     476    case ('P'<<8)+'3':
     477      break;
     478    case ('P'<<8)+'5':
     479      raw = grey = true;
     480    case ('P'<<8)+'6':
     481      raw = true;
     482      break;
     483    default:
    478484#ifdef NEED_JPEG_DECODER
    479     bs.seek(0L);
    480     JPEGDecoder::decode(bs,*this);
    481     return;
    482 #else // NEED_JPEG_DECODER
    483  
    484     G_THROW( ERR_MSG("GPixmap.unk_PPM") );
    485 #endif // NEED_JPEG_DECODER
    486   }
     485      bs.seek(0L);
     486      JPEGDecoder::decode(bs,*this);
     487      return;
     488#else
     489     
     490      G_THROW( ERR_MSG("GPixmap.unk_PPM") );
     491#endif
     492    }
    487493  // Read image size
    488494  char lookahead = '\n';
     495  int bytesperrow = 0;
     496  int bytespercomp = 1;
    489497  int acolumns = read_integer(lookahead, bs);
    490498  int arows = read_integer(lookahead, bs);
    491499  int maxval = read_integer(lookahead, bs);
     500  if (maxval > 65535)
     501    G_THROW("Cannot read PPM with depth greater than 48 bits.");
    492502  if (maxval > 255)
    493     G_THROW("Cannot read PPM with depth greater than 24 bits.");
     503    bytespercomp = 2;
    494504  init(arows, acolumns, 0);
     505  // Prepare ramp
     506  GTArray<unsigned char> ramp;
     507  int maxbin = 1 << (8 * bytespercomp);
     508  ramp.resize(0, maxbin-1);
     509  for (int i=0; i<maxbin; i++)
     510    ramp[i] = (i<maxval ? (255*i + maxval/2) / maxval : 255);
     511  unsigned char *bramp = ramp;
    495512  // Read image data
    496   if (raw)
    497   {
    498     GTArray<unsigned char> line(ncolumns*3);
    499     for (int y=nrows-1; y>=0; y--)
    500       {
    501         GPixel *p = (*this)[y];
    502         unsigned char *rgb = &line[0];
    503         if ( bs.readall((void*)rgb, ncolumns*3) < (size_t)(ncolumns*3))
    504           G_THROW( ByteStream::EndOfFile );
    505         for (int x=0; x<ncolumns; x+=1, rgb+=3)
    506           {
    507             p[x].r = rgb[0];
    508             p[x].g = rgb[1];
    509             p[x].b = rgb[2];
    510           }
    511       }
    512   }
     513  if (raw && grey)
     514    {
     515      bytesperrow = ncolumns * bytespercomp;
     516      GTArray<unsigned char> line(bytesperrow);
     517      for (int y=nrows-1; y>=0; y--)
     518        {
     519          GPixel *p = (*this)[y];
     520          unsigned char *g = &line[0];
     521          if ( bs.readall((void*)g, bytesperrow) < (size_t)bytesperrow)
     522            G_THROW( ByteStream::EndOfFile );
     523          if (bytespercomp <= 1)
     524            {
     525              for (int x=0; x<ncolumns; x+=1, g+=1)
     526                p[x].r = p[x].g = p[x].b = bramp[g[0]];
     527            }
     528          else
     529            {
     530              for (int x=0; x<ncolumns; x+=1, g+=2)
     531                p[x].r = p[x].g = p[x].b = bramp[g[0]*256+g[1]];
     532            }
     533        }
     534    }
     535  else if (raw)
     536    {
     537      bytesperrow = ncolumns * bytespercomp * 3;
     538      GTArray<unsigned char> line(bytesperrow);
     539      for (int y=nrows-1; y>=0; y--)
     540        {
     541          GPixel *p = (*this)[y];
     542          unsigned char *rgb = &line[0];
     543          if ( bs.readall((void*)rgb, bytesperrow) < (size_t)bytesperrow)
     544            G_THROW( ByteStream::EndOfFile );
     545          if (bytespercomp <= 1)
     546            {
     547              for (int x=0; x<ncolumns; x+=1, rgb+=3)
     548                {
     549                  p[x].r = bramp[rgb[0]];
     550                  p[x].g = bramp[rgb[1]];
     551                  p[x].b = bramp[rgb[2]];
     552                }
     553            }
     554          else
     555            for (int x=0; x<ncolumns; x+=1, rgb+=6)
     556              {
     557                p[x].r = bramp[rgb[0]*256+rgb[1]];
     558                p[x].g = bramp[rgb[2]*256+rgb[3]];
     559                p[x].b = bramp[rgb[4]*256+rgb[5]];
     560              }
     561        }
     562    }
    513563  else
    514   {
    515     for (int y=nrows-1; y>=0; y--)
    516     {
    517       GPixel *p = (*this)[y];
    518       for (int x=0; x<ncolumns; x++)
    519       {
    520         p[x].r = read_integer(lookahead, bs);
    521         p[x].g = read_integer(lookahead, bs);
    522         p[x].b = read_integer(lookahead, bs);
    523       }
    524     }
    525   }
    526   // Process small values of maxval
    527   if (maxval>0 && maxval<255)
    528   {
    529     char table[256];
    530     for (int i=0; i<256; i++)
    531       table[i] = (i<maxval ? (255*i + maxval/2) / maxval : 255);
    532     for (int y=0; y<nrows; y++)
    533     {
    534       GPixel *p = (*this)[y];
    535       for (int x=0; x<ncolumns; x++)
    536       {
    537         p[x].r = table[p[x].r];
    538         p[x].g = table[p[x].g];
    539         p[x].b = table[p[x].b];
    540       }
    541     }
    542   }
     564    {
     565      for (int y=nrows-1; y>=0; y--)
     566        {
     567          GPixel *p = (*this)[y];
     568          for (int x=0; x<ncolumns; x++)
     569            if (grey)
     570              {
     571                p[x].g = p[x].b = p[x].r = ramp[read_integer(lookahead, bs)];
     572              }
     573            else
     574              {
     575                p[x].r = ramp[read_integer(lookahead, bs)];
     576                p[x].g = ramp[read_integer(lookahead, bs)];
     577                p[x].b = ramp[read_integer(lookahead, bs)];
     578              }
     579        }
     580    }
    543581}
    544582
  • trunk/libdjvu/GPixmap.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GPixmap.h,v 1.8 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GPixmap.h,v 1.9 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GPIXMAP_H_
     
    8082    L\'eon Bottou <leonb@research.att.com>
    8183    @version
    82     #$Id: GPixmap.h,v 1.8 2003/11/07 22:08:21 leonb Exp $# */
     84    #$Id: GPixmap.h,v 1.9 2007/03/25 20:48:32 leonb Exp $# */
    8385//@{
    8486
  • trunk/libdjvu/GRect.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GRect.cpp,v 1.11 2006/02/21 16:10:29 docbill Exp $
    55 // $Name: $
     56// $Id: GRect.cpp,v 1.12 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/GRect.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GRect.h,v 1.11 2006/02/21 16:10:29 docbill Exp $
    55 // $Name: $
     56// $Id: GRect.h,v 1.12 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GRECT_H_
     
    7678    L\'eon Bottou <leonb@research.att.com> -- initial implementation.
    7779    @version
    78     #$Id: GRect.h,v 1.11 2006/02/21 16:10:29 docbill Exp $# */
     80    #$Id: GRect.h,v 1.12 2007/03/25 20:48:32 leonb Exp $# */
    7981//@{
    8082
  • trunk/libdjvu/GScaler.cpp

    r15 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GScaler.cpp,v 1.11 2004/06/03 14:15:18 leonb Exp $
     56// $Id: GScaler.cpp,v 1.15 2007/03/25 20:48:32 leonb Exp $
    5557
    5658#ifdef HAVE_CONFIG_H
     
    465467        // Prepare for side effects
    466468        lbuffer[0]   = lbuffer[1];
    467         lbuffer[bufw] = lbuffer[bufw];
     469        lbuffer[bufw+1] = lbuffer[bufw];
    468470        unsigned char *line = lbuffer+1-required_red.xmin;
    469471        unsigned char *dest  = output[y-desired_output.ymin];
     
    498500
    499501GPixmapScaler::GPixmapScaler()
    500   : glbuffer((void *&)lbuffer,0,sizeof(GPixel)),
    501     gp1((void *&)p1,0,sizeof(GPixel)),
    502     gp2((void *&)p2,0,sizeof(GPixel))
     502  : glbuffer(lbuffer,0),
     503    gp1(p1,0),
     504    gp2(p2,0)
    503505{
    504506}
     
    506508
    507509GPixmapScaler::GPixmapScaler(int inw, int inh, int outw, int outh)
    508   : glbuffer((void *&)lbuffer,0,sizeof(GPixel)),
    509     gp1((void *&)p1,0,sizeof(GPixel)),
    510     gp2((void *&)p2,0,sizeof(GPixel))
     510  : glbuffer(lbuffer,0),
     511    gp1(p1,0),
     512    gp2(p2,0)
    511513{
    512514  set_input_size(inw, inh);
     
    613615    output.init(desired_output.height(), desired_output.width());
    614616  // Prepare temp stuff
    615   gp1.resize(0,sizeof(GPixel));
    616   gp2.resize(0,sizeof(GPixel));
    617   glbuffer.resize(0,sizeof(GPixel));
     617  gp1.resize(0);
     618  gp2.resize(0);
     619  glbuffer.resize(0);
    618620  prepare_interp();
    619621  const int bufw = required_red.width();
    620   glbuffer.resize(bufw+2,sizeof(GPixel));
     622  glbuffer.resize(bufw+2);
    621623  if (xshift>0 || yshift>0)
    622624    {
    623       gp1.resize(bufw,sizeof(GPixel));
    624       gp2.resize(bufw,sizeof(GPixel));
     625      gp1.resize(bufw);
     626      gp2.resize(bufw);
    625627      l1 = l2 = -1;
    626628    }
     
    669671        // Prepare for side effects
    670672        lbuffer[0]   = lbuffer[1];
    671         lbuffer[bufw] = lbuffer[bufw];
     673        lbuffer[bufw+1] = lbuffer[bufw];
    672674        GPixel *line = lbuffer+1-required_red.xmin;
    673675        GPixel *dest  = output[y-desired_output.ymin];
     
    691693    }
    692694  // Free temporaries
    693   gp1.resize(0,sizeof(GPixel));
    694   gp2.resize(0,sizeof(GPixel));
    695   glbuffer.resize(0,sizeof(GPixel));
     695  gp1.resize(0);
     696  gp2.resize(0);
     697  glbuffer.resize(0);
    696698}
    697699
  • trunk/libdjvu/GScaler.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GScaler.h,v 1.9 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GScaler.h,v 1.11 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GSCALER_H_
     
    99101    L\'eon Bottou <leonb@research.att.com>
    100102    @version
    101     #$Id: GScaler.h,v 1.9 2003/11/07 22:08:21 leonb Exp $# */
     103    #$Id: GScaler.h,v 1.11 2007/03/25 20:48:32 leonb Exp $# */
    102104//@{
    103105
     
    293295  // Temporaries
    294296  GPixel *lbuffer;
    295   GPBufferBase glbuffer;
     297  GPBuffer<GPixel> glbuffer;
    296298  GPixel *p1;
    297   GPBufferBase gp1;
     299  GPBuffer<GPixel> gp1;
    298300  GPixel *p2;
    299   GPBufferBase gp2;
     301  GPBuffer<GPixel> gp2;
    300302  int    l1;
    301303  int    l2;
  • trunk/libdjvu/GSmartPointer.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GSmartPointer.cpp,v 1.11 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GSmartPointer.cpp,v 1.12 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
  • trunk/libdjvu/GSmartPointer.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GSmartPointer.h,v 1.11 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GSmartPointer.h,v 1.13 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GSMARTPOINTER_H_
     
    8789
    8890    @version
    89     #$Id: GSmartPointer.h,v 1.11 2003/11/07 22:08:21 leonb Exp $#
     91    #$Id: GSmartPointer.h,v 1.13 2007/03/25 20:48:32 leonb Exp $#
    9092    @args
    9193*/
     
    108110
    109111
    110 
    111 /* What is this innovation ?
    112    What does it do that a GArray does not do ? */
    113 
    114 class GPBufferBase
    115 {
    116 public:
    117   GPBufferBase(void *&,const size_t n,const size_t t);
    118   void swap(GPBufferBase &p);
    119   void resize(const size_t n,const size_t t);
    120   void replace(void *nptr,const size_t n);
    121   void set(const size_t t,const char c);
    122   ~GPBufferBase();
    123   operator int(void) const { return ptr ? num : 0; }
    124 private:
    125   void *&ptr;
    126   size_t num;
    127 };
    128 
    129 template<class TYPE>
    130 class GPBuffer : public GPBufferBase
    131 {
    132 public:
    133   GPBuffer(TYPE *&xptr,const size_t n=0) : GPBufferBase((void *&)xptr,n,sizeof(TYPE)) {}
    134   inline void resize(const size_t n) {GPBufferBase::resize(n,sizeof(TYPE));}
    135   inline void clear(void) {GPBufferBase::set(sizeof(TYPE),0);}
    136   inline void set(const char c) {GPBufferBase::set(sizeof(TYPE),c);}
    137   inline operator int(void) const {return GPBufferBase::operator int();}
    138 };
    139112
    140113/** Base class for reference counted objects. 
     
    480453}
    481454
     455/* GPBUFFER */
     456
     457/* What is this LT innovation ?
     458   What does it do that a GArray does not do ?
     459   What about the objects construction and destruction ? */
     460
     461class GPBufferBase
     462{
     463public:
     464  GPBufferBase(void *&,const size_t n,const size_t t);
     465  void swap(GPBufferBase &p);
     466  void resize(const size_t n,const size_t t);
     467  void replace(void *nptr,const size_t n);
     468  void set(const size_t t,const char c);
     469  ~GPBufferBase();
     470  operator int(void) const { return ptr ? num : 0; }
     471private:
     472  void *&ptr;
     473  size_t num;
     474};
     475
     476template<class TYPE>
     477class GPBuffer : public GPBufferBase
     478{
     479public:
     480  GPBuffer(TYPE *&xptr,const size_t n=0) : GPBufferBase((void *&)xptr,n,sizeof(TYPE)) {}
     481  inline void resize(const size_t n) {GPBufferBase::resize(n,sizeof(TYPE));}
     482  inline void clear(void) {GPBufferBase::set(sizeof(TYPE),0);}
     483  inline void set(const char c) {GPBufferBase::set(sizeof(TYPE),c);}
     484  inline operator int(void) const {return GPBufferBase::operator int();}
     485};
     486
     487
    482488
    483489#ifdef HAVE_NAMESPACES
  • trunk/libdjvu/GString.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GString.cpp,v 1.23 2005/12/23 15:14:16 leonb Exp $
    55 // $Name: $
     56// $Id: GString.cpp,v 1.24 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759// From: Leon Bottou, 1/31/2002
  • trunk/libdjvu/GString.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GString.h,v 1.20 2005/07/22 15:28:07 leonb Exp $
    55 // $Name: $
     56// $Id: GString.h,v 1.21 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GSTRING_H_
     
    104106   
    105107    @version
    106     #$Id: GString.h,v 1.20 2005/07/22 15:28:07 leonb Exp $# */
     108    #$Id: GString.h,v 1.21 2007/03/25 20:48:32 leonb Exp $# */
    107109//@{
    108110
  • trunk/libdjvu/GThreads.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GThreads.cpp,v 1.17 2006/02/21 17:27:34 leonb Exp $
    55 // $Name: $
     56// $Id: GThreads.cpp,v 1.19 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    382384
    383385// ----------------------------------------
    384 // MACTHREADS IMPLEMENTATION (from Praveen)
     386// MACTHREADS IMPLEMENTATION (obsolete)
    385387// ----------------------------------------
    386388
     
    623625  // Timeouts are not used for anything important.
    624626  // Just ignore the timeout and wait the regular way.
    625   wait();
     627  if (timeout > 0)
     628    wait();
    626629}
    627630
  • trunk/libdjvu/GThreads.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GThreads.h,v 1.10 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GThreads.h,v 1.11 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GTHREADS_H_
     
    6365# pragma interface
    6466#endif
     67
    6568
    6669/** @name GThreads.h
     
    127130
    128131    @version
    129     #$Id: GThreads.h,v 1.10 2003/11/07 22:08:21 leonb Exp $# */
     132    #$Id: GThreads.h,v 1.11 2007/03/25 20:48:32 leonb Exp $# */
    130133//@{
    131134
  • trunk/libdjvu/GURL.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GURL.cpp,v 1.21 2005/12/24 12:45:01 leonb Exp $
    55 // $Name: $
     56// $Id: GURL.cpp,v 1.24 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    160162#endif
    161163
     164#ifdef OS2
     165#define _tcsrchr strrchr
     166#endif
    162167
    163168#ifdef HAVE_NAMESPACES
     
    830835   const char * ptrurl = url;
    831836   for(const char *ptr = ptrurl; *ptr; ptr++)
    832       if (*ptr=='?')
    833       {
     837     if (*ptr=='?')
     838       {
    834839         url.setat(ptr-ptrurl, 0);
    835840         break;
    836       }
     841       }
    837842}
    838843
     
    930935   const GUTF8String xurl(get_string());
    931936   const int protocol_length=protocol(xurl).length();
    932    const int xurl_length=xurl.length();
    933937   const char * const url_ptr=xurl;
    934938   const char * ptr, * xslash;
     
    946950     if(xslash[0] != '/')
    947951     {
    948        xslash=url_ptr+xurl_length;
     952       xslash=ptr;
    949953     }
    950954   }
    951    return GURL::UTF8(
    952 // ifdef WIN32
    953 // (*(xslash-1) == colon)?
    954 //   (GUTF8String(xurl,(int)(xslash-url_ptr))+"/" ):
    955 // endif
    956      (GUTF8String(xurl,(int)(xslash-url_ptr))+"/"));
     955   return GURL::UTF8(GUTF8String(xurl,(int)(xslash-url_ptr))+"/"+ptr);
    957956}
    958957
     
    960959GURL::operator==(const GURL & gurl2) const
    961960{
    962   bool retval=false;
    963961  const GUTF8String g1(get_string());
    964   const int g1_length=g1.length();
    965962  const GUTF8String g2(gurl2.get_string());
    966   const int g2_length=g2.length();
    967   if(g1_length == g2_length) // exactly equal
    968   {
    969         retval=(g1==g2);
    970   }else if(g1_length+1 == g2_length) // g1 is g2 with a slash at the end
    971   {
    972     retval=(g2[g1_length] == '/')&&!g1.cmp(g2,g1_length);
    973   }else if(g2_length+1 == g1_length)  // g2 is g1 with a slash at the end
    974   {
    975     retval=(g1[g2_length] == '/')&&!g1.cmp(g2,g2_length);
    976   }
    977   return retval;
     963  const char *s1 = (const char*)g1;
     964  const char *s2 = (const char*)g2;
     965  int n1=0;
     966  int n2=0;
     967  while (s1[n1] && !is_argument(s1+n1))
     968    n1 += 1;
     969  while (s2[n2] && !is_argument(s2+n2))
     970    n2 += 1;
     971  if (n1 == n2)
     972    return !strcmp(s1+n1,s2+n2) && !strncmp(s1,s2,n1);
     973  if (n1 == n2+1 && s1[n2]=='/')
     974    return !strcmp(s1+n1,s2+n2) && !strncmp(s1,s2,n2);
     975  if (n2 == n1+1 && s2[n1]=='/')
     976    return !strcmp(s1+n1,s2+n2) && !strncmp(s1,s2,n1);   
     977  return false;
    978978}
    979979
     
    12041204{
    12051205  if(GURL::UTF8(xurl).is_valid())
    1206   {
    1207     url=xurl;
    1208   }else
    1209   {
    1210     const char *c=xurl;
    1211     if(c[0] == slash)
    1212     {
    1213       GURL base(codebase);
    1214       for(GURL newbase=base.base();newbase!=base;newbase=base.base())
    1215       {
    1216         base=newbase;
    1217       }
    1218       url=base.get_string(true)+GURL::encode_reserved(xurl);
    1219     }else
    1220     {
    1221       url=beautify_path(codebase.get_string(true)+GUTF8String(slash)+GURL::encode_reserved(xurl));
    1222     }
    1223   }
     1206    {
     1207      url=xurl;
     1208    }
     1209  else
     1210    {
     1211      // split codebase
     1212      const char *buffer = codebase;
     1213      GUTF8String all(buffer);
     1214      GUTF8String suffix;
     1215      GUTF8String path;
     1216      GUTF8String prefix;
     1217      const int protocol_length=GURL::protocol(all).length();
     1218      const char *start = buffer + pathname_start(all,protocol_length);
     1219      if (start > buffer)
     1220        prefix = GUTF8String(buffer, start-buffer);
     1221      const char *ptr = start;
     1222      while (*ptr && !is_argument(ptr))
     1223        ptr++;
     1224      if (*ptr)
     1225        suffix = GUTF8String(ptr);
     1226      if (ptr > start)
     1227        path = GUTF8String(start, ptr-start);
     1228      // append xurl to path
     1229      const char *c = xurl;
     1230      if(c[0] == slash)
     1231        path = GURL::encode_reserved(xurl);
     1232      else
     1233        path = path + GUTF8String(slash)+GURL::encode_reserved(xurl);
     1234      // construct url
     1235      url = beautify_path(prefix + path + suffix);
     1236    }
    12241237}
    12251238
     
    17571770    *s = 0;
    17581771  }
    1759 #elif defined(WIN32) || defined(OS2) // WIN32 implementation
     1772#elif defined(WIN32) || defined(OS2) // WIN32 implementation (ER: and OS/2)
    17601773  // Handle base
    17611774  strcpy(string_buffer, (char const *)(from ? expand_name(from) : GOS::cwd()));
     
    17951808          drv[2]= dot ;
    17961809          drv[3]=0;
    1797           // todo !!!
    1798           //GetFullPathName(drv, maxlen, string_buffer, &s);
     1810          // !!! ER todo !!! GetFullPathName(drv, maxlen, string_buffer, &s);
    17991811          strcpy(string_buffer,(const char *)GUTF8String(string_buffer).getNative2UTF8());
    18001812          s = string_buffer;
     
    18321844        {
    18331845          fname += 2;
    1834           char *back=NULL;//_tcsrchr(string_buffer,backslash);
    1835           char *forward=NULL;//_tcsrchr(string_buffer,slash);
     1846          char *back=_tcsrchr(string_buffer,backslash);
     1847          char *forward=_tcsrchr(string_buffer,slash);
    18361848          if(back>forward)
    18371849          {
     
    18471859        for(;*s;s++)
    18481860          EMPTY_LOOP;
    1849         char* back = NULL;//_tcsrchr(s2,backslash);//MBCS DBCS
     1861        char* back = _tcsrchr(s2,backslash);//MBCS DBCS
    18501862        if ((s>string_buffer)&&(*(s-1)!= slash)&&
    18511863            (back == NULL || (back!=NULL && s-1 != back) ))//MBCS DBCS
     
    18651877      for(;*s;s++)
    18661878        EMPTY_LOOP;
    1867       char* back = NULL;//_tcsrchr(s2,backslash);//MBCS DBCS
     1879      char* back = _tcsrchr(s2,backslash);//MBCS DBCS
    18681880      if ((s>string_buffer)&&(*(s-1)!= slash)
    18691881          &&(back == NULL || (back!=NULL && s-1 != back) ))//MBCS DBCS
  • trunk/libdjvu/GURL.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to,