Commit 2ce31813 authored by Wilco Greven's avatar Wilco Greven
Browse files

- Use xpdf 2.00 sources

- Removed t1lib and freetype1 support
- Easier configure tests

svn path=/trunk/kdegraphics/kpdf/; revision=195717
parent 45f362de
Xpdf
====
version 1.01
2002-may-20
version 2.00
2002-nov-04
The Xpdf software and documentation are
copyright 1996-2002 Glyph & Cog, LLC.
......@@ -140,8 +140,8 @@ pages (xpdf.1, etc.) and the VMS help files (xpdf.hlp, etc.).
Upgrading from Xpdf 0.9x
------------------------
WARNING: Xpdf 1.x uses a completely different config file setup than
Xpdf 0.9x.
WARNING: Xpdf 1.x switched to a completely different config file setup
than Xpdf 0.9x.
Many of the configuration options that used to be X resources have
been moved into the Xpdf config file. There are also lots of new and
......@@ -175,8 +175,8 @@ executable, e.g.:
C:/Program Files/Xpdf/xpdfrc
Xpdf 1.x comes with a "sample-xpdfrc" file in the doc directory. This
is a good starting point for constructing your own config file.
Xpdf comes with a "sample-xpdfrc" file in the doc directory. This is
a good starting point for constructing your own config file.
For full details, please see the xpdfrc(5) man page.
......@@ -221,35 +221,6 @@ You will need to replace '/usr/local/share/ghostscript/fonts' with the
appropriate path on your system.
The Unisys LZW Patent
---------------------
Nearly all PDF files include data which has been compressed with the
LZW compression algorithm. Unfortunately, LZW is covered by a
software patent which is owned by Unisys Corporation. Unisys refuses
to license this patent for PDF-related use in software such as Xpdf
which is released for free and which may be freely redistributed.
(This is same algorithm which is used by GIF. However, Unisys is not
doing licensing for free PDF viewers in the same way as for free GIF
viewers.)
As a workaround, Xpdf converts PDF-format LZW data to compress-format
LZW data. (The standard UNIX compress utility also uses LZW, but with
a slightly different file format.) This conversion does *not*
decompress the data; it simply converts it to a different file format.
Xpdf then calls uncompress to actually decompress the data.
I have been told by several notable people that the LZW patent covers
compression only, and does not cover decompression. This seems pretty
fuzzy to me, so I'm going to stick with my workaround, at least for
now.
For Unisys's slant on things (mostly regarding GIF), see
<http://www.unisys.com/LeadStory/lzwterms.html> and
<http://www.unisys.com/LeadStory/lzwfaq.html>. These pages mention
an email address for feedback.
Compiling Xpdf
--------------
......@@ -336,10 +307,10 @@ CID-Keyed Fonts_, Adobe Developer Support Technical Note #5078.
http://partners.adobe.com/asn/developer/PDFS/TN/5078.CID_Glyph.pdf
[The Adobe Japanese character set.]
Adobe Systems, Inc., _Adobe-GB1-3 Character Collection for
Adobe Systems, Inc., _Adobe-GB1-4 Character Collection for
CID-Keyed Fonts_, Adobe Developer Support Technical Note #5079.
1998.
http://partners.adobe.com/asn/developer/PDFS/TN/5079.GB_CharColl.pdf
2000.
http://partners.adobe.com/asn/developer/pdfs/tn/5079.Adobe-GB1-4.pdf
[The Adobe Chinese GB (simplified) character set.]
Adobe Systems, Inc., _Adobe-CNS1-3 Character Collection for
......@@ -380,12 +351,11 @@ T. Boutell, et al., "PNG (Portable Network Graphics) Specification,
Version 1.0. RFC 2083.
[PDF uses the PNG filter algorithms.]
CCITT, _Blue Book_, Volume VII Fascicle 3: "Terminal Equipment and
Protocols for Telematic Services", Recommendations T.4 and T.6.
ftp://ftp.uu.net/doc/standards/ccitt/1988/7_3_01.ps
ftp://ftp.uu.net/doc/standards/ccitt/1988/7_3_02.ps
[The official Group 3 and 4 fax standards. The online copies are
unfortunately misformatted.]
CCITT, "Information Technology - Digital Compression and Coding of
Continuous-tone Still Images - Requirements and Guidelines", CCITT
Recommendation T.81.
http://www.w3.org/Graphics/JPEG/
[The official JPEG spec.]
A. Chernov, "Registration of a Cyrillic Character Set". RFC 1489.
[Documentation for the KOI8-R Cyrillic encoding.]
......@@ -417,6 +387,18 @@ Robert L. Hummel, _Programmer's Technical Reference: Data and Fax
Communications_. Ziff-Davis Press, 1993, ISBN 1-56276-077-7.
[CCITT Group 3 and 4 fax decoding.]
ISO, _Coding of Still Pictures_, IS 14492 Final Committee Draft.
http://www.jpeg.org/fcd14492.pdf
[The final draft of the JBIG2 spec.]
ITU, "Standardization of Group 3 facsimile terminals for document
transmission", ITU-T Recommendation T.4, 1999.
ITU, "Facsimile coding schemes and coding control functions for Group 4
facsimile apparatus", ITU-T Recommendation T.6, 1993.
http://www.itu.int/
[The official Group 3 and 4 fax standards - used by the CCITTFaxDecode
stream, as well as the JBIG2Decode stream.]
Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, "Practical
Fast 1-D DCT Algorithms with 11 Multiplications". IEEE Intl. Conf. on
Acoustics, Speech & Signal Processing, 1989, 988-991.
......
# -*- Mode : makefile -*-
#
# SUMMARY:
# USAGE: make <make-target>
#
# AUTHOR: Christophe Prud'homme
# ORG:
# E-MAIL: prudhomm@mit.edu
#
# ORIG-DATE: 31-Aug-02 at 06:16:23
# LAST-MOD: 31-Aug-02 at 08:10:28 by Christophe Prud'homme
#
# RCS Infos:
# ==========
# Author: $Author$
# Id: $Id$
# Revision: $Revision$
# Date: $Date$
# locker: $Locker: $
#
#
# DESCRIPTION:
# ============
# Distributed under the GPL(GNU Public License):
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# DESCRIP-END.
#
# <<< smr.m4 from smr_macros 0.2.4 >>>
dnl ####################### -*- Mode: M4 -*- ###########################
dnl smr.m4 --
dnl
dnl Copyright (C) 1999 Matthew D. Langston <langston@SLAC.Stanford.EDU>
dnl Copyright (C) 1998 Steve Robbins <stever@cs.mcgill.ca>
dnl
dnl This file is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This file is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this file; if not, write to:
dnl
dnl Free Software Foundation, Inc.
dnl Suite 330
dnl 59 Temple Place
dnl Boston, MA 02111-1307, USA.
dnl ####################################################################
dnl NOTE: The macros in this file are extensively documented in the
dnl accompanying `smr_macros.texi' Texinfo file. Please see the
dnl Texinfo documentation for the definitive specification of how
dnl these macros are supposed to work. If the macros work
dnl differently than the Texinfo documentation says they should,
dnl then the macros (and not the Texinfo documentation) has the
dnl bug(s).
dnl This is a convenient macro which translates illegal characters for
dnl bourne shell variables into legal characters. It has the same
dnl functionality as sed 'y%./+-:%__p__%'.
AC_DEFUN([smr_safe_translation], [patsubst(patsubst([$1], [+], [p]), [./-:], [_])])
AC_DEFUN(smr_SWITCH,
[
dnl Define convenient aliases for the arguments since there are so
dnl many of them and I keep confusing myself whenever I have to edit
dnl this macro.
pushdef([smr_name], $1)
pushdef([smr_help_string], $2)
pushdef([smr_default], $3)
pushdef([smr_yes_define], $4)
pushdef([smr_no_define], $5)
dnl Do some sanity checking of the arguments.
ifelse([regexp(smr_default, [^\(yes\|no\)$])], -1, [AC_MSG_ERROR($0: third arg must be either yes or no)])
dnl Create the help string
pushdef([smr_lhs], [--ifelse(smr_default, yes, disable, enable)-smr_name])dnl
pushdef([smr_rhs], [ifelse(smr_default, yes, disable, enable) smr_help_string (default is smr_default)])dnl
dnl Add the option to `configure --help'. We don't need to supply the
dnl 4th argument to AC_ARG_ENABLE (i.e. the code to set the default
dnl value) because that is done below by AC_CACHE_CHECK.
AC_ARG_ENABLE([smr_name],
AC_HELP_STRING([smr_lhs], [smr_rhs]),
smr_cv_enable_[]smr_name=$enableval)
dnl We cache the result so that the user doesn't have to remember
dnl which flags they passed to `configure'.
AC_CACHE_CHECK([whether to enable smr_help_string],
smr_cv_enable_[]smr_name,
smr_cv_enable_[]smr_name=smr_default)
ifelse(smr_yes_define, , , test x"[$]smr_cv_enable_[]smr_name" = xyes && AC_DEFINE_UNQUOTED(smr_yes_define,1,[]))
ifelse(smr_no_define, , , test x"[$]smr_cv_enable_[]smr_name" = xno && AC_DEFINE_UNQUOTED(smr_no_define,1,[]))
dnl Sanity check the value assigned to smr_cv_enable_$1 to force it to
dnl be either `yes' or `no'.
if test ! x"[$]smr_cv_enable_[]smr_name" = xyes; then
if test ! x"[$]smr_cv_enable_[]smr_name" = xno; then
AC_MSG_ERROR([smr_lhs must be either yes or no])
fi
fi
popdef([smr_name])
popdef([smr_help_string])
popdef([smr_default])
popdef([smr_yes_define])
popdef([smr_no_define])
popdef([smr_lhs])
popdef([smr_rhs])
])
AC_DEFUN(smr_ARG_WITHLIB,
[
dnl Define convenient aliases for the arguments since there are so
dnl many of them and I keep confusing myself whenever I have to edit
dnl this macro.
pushdef([smr_name], $1)
pushdef([smr_libname], ifelse($2, , smr_name, $2))
pushdef([smr_help_string], $3)
pushdef([smr_safe_name], smr_safe_translation(smr_name))
dnl Add the option to `configure --help'. We don't need to supply the
dnl 4th argument to AC_ARG_WITH (i.e. the code to set the default
dnl value) because that is done below by AC_CACHE_CHECK.
AC_ARG_WITH(smr_safe_name-library,
AC_HELP_STRING([--with-smr_safe_name-library[[=PATH]]],
[use smr_name library ifelse(smr_help_string, , , (smr_help_string))]),
smr_cv_with_[]smr_safe_name[]_library=$withval)
dnl We cache the result so that the user doesn't have to remember
dnl which flags they passed to `configure'.
AC_CACHE_CHECK([whether to use smr_name library],
smr_cv_with_[]smr_safe_name[]_library,
smr_cv_with_[]smr_safe_name[]_library=maybe)
case x"[$]smr_cv_with_[]smr_safe_name[]_library" in
xyes | xmaybe)
smr_safe_name[]_LIBS="-l[]smr_libname"
with_[]smr_safe_name=[$]smr_cv_with_[]smr_safe_name[]_library
;;
xno)
smr_safe_name[]_LIBS=
with_[]smr_safe_name=no
;;
*)
if test -f "[$]smr_cv_with_[]smr_safe_name[]_library"; then
smr_safe_name[]_LIBS=[$]smr_cv_with_[]smr_safe_name[]_library
elif test -d "[$]smr_cv_with_[]smr_safe_name[]_library"; then
smr_safe_name[]_LIBS="-L[$]smr_cv_with_[]smr_safe_name[]_library -l[]smr_libname"
else
AC_MSG_ERROR([argument must be boolean, file, or directory])
fi
with_[]smr_safe_name=yes
;;
esac
dnl ##### Check for FreeType 2.0.5+.
dnl ##### (Note: FT_Get_Name_Index was added in FT 2.0.5, and is
dnl ##### the reason that Xpdf requires 2.0.5+.)
popdef([smr_name])
popdef([smr_libname])
popdef([smr_help_string])
popdef([smr_safe_name])
KDE_FIND_PATH(freetype-config, FREETYPE_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
AC_MSG_WARN([Could not find libfreetype anywhere, check http://www.freetype.org/])
])
AC_DEFUN(smr_ARG_WITHINCLUDES,
[
dnl Define convenient aliases for the arguments since there are so
dnl many of them and I keep confusing myself whenever I have to edit
dnl this macro.
pushdef([smr_name], $1)
pushdef([smr_header], $2)
pushdef([smr_header_config], $3)
pushdef([smr_extra_flags], $4)
pushdef([smr_safe_name], smr_safe_translation(smr_name))
dnl Add the option to `configure --help'. We don't need to supply the
dnl 4th argument to AC_ARG_WITH (i.e. the code to set the default
dnl value) because that is done below by AC_CACHE_CHECK.
AC_ARG_WITH(smr_safe_name-includes,
AC_HELP_STRING([--with-smr_safe_name-includes[[=DIR]]],
[set directory for smr_name headers]),
smr_cv_with_[]smr_safe_name[]_includes=$withval)
dnl We cache the result so that the user doesn't have to remember
dnl which flags they passed to `configure'.
AC_CACHE_CHECK([where to find the smr_name header files],
smr_cv_with_[]smr_safe_name[]_includes,
smr_cv_with_[]smr_safe_name[]_includes=)
if test ! x"[$]smr_cv_with_[]smr_safe_name[]_includes" = x; then
if test -d "[$]smr_cv_with_[]smr_safe_name[]_includes"; then
smr_safe_name[]_CFLAGS="-I[$]smr_cv_with_[]smr_safe_name[]_includes"
else
AC_MSG_ERROR([argument must be a directory])
fi
else
smr_safe_name[]_CFLAGS=
fi
dnl This bit of logic comes from the autoconf AC_PROG_CC macro. We
dnl need to put the given include directory into CPPFLAGS temporarily,
dnl but then restore CPPFLAGS to its old value.
smr_test_CPPFLAGS="${CPPFLAGS+set}"
smr_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS [$]smr_safe_name[]_CFLAGS smr_extra_flags"
dnl If the header file smr_header exists, then define
dnl HAVE_[]smr_header (in all capitals).
AC_CHECK_HEADERS([smr_header],
[smr_have_[]smr_safe_name[]_header=yes],
smr_have_[]smr_safe_name[]_header=no)
if test x"$smr_test_CPPFLAGS" = xset; then
CPPFLAGS=$smr_save_CPPFLAGS
if test -n "$FREETYPE_CONFIG"; then
vers=`$FREETYPE_CONFIG --version 2>/dev/null | sed -e 's/libfreetype //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test -n "$vers" && test "$vers" -ge 9000000; then
LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
LIBFREETYPE_RPATH=
for args in $LIBFREETYPE_LIBS; do
case $args in
-L*) LIBFREETYPE_RPATH="$LIBFREETYPE_RPATH $args" ;;
esac
done
LIBFREETYPE_RPATH=`echo $LIBFREETYPE_RPATH | sed -e "s/-L/-R/g"`
LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
else
unset CPPFLAGS
fi
popdef([smr_name])
popdef([smr_header])
popdef([smr_header_config])
popdef([smr_extra_flags])
popdef([smr_safe_name])
])
AC_DEFUN(smr_CHECK_LIB,
[
dnl Define convenient aliases for the arguments since there are so
dnl many of them and I keep confusing myself whenever I have to edit
dnl this macro.
pushdef([smr_name], $1)
pushdef([smr_libname], ifelse($2, , smr_name, $2))
pushdef([smr_help_string], $3)
pushdef([smr_function], $4)
pushdef([smr_header], $5)
pushdef([smr_header_config], $6)
pushdef([smr_extra_libs], $7)
pushdef([smr_extra_flags], $8)
pushdef([smr_prototype], $9)
pushdef([smr_safe_name], smr_safe_translation(smr_name))
dnl Give the user (via "configure --help") an interface to specify
dnl whether we should use the library or not, and possibly where we
dnl should find it.
smr_ARG_WITHLIB([smr_name], [smr_libname], [smr_help_string])
if test ! x"$with_[]smr_safe_name" = xno; then
# If we got this far, then the user didn't explicitly ask not to use
# the library.
dnl If the caller of smr_CHECK_LIB specified a header file for this
dnl library, then give the user (via "configure --help") an
dnl interface to specify where this header file can be found (if it
dnl isn't found by the compiler by default).
ifelse(smr_header, , , [smr_ARG_WITHINCLUDES(smr_name, smr_header, smr_header_config, smr_extra_flags)])
# We need only look for the library if the header has been found
# (or no header is needed).
if test [$]smr_have_[]smr_safe_name[]_header != no; then
AC_CHECK_LIB(smr_libname,
smr_function,
smr_have_[]smr_safe_name[]_library=yes,
smr_have_[]smr_safe_name[]_library=no,
[$]smr_safe_name[]_CFLAGS [smr_extra_flags] [$]smr_safe_name[]_LIBS [smr_extra_libs],
[ifelse(smr_prototype, , , [[#]include <smr_header>])],
smr_prototype)
fi
if test x"[$]smr_have_[]smr_safe_name[]_library" = xyes; then
AC_MSG_RESULT([using smr_name library])
else
smr_safe_name[]_LIBS=
smr_safe_name[]_CFLAGS=
if test x"$with_[]smr_safe_name" = xmaybe; then
AC_MSG_RESULT([not using smr_name library])
else
AC_MSG_WARN([requested smr_name library not found!])
fi
fi
AC_MSG_WARN([You need at least libfreetype 2.0.5])
fi
popdef([smr_name])
popdef([smr_libname])
popdef([smr_help_string])
popdef([smr_function])
popdef([smr_header])
popdef([smr_header_config])
popdef([smr_extra_libs])
popdef([smr_extra_flags])
popdef([smr_prototype])
popdef([smr_safe_name])
])
dnl ##### Check for t1lib.
smr_CHECK_LIB(t1, t1, [Type 1 font rasterizer],
T1_InitLib, t1lib.h, HAVE_T1LIB_H,
$X_LIBS $X_PRE_LIBS $X_LDFLAGS -lX11 $X_EXTRA_LIBS -lm, $X_CFLAGS)
if test x"$smr_have_t1_header"=x"yes"; then
AC_DEFINE_UNQUOTED( HAVE_T1LIB_H, 1, [define if T1LIB headers are present] )
fi
AC_SUBST(t1_LIBS)
AC_SUBST(t1_CFLAGS)
dnl ##### Check for FreeType.
dnl ##### Look for FreeType 2.0.5+ first, and then FreeType 1.x.
dnl ##### (Note: FT_Get_Name_Index was added in FT 2.0.5, and is
dnl ##### the reason that Xpdf requires 2.0.5+.)
smr_CHECK_LIB(freetype2, freetype, [FreeType2 font rasterizer - version 2.0.5+],
FT_Get_Name_Index, freetype/freetype.h, HAVE_FREETYPE_H,
$X_LIBS $X_PRE_LIBS $X_LDFLAGS -lX11 $X_EXTRA_LIBS -lm, $X_CFLAGS)
if test x"$freetype2_LIBS" = x; then
smr_CHECK_LIB(freetype2, freetype, [FreeType2 font rasterizer - version 2.0.5+],
FT_Get_Name_Index, freetype.h, HAVE_FREETYPE_H,
$X_LIBS $X_PRE_LIBS $X_LDFLAGS -lX11 $X_EXTRA_LIBS -lm, $X_CFLAGS)
fi
if test x"$freetype2_LIBS" != x; then
AC_DEFINE_UNQUOTED(FREETYPE2,1,[define if freetype2 is available])
fi
if test x"$smr_have_freetype2_header"=x"yes"; then
AC_DEFINE_UNQUOTED( HAVE_FREETYPE_H, 1, [define if FREETYPE headers are present] )
fi
AC_SUBST(freetype2_LIBS)
AC_SUBST(freetype2_CFLAGS)
if test x"$freetype2_LIBS" = x; then
smr_CHECK_LIB(freetype, ttf, [FreeType font rasterizer],
TT_Init_FreeType, freetype/freetype.h,HAVE_FREETYPE_H,
$X_LIBS $X_PRE_LIBS $X_LDFLAGS -lX11 $X_EXTRA_LIBS -lm, $X_CFLAGS)
if test x"$freetype_LIBS" = x; then
smr_CHECK_LIB(freetype, ttf, [FreeType font rasterizer],
TT_Init_FreeType, freetype.h, HAVE_FREETYPE_H,
$X_LIBS $X_PRE_LIBS $X_LDFLAGS -lX11 $X_EXTRA_LIBS -lm, $X_CFLAGS)
fi
AC_SUBST(freetype_LIBS)
AC_SUBST(freetype_CFLAGS)
fi
AC_SUBST(LIBFREETYPE_LIBS)
AC_SUBST(LIBFREETYPE_CFLAGS)
AC_SUBST(LIBFREETYPE_RPATH)
dnl ##### Check for libpaper (Debian).
smr_CHECK_LIB(libpaper, paper, [Debian libpaper], paperinit, paper.h, HAVE_PAPER_H)
AC_SUBST(libpaper_LIBS)
AC_SUBST(libpaper_CFLAGS)
if test x"$smr_have_paper_header"=x"yes"; then
AC_DEFINE_UNQUOTED( HAVE_PAPER_H, 1, [define if PAPER headers are present] )
fi
LIBPAPER_LIBS=
KDE_CHECK_HEADER(paper.h, [
LIBPAPER_LIBS='-lpaper'
AC_DEFINE_UNQUOTED(HAVE_PAPER_H, 1, [Define to 1 if you have the <paper.h> header file.])
])
AC_SUBST(LIBPAPER_LIBS)
dnl ## AC_DEFINE_UNQUOTED(HAVE_FREETYPE_H,1,[])
dnl ## AC_DEFINE_UNQUOTED(HAVE_T1LIB_H,1,[])
dnl ## AC_DEFINE_UNQUOTED(HAVE_PAPER_H,1,[])
AC_CHECK_FUNCS(fseek64 mkstemp mkstemps popen)
......@@ -6,11 +6,12 @@
//
//========================================================================
#ifdef __GNUC__
#include <aconf.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#include <aconf.h>
#include "gmem.h"
#include "GString.h"
#include "GHash.h"
......
......@@ -9,7 +9,9 @@
#ifndef GHASH_H
#define GHASH_H
#ifdef __GNUC__
#include <aconf.h>
#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif
......
......@@ -6,11 +6,12 @@
//
//========================================================================
#ifdef __GNUC__
#include <aconf.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#include <aconf.h>
#include <string.h>
#include "gmem.h"
#include "GList.h"
......
......@@ -9,7 +9,9 @@
#ifndef GLIST_H
#define GLIST_H
#ifdef __GNUC__
#include <aconf.h>
#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif
......
......@@ -8,11 +8,12 @@
//
//========================================================================
#ifdef __GNUC__
#include <aconf.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#include <aconf.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
......@@ -203,8 +204,12 @@ GString *GString::del(int i, int n) {
int j;
if (n > 0) {
for (j = i; j <= length - n; ++j)
if (i + n > length) {
n = length - i;
}
for (j = i; j <= length - n; ++j) {
s[j] = s[j + n];
}
resize(length -= n);
}
return this;
......
......@@ -11,7 +11,9 @@
#ifndef GSTRING_H
#define GSTRING_H
#ifdef __GNUC__
#include <aconf.h>
#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif
......
......@@ -108,7 +108,7 @@ GString *getCurrentDir() {
return new GString();
}
GString *appendToPath(GString *path, char *fileName) {
GString *appendToPath(GString *path, const char *fileName) {
#if defined(VMS)
//---------- VMS ----------
//~ this should handle everything necessary for file
......@@ -443,7 +443,8 @@ time_t getModTime(char *fileName) {
#endif
}
GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
GBool openTempFile(GString **name, FILE **f,
const char *mode, const char *ext) {
#if defined(WIN32)
//---------- Win32 ----------
char *s;
......