2008-09-02 11:45:41 +04:00
|
|
|
|
/* $NetBSD: filesys.c,v 1.1.1.6 2008/09/02 07:49:37 christos Exp $ */
|
2003-01-17 17:54:14 +03:00
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
/* filesys.c -- filesystem specific functions.
|
2008-09-02 11:45:41 +04:00
|
|
|
|
Id: filesys.c,v 1.6 2004/07/30 17:17:40 karl Exp
|
1999-02-11 06:57:13 +03:00
|
|
|
|
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
Copyright (C) 1993, 1997, 1998, 2000, 2002, 2003, 2004 Free Software
|
2003-02-13 11:50:20 +03:00
|
|
|
|
Foundation, Inc.
|
1999-02-11 06:57:13 +03:00
|
|
|
|
|
|
|
|
|
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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
|
|
Written by Brian Fox (bfox@ai.mit.edu). */
|
|
|
|
|
|
|
|
|
|
#include "info.h"
|
|
|
|
|
|
|
|
|
|
#include "tilde.h"
|
|
|
|
|
#include "filesys.h"
|
|
|
|
|
|
|
|
|
|
/* Local to this file. */
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
static char *info_file_in_path (char *filename, char *path);
|
|
|
|
|
static char *lookup_info_filename (char *filename);
|
|
|
|
|
static char *info_absolute_file (char *fname);
|
|
|
|
|
|
|
|
|
|
static void remember_info_filename (char *filename, char *expansion);
|
|
|
|
|
static void maybe_initialize_infopath (void);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
char *suffix;
|
|
|
|
|
char *decompressor;
|
|
|
|
|
} COMPRESSION_ALIST;
|
|
|
|
|
|
|
|
|
|
static char *info_suffixes[] = {
|
|
|
|
|
".info",
|
|
|
|
|
"-info",
|
|
|
|
|
"/index",
|
2001-07-25 20:20:30 +04:00
|
|
|
|
".inf", /* 8+3 file on filesystem which supports long file names */
|
|
|
|
|
#ifdef __MSDOS__
|
|
|
|
|
/* 8+3 file names strike again... */
|
|
|
|
|
".in", /* for .inz, .igz etc. */
|
|
|
|
|
".i",
|
|
|
|
|
#endif
|
|
|
|
|
"",
|
|
|
|
|
NULL
|
1999-02-11 06:57:13 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static COMPRESSION_ALIST compress_suffixes[] = {
|
2001-07-25 20:20:30 +04:00
|
|
|
|
{ ".gz", "gunzip" },
|
|
|
|
|
{ ".bz2", "bunzip2" },
|
|
|
|
|
{ ".z", "gunzip" },
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{ ".Z", "uncompress" },
|
|
|
|
|
{ ".Y", "unyabba" },
|
2001-07-25 20:20:30 +04:00
|
|
|
|
#ifdef __MSDOS__
|
|
|
|
|
{ "gz", "gunzip" },
|
|
|
|
|
{ "z", "gunzip" },
|
|
|
|
|
#endif
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{ (char *)NULL, (char *)NULL }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* The path on which we look for info files. You can initialize this
|
|
|
|
|
from the environment variable INFOPATH if there is one, or you can
|
|
|
|
|
call info_add_path () to add paths to the beginning or end of it.
|
|
|
|
|
You can call zap_infopath () to make the path go away. */
|
|
|
|
|
char *infopath = (char *)NULL;
|
|
|
|
|
static int infopath_size = 0;
|
|
|
|
|
|
|
|
|
|
/* Expand the filename in PARTIAL to make a real name for this operating
|
|
|
|
|
system. This looks in INFO_PATHS in order to find the correct file.
|
|
|
|
|
If it can't find the file, it returns NULL. */
|
|
|
|
|
static char *local_temp_filename = (char *)NULL;
|
|
|
|
|
static int local_temp_filename_size = 0;
|
|
|
|
|
|
|
|
|
|
char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
info_find_fullpath (char *partial)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
int initial_character;
|
|
|
|
|
char *temp;
|
|
|
|
|
|
|
|
|
|
filesys_error_number = 0;
|
|
|
|
|
|
|
|
|
|
maybe_initialize_infopath ();
|
|
|
|
|
|
|
|
|
|
if (partial && (initial_character = *partial))
|
|
|
|
|
{
|
|
|
|
|
char *expansion;
|
|
|
|
|
|
|
|
|
|
expansion = lookup_info_filename (partial);
|
|
|
|
|
|
|
|
|
|
if (expansion)
|
|
|
|
|
return (expansion);
|
|
|
|
|
|
|
|
|
|
/* If we have the full path to this file, we still may have to add
|
|
|
|
|
various extensions to it. I guess we have to stat this file
|
|
|
|
|
after all. */
|
2001-07-25 20:20:30 +04:00
|
|
|
|
if (IS_ABSOLUTE (partial))
|
|
|
|
|
temp = info_absolute_file (partial);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
else if (initial_character == '~')
|
|
|
|
|
{
|
|
|
|
|
expansion = tilde_expand_word (partial);
|
2001-07-25 20:20:30 +04:00
|
|
|
|
if (IS_ABSOLUTE (expansion))
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
2001-07-25 20:20:30 +04:00
|
|
|
|
temp = info_absolute_file (expansion);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
free (expansion);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
temp = expansion;
|
|
|
|
|
}
|
|
|
|
|
else if (initial_character == '.' &&
|
2001-07-25 20:20:30 +04:00
|
|
|
|
(IS_SLASH (partial[1]) ||
|
|
|
|
|
(partial[1] == '.' && IS_SLASH (partial[2]))))
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
if (local_temp_filename_size < 1024)
|
|
|
|
|
local_temp_filename = (char *)xrealloc
|
|
|
|
|
(local_temp_filename, (local_temp_filename_size = 1024));
|
|
|
|
|
#if defined (HAVE_GETCWD)
|
|
|
|
|
if (!getcwd (local_temp_filename, local_temp_filename_size))
|
|
|
|
|
#else /* !HAVE_GETCWD */
|
|
|
|
|
if (!getwd (local_temp_filename))
|
|
|
|
|
#endif /* !HAVE_GETCWD */
|
|
|
|
|
{
|
|
|
|
|
filesys_error_number = errno;
|
|
|
|
|
return (partial);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strcat (local_temp_filename, "/");
|
|
|
|
|
strcat (local_temp_filename, partial);
|
2001-07-25 20:20:30 +04:00
|
|
|
|
temp = info_absolute_file (local_temp_filename); /* try extensions */
|
|
|
|
|
if (!temp)
|
|
|
|
|
partial = local_temp_filename;
|
1999-02-11 06:57:13 +03:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
temp = info_file_in_path (partial, infopath);
|
|
|
|
|
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
remember_info_filename (partial, temp);
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
if (strlen (temp) > (unsigned int) local_temp_filename_size)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
local_temp_filename = (char *) xrealloc
|
|
|
|
|
(local_temp_filename,
|
|
|
|
|
(local_temp_filename_size = (50 + strlen (temp))));
|
|
|
|
|
strcpy (local_temp_filename, temp);
|
|
|
|
|
free (temp);
|
|
|
|
|
return (local_temp_filename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return (partial);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Scan the list of directories in PATH looking for FILENAME. If we find
|
|
|
|
|
one that is a regular file, return it as a new string. Otherwise, return
|
|
|
|
|
a NULL pointer. */
|
|
|
|
|
static char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
info_file_in_path (char *filename, char *path)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
struct stat finfo;
|
|
|
|
|
char *temp_dirname;
|
|
|
|
|
int statable, dirname_index;
|
|
|
|
|
|
2003-01-17 17:54:14 +03:00
|
|
|
|
/* Reject ridiculous cases up front, to prevent infinite recursion
|
|
|
|
|
later on. E.g., someone might say "info '(.)foo'"... */
|
|
|
|
|
if (!*filename || STREQ (filename, ".") || STREQ (filename, ".."))
|
|
|
|
|
return NULL;
|
|
|
|
|
|
1999-02-11 06:57:13 +03:00
|
|
|
|
dirname_index = 0;
|
|
|
|
|
|
|
|
|
|
while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
|
|
|
|
|
{
|
|
|
|
|
register int i, pre_suffix_length;
|
|
|
|
|
char *temp;
|
|
|
|
|
|
|
|
|
|
/* Expand a leading tilde if one is present. */
|
|
|
|
|
if (*temp_dirname == '~')
|
|
|
|
|
{
|
|
|
|
|
char *expanded_dirname;
|
|
|
|
|
|
|
|
|
|
expanded_dirname = tilde_expand_word (temp_dirname);
|
|
|
|
|
free (temp_dirname);
|
|
|
|
|
temp_dirname = expanded_dirname;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename));
|
|
|
|
|
strcpy (temp, temp_dirname);
|
2001-07-25 20:20:30 +04:00
|
|
|
|
if (!IS_SLASH (temp[(strlen (temp)) - 1]))
|
1999-02-11 06:57:13 +03:00
|
|
|
|
strcat (temp, "/");
|
|
|
|
|
strcat (temp, filename);
|
|
|
|
|
|
|
|
|
|
pre_suffix_length = strlen (temp);
|
|
|
|
|
|
|
|
|
|
free (temp_dirname);
|
|
|
|
|
|
|
|
|
|
for (i = 0; info_suffixes[i]; i++)
|
|
|
|
|
{
|
|
|
|
|
strcpy (temp + pre_suffix_length, info_suffixes[i]);
|
|
|
|
|
|
|
|
|
|
statable = (stat (temp, &finfo) == 0);
|
|
|
|
|
|
|
|
|
|
/* If we have found a regular file, then use that. Else, if we
|
|
|
|
|
have found a directory, look in that directory for this file. */
|
|
|
|
|
if (statable)
|
|
|
|
|
{
|
|
|
|
|
if (S_ISREG (finfo.st_mode))
|
|
|
|
|
{
|
|
|
|
|
return (temp);
|
|
|
|
|
}
|
|
|
|
|
else if (S_ISDIR (finfo.st_mode))
|
|
|
|
|
{
|
|
|
|
|
char *newpath, *filename_only, *newtemp;
|
|
|
|
|
|
|
|
|
|
newpath = xstrdup (temp);
|
|
|
|
|
filename_only = filename_non_directory (filename);
|
|
|
|
|
newtemp = info_file_in_path (filename_only, newpath);
|
|
|
|
|
|
|
|
|
|
free (newpath);
|
|
|
|
|
if (newtemp)
|
|
|
|
|
{
|
|
|
|
|
free (temp);
|
|
|
|
|
return (newtemp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Add various compression suffixes to the name to see if
|
|
|
|
|
the file is present in compressed format. */
|
|
|
|
|
register int j, pre_compress_suffix_length;
|
|
|
|
|
|
|
|
|
|
pre_compress_suffix_length = strlen (temp);
|
|
|
|
|
|
|
|
|
|
for (j = 0; compress_suffixes[j].suffix; j++)
|
|
|
|
|
{
|
|
|
|
|
strcpy (temp + pre_compress_suffix_length,
|
|
|
|
|
compress_suffixes[j].suffix);
|
|
|
|
|
|
|
|
|
|
statable = (stat (temp, &finfo) == 0);
|
|
|
|
|
if (statable && (S_ISREG (finfo.st_mode)))
|
|
|
|
|
return (temp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free (temp);
|
|
|
|
|
}
|
|
|
|
|
return ((char *)NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
/* Assume FNAME is an absolute file name, and check whether it is
|
|
|
|
|
a regular file. If it is, return it as a new string; otherwise
|
|
|
|
|
return a NULL pointer. We do it by taking the file name apart
|
|
|
|
|
into its directory and basename parts, and calling info_file_in_path.*/
|
|
|
|
|
static char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
info_absolute_file (char *fname)
|
2001-07-25 20:20:30 +04:00
|
|
|
|
{
|
|
|
|
|
char *containing_dir = xstrdup (fname);
|
|
|
|
|
char *base = filename_non_directory (containing_dir);
|
|
|
|
|
|
|
|
|
|
if (base > containing_dir)
|
|
|
|
|
base[-1] = '\0';
|
|
|
|
|
|
|
|
|
|
return info_file_in_path (filename_non_directory (fname), containing_dir);
|
|
|
|
|
}
|
|
|
|
|
|
2003-02-13 11:50:20 +03:00
|
|
|
|
|
|
|
|
|
/* Given a string containing units of information separated by the
|
|
|
|
|
PATH_SEP character, return the next one after IDX, or NULL if there
|
|
|
|
|
are no more. Advance IDX to the character after the colon. */
|
|
|
|
|
|
1999-02-11 06:57:13 +03:00
|
|
|
|
char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
extract_colon_unit (char *string, int *idx)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
unsigned int i = (unsigned int) *idx;
|
|
|
|
|
unsigned int start = i;
|
1999-02-11 06:57:13 +03:00
|
|
|
|
|
2003-02-13 11:50:20 +03:00
|
|
|
|
if (!string || i >= strlen (string))
|
|
|
|
|
return NULL;
|
1999-02-11 06:57:13 +03:00
|
|
|
|
|
2008-09-02 11:45:41 +04:00
|
|
|
|
if (!string[i]) /* end of string */
|
|
|
|
|
return NULL;
|
|
|
|
|
|
2003-02-13 11:50:20 +03:00
|
|
|
|
/* Advance to next PATH_SEP. */
|
2001-07-25 20:20:30 +04:00
|
|
|
|
while (string[i] && string[i] != PATH_SEP[0])
|
1999-02-11 06:57:13 +03:00
|
|
|
|
i++;
|
2003-02-13 11:50:20 +03:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
char *value = xmalloc ((i - start) + 1);
|
|
|
|
|
strncpy (value, &string[start], (i - start));
|
|
|
|
|
value[i - start] = 0;
|
|
|
|
|
|
|
|
|
|
i++; /* move past PATH_SEP */
|
|
|
|
|
*idx = i;
|
|
|
|
|
return value;
|
|
|
|
|
}
|
1999-02-11 06:57:13 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A structure which associates a filename with its expansion. */
|
2003-02-13 11:50:20 +03:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
1999-02-11 06:57:13 +03:00
|
|
|
|
char *filename;
|
|
|
|
|
char *expansion;
|
|
|
|
|
} FILENAME_LIST;
|
|
|
|
|
|
|
|
|
|
/* An array of remembered arguments and results. */
|
|
|
|
|
static FILENAME_LIST **names_and_files = (FILENAME_LIST **)NULL;
|
|
|
|
|
static int names_and_files_index = 0;
|
|
|
|
|
static int names_and_files_slots = 0;
|
|
|
|
|
|
|
|
|
|
/* Find the result for having already called info_find_fullpath () with
|
|
|
|
|
FILENAME. */
|
|
|
|
|
static char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
lookup_info_filename (char *filename)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
if (filename && names_and_files)
|
|
|
|
|
{
|
|
|
|
|
register int i;
|
|
|
|
|
for (i = 0; names_and_files[i]; i++)
|
|
|
|
|
{
|
2001-07-25 20:20:30 +04:00
|
|
|
|
if (FILENAME_CMP (names_and_files[i]->filename, filename) == 0)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
return (names_and_files[i]->expansion);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return (char *)NULL;;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Add a filename and its expansion to our list. */
|
|
|
|
|
static void
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
remember_info_filename (char *filename, char *expansion)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
FILENAME_LIST *new;
|
|
|
|
|
|
|
|
|
|
if (names_and_files_index + 2 > names_and_files_slots)
|
|
|
|
|
{
|
|
|
|
|
int alloc_size;
|
|
|
|
|
names_and_files_slots += 10;
|
|
|
|
|
|
|
|
|
|
alloc_size = names_and_files_slots * sizeof (FILENAME_LIST *);
|
|
|
|
|
|
|
|
|
|
names_and_files =
|
|
|
|
|
(FILENAME_LIST **) xrealloc (names_and_files, alloc_size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
new = (FILENAME_LIST *)xmalloc (sizeof (FILENAME_LIST));
|
|
|
|
|
new->filename = xstrdup (filename);
|
|
|
|
|
new->expansion = expansion ? xstrdup (expansion) : (char *)NULL;
|
|
|
|
|
|
|
|
|
|
names_and_files[names_and_files_index++] = new;
|
|
|
|
|
names_and_files[names_and_files_index] = (FILENAME_LIST *)NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
maybe_initialize_infopath (void)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
if (!infopath_size)
|
|
|
|
|
{
|
|
|
|
|
infopath = (char *)
|
|
|
|
|
xmalloc (infopath_size = (1 + strlen (DEFAULT_INFOPATH)));
|
|
|
|
|
|
|
|
|
|
strcpy (infopath, DEFAULT_INFOPATH);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Add PATH to the list of paths found in INFOPATH. 2nd argument says
|
|
|
|
|
whether to put PATH at the front or end of INFOPATH. */
|
|
|
|
|
void
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
info_add_path (char *path, int where)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
int len;
|
|
|
|
|
|
|
|
|
|
if (!infopath)
|
|
|
|
|
{
|
|
|
|
|
infopath = (char *)xmalloc (infopath_size = 200 + strlen (path));
|
|
|
|
|
infopath[0] = '\0';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
len = strlen (path) + strlen (infopath);
|
|
|
|
|
|
|
|
|
|
if (len + 2 >= infopath_size)
|
|
|
|
|
infopath = (char *)xrealloc (infopath, (infopath_size += (2 * len) + 2));
|
|
|
|
|
|
|
|
|
|
if (!*infopath)
|
|
|
|
|
strcpy (infopath, path);
|
|
|
|
|
else if (where == INFOPATH_APPEND)
|
|
|
|
|
{
|
2001-07-25 20:20:30 +04:00
|
|
|
|
strcat (infopath, PATH_SEP);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
strcat (infopath, path);
|
|
|
|
|
}
|
|
|
|
|
else if (where == INFOPATH_PREPEND)
|
|
|
|
|
{
|
|
|
|
|
char *temp = xstrdup (infopath);
|
|
|
|
|
strcpy (infopath, path);
|
2001-07-25 20:20:30 +04:00
|
|
|
|
strcat (infopath, PATH_SEP);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
strcat (infopath, temp);
|
|
|
|
|
free (temp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make INFOPATH have absolutely nothing in it. */
|
|
|
|
|
void
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
zap_infopath (void)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
if (infopath)
|
|
|
|
|
free (infopath);
|
|
|
|
|
|
|
|
|
|
infopath = (char *)NULL;
|
|
|
|
|
infopath_size = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
/* Given a chunk of text and its length, convert all CRLF pairs at every
|
|
|
|
|
end-of-line into a single Newline character. Return the length of
|
|
|
|
|
produced text.
|
|
|
|
|
|
|
|
|
|
This is required because the rest of code is too entrenched in having
|
|
|
|
|
a single newline at each EOL; in particular, searching for various
|
|
|
|
|
Info headers and cookies can become extremely tricky if that assumption
|
|
|
|
|
breaks.
|
|
|
|
|
|
|
|
|
|
FIXME: this could also support Mac-style text files with a single CR
|
|
|
|
|
at the EOL, but what about random CR characters in non-Mac files? Can
|
|
|
|
|
we afford converting them into newlines as well? Maybe implement some
|
|
|
|
|
heuristics here, like in Emacs 20.
|
|
|
|
|
|
|
|
|
|
FIXME: is it a good idea to show the EOL type on the modeline? */
|
|
|
|
|
long
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
convert_eols (char *text, long int textlen)
|
2001-07-25 20:20:30 +04:00
|
|
|
|
{
|
|
|
|
|
register char *s = text;
|
|
|
|
|
register char *d = text;
|
|
|
|
|
|
|
|
|
|
while (textlen--)
|
|
|
|
|
{
|
|
|
|
|
if (*s == '\r' && textlen && s[1] == '\n')
|
|
|
|
|
{
|
|
|
|
|
s++;
|
|
|
|
|
textlen--;
|
|
|
|
|
}
|
|
|
|
|
*d++ = *s++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (long)(d - text);
|
|
|
|
|
}
|
|
|
|
|
|
1999-02-11 06:57:13 +03:00
|
|
|
|
/* Read the contents of PATHNAME, returning a buffer with the contents of
|
|
|
|
|
that file in it, and returning the size of that buffer in FILESIZE.
|
|
|
|
|
FINFO is a stat struct which has already been filled in by the caller.
|
2001-07-25 20:20:30 +04:00
|
|
|
|
If the file turns out to be compressed, set IS_COMPRESSED to non-zero.
|
1999-02-11 06:57:13 +03:00
|
|
|
|
If the file cannot be read, return a NULL pointer. */
|
|
|
|
|
char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
filesys_read_info_file (char *pathname, long int *filesize,
|
|
|
|
|
struct stat *finfo, int *is_compressed)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
long st_size;
|
|
|
|
|
|
|
|
|
|
*filesize = filesys_error_number = 0;
|
|
|
|
|
|
|
|
|
|
if (compressed_filename_p (pathname))
|
2001-07-25 20:20:30 +04:00
|
|
|
|
{
|
|
|
|
|
*is_compressed = 1;
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
return (filesys_read_compressed (pathname, filesize));
|
2001-07-25 20:20:30 +04:00
|
|
|
|
}
|
1999-02-11 06:57:13 +03:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int descriptor;
|
|
|
|
|
char *contents;
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
*is_compressed = 0;
|
|
|
|
|
descriptor = open (pathname, O_RDONLY | O_BINARY, 0666);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
|
|
|
|
|
/* If the file couldn't be opened, give up. */
|
|
|
|
|
if (descriptor < 0)
|
|
|
|
|
{
|
|
|
|
|
filesys_error_number = errno;
|
|
|
|
|
return ((char *)NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to read the contents of this file. */
|
|
|
|
|
st_size = (long) finfo->st_size;
|
|
|
|
|
contents = (char *)xmalloc (1 + st_size);
|
|
|
|
|
if ((read (descriptor, contents, st_size)) != st_size)
|
|
|
|
|
{
|
2001-07-25 20:20:30 +04:00
|
|
|
|
filesys_error_number = errno;
|
|
|
|
|
close (descriptor);
|
|
|
|
|
free (contents);
|
|
|
|
|
return ((char *)NULL);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
close (descriptor);
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
/* Convert any DOS-style CRLF EOLs into Unix-style NL.
|
|
|
|
|
Seems like a good idea to have even on Unix, in case the Info
|
|
|
|
|
files are coming from some Windows system across a network. */
|
|
|
|
|
*filesize = convert_eols (contents, st_size);
|
|
|
|
|
|
|
|
|
|
/* EOL conversion can shrink the text quite a bit. We don't
|
|
|
|
|
want to waste storage. */
|
|
|
|
|
if (*filesize < st_size)
|
|
|
|
|
contents = (char *)xrealloc (contents, 1 + *filesize);
|
2003-01-17 17:54:14 +03:00
|
|
|
|
contents[*filesize] = '\0';
|
2001-07-25 20:20:30 +04:00
|
|
|
|
|
1999-02-11 06:57:13 +03:00
|
|
|
|
return (contents);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Typically, pipe buffers are 4k. */
|
|
|
|
|
#define BASIC_PIPE_BUFFER (4 * 1024)
|
|
|
|
|
|
|
|
|
|
/* We use some large multiple of that. */
|
|
|
|
|
#define FILESYS_PIPE_BUFFER_SIZE (16 * BASIC_PIPE_BUFFER)
|
|
|
|
|
|
|
|
|
|
char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
filesys_read_compressed (char *pathname, long int *filesize)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
FILE *stream;
|
|
|
|
|
char *command, *decompressor;
|
|
|
|
|
char *contents = (char *)NULL;
|
|
|
|
|
|
|
|
|
|
*filesize = filesys_error_number = 0;
|
|
|
|
|
|
|
|
|
|
decompressor = filesys_decompressor_for_file (pathname);
|
|
|
|
|
|
|
|
|
|
if (!decompressor)
|
|
|
|
|
return ((char *)NULL);
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
command = (char *)xmalloc (15 + strlen (pathname) + strlen (decompressor));
|
|
|
|
|
/* Explicit .exe suffix makes the diagnostics of `popen'
|
|
|
|
|
better on systems where COMMAND.COM is the stock shell. */
|
|
|
|
|
sprintf (command, "%s%s < %s",
|
|
|
|
|
decompressor, STRIP_DOT_EXE ? ".exe" : "", pathname);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
|
|
|
|
|
#if !defined (BUILDING_LIBRARY)
|
|
|
|
|
if (info_windows_initialized_p)
|
|
|
|
|
{
|
|
|
|
|
char *temp;
|
|
|
|
|
|
|
|
|
|
temp = (char *)xmalloc (5 + strlen (command));
|
|
|
|
|
sprintf (temp, "%s...", command);
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
message_in_echo_area ("%s", temp, NULL);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
free (temp);
|
|
|
|
|
}
|
|
|
|
|
#endif /* !BUILDING_LIBRARY */
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
stream = popen (command, FOPEN_RBIN);
|
1999-02-11 06:57:13 +03:00
|
|
|
|
free (command);
|
|
|
|
|
|
|
|
|
|
/* Read chunks from this file until there are none left to read. */
|
|
|
|
|
if (stream)
|
|
|
|
|
{
|
2003-01-17 17:54:14 +03:00
|
|
|
|
long offset, size;
|
1999-02-11 06:57:13 +03:00
|
|
|
|
char *chunk;
|
|
|
|
|
|
|
|
|
|
offset = size = 0;
|
|
|
|
|
chunk = (char *)xmalloc (FILESYS_PIPE_BUFFER_SIZE);
|
|
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
int bytes_read;
|
|
|
|
|
|
|
|
|
|
bytes_read = fread (chunk, 1, FILESYS_PIPE_BUFFER_SIZE, stream);
|
|
|
|
|
|
|
|
|
|
if (bytes_read + offset >= size)
|
|
|
|
|
contents = (char *)xrealloc
|
|
|
|
|
(contents, size += (2 * FILESYS_PIPE_BUFFER_SIZE));
|
|
|
|
|
|
|
|
|
|
memcpy (contents + offset, chunk, bytes_read);
|
|
|
|
|
offset += bytes_read;
|
|
|
|
|
if (bytes_read != FILESYS_PIPE_BUFFER_SIZE)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free (chunk);
|
2001-07-25 20:20:30 +04:00
|
|
|
|
if (pclose (stream) == -1)
|
|
|
|
|
{
|
|
|
|
|
if (contents)
|
|
|
|
|
free (contents);
|
|
|
|
|
contents = (char *)NULL;
|
|
|
|
|
filesys_error_number = errno;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*filesize = convert_eols (contents, offset);
|
|
|
|
|
contents = (char *)xrealloc (contents, 1 + *filesize);
|
2003-01-17 17:54:14 +03:00
|
|
|
|
contents[*filesize] = '\0';
|
2001-07-25 20:20:30 +04:00
|
|
|
|
}
|
1999-02-11 06:57:13 +03:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
filesys_error_number = errno;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if !defined (BUILDING_LIBARARY)
|
|
|
|
|
if (info_windows_initialized_p)
|
|
|
|
|
unmessage_in_echo_area ();
|
|
|
|
|
#endif /* !BUILDING_LIBRARY */
|
|
|
|
|
return (contents);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return non-zero if FILENAME belongs to a compressed file. */
|
|
|
|
|
int
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
compressed_filename_p (char *filename)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
char *decompressor;
|
|
|
|
|
|
|
|
|
|
/* Find the final extension of this filename, and see if it matches one
|
|
|
|
|
of our known ones. */
|
|
|
|
|
decompressor = filesys_decompressor_for_file (filename);
|
|
|
|
|
|
|
|
|
|
if (decompressor)
|
|
|
|
|
return (1);
|
|
|
|
|
else
|
|
|
|
|
return (0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the command string that would be used to decompress FILENAME. */
|
|
|
|
|
char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
filesys_decompressor_for_file (char *filename)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
register int i;
|
|
|
|
|
char *extension = (char *)NULL;
|
|
|
|
|
|
|
|
|
|
/* Find the final extension of FILENAME, and see if it appears in our
|
|
|
|
|
list of known compression extensions. */
|
|
|
|
|
for (i = strlen (filename) - 1; i > 0; i--)
|
|
|
|
|
if (filename[i] == '.')
|
|
|
|
|
{
|
|
|
|
|
extension = filename + i;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!extension)
|
|
|
|
|
return ((char *)NULL);
|
|
|
|
|
|
|
|
|
|
for (i = 0; compress_suffixes[i].suffix; i++)
|
2001-07-25 20:20:30 +04:00
|
|
|
|
if (FILENAME_CMP (extension, compress_suffixes[i].suffix) == 0)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
return (compress_suffixes[i].decompressor);
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
#if defined (__MSDOS__)
|
|
|
|
|
/* If no other suffix matched, allow any extension which ends
|
|
|
|
|
with `z' to be decompressed by gunzip. Due to limited 8+3 DOS
|
|
|
|
|
file namespace, we can expect many such cases, and supporting
|
|
|
|
|
every weird suffix thus produced would be a pain. */
|
|
|
|
|
if (extension[strlen (extension) - 1] == 'z' ||
|
|
|
|
|
extension[strlen (extension) - 1] == 'Z')
|
|
|
|
|
return "gunzip";
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-02-11 06:57:13 +03:00
|
|
|
|
return ((char *)NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The number of the most recent file system error. */
|
|
|
|
|
int filesys_error_number = 0;
|
|
|
|
|
|
|
|
|
|
/* A function which returns a pointer to a static buffer containing
|
|
|
|
|
an error message for FILENAME and ERROR_NUM. */
|
|
|
|
|
static char *errmsg_buf = (char *)NULL;
|
|
|
|
|
static int errmsg_buf_size = 0;
|
|
|
|
|
|
|
|
|
|
char *
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
filesys_error_string (char *filename, int error_num)
|
1999-02-11 06:57:13 +03:00
|
|
|
|
{
|
|
|
|
|
int len;
|
|
|
|
|
char *result;
|
|
|
|
|
|
|
|
|
|
if (error_num == 0)
|
|
|
|
|
return ((char *)NULL);
|
|
|
|
|
|
|
|
|
|
result = strerror (error_num);
|
|
|
|
|
|
|
|
|
|
len = 4 + strlen (filename) + strlen (result);
|
|
|
|
|
if (len >= errmsg_buf_size)
|
|
|
|
|
errmsg_buf = (char *)xrealloc (errmsg_buf, (errmsg_buf_size = 2 + len));
|
|
|
|
|
|
|
|
|
|
sprintf (errmsg_buf, "%s: %s", filename, result);
|
|
|
|
|
return (errmsg_buf);
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
|
2003-01-17 17:54:14 +03:00
|
|
|
|
/* Check for "dir" with all the possible info and compression suffixes,
|
|
|
|
|
in combination. */
|
2001-07-25 20:20:30 +04:00
|
|
|
|
|
|
|
|
|
int
|
Import of texinfo-4.7, as prepared by texinfo2netbsd.
Changes since 4.6:
4.7 (9 April 2004)
* Language:
. new commands @float, @caption, @shortcaption, @listoffloats for
initial implementation of floating material (figures, tables, etc).
Ironically, they do not yet actually float anywhere.
. new commands @docbook, @ifdocbook, @ifnotdocbook for conditional Docbook.
. new commands @ordf{} and @ordm{} for Spanish feminine/masculine ordinals.
. new commands @deftypecv[x] for class variables in typed OO languages.
. new command @registeredsymbol for the r-in-a-circle symbol.
. new command @headitem to make a heading row in @multitable.
. new command @LaTeX{} for the LaTeX logo.
. new command @comma{} to avoid comma-parsing problems.
. @url is now a synonym for @uref; new command @indicateurl has the
old meaning of just displaying a url as text.
. @quotation now accepts an optional argument for labelling the text
as a `Note', `Tip', etc.
. @defun (et al.) heading lines can now be continued with a lone @.
. @acronym accepts an optional argument for the meaning of the acronym.
* makeinfo:
. New environment variable TEXINFO_OUTPUT_FORMAT determines the output
format at runtime, if no options are specified.
. New option --plaintext, equivalent to --no-headers with Info output.
. All outputs:
- sections are numbered by default.
. Info output:
- punctuation is inserted after @pxref and @ref, if needed to make
cross-references valid.
- line numbers included in index menus, so Info readers can go to
the exact line of an entry, not just a node. Also in plaintext output.
- ^@^H[index^@^H] cookie included in index menus, so Info readers
can handle the ] etc. commands better.
. HTML output:
- new algorithm for cross-references to other manuals, for maximum
portability and stability.
- include node name in <title> with split output.
- @multicolumn fractions become percentages.
- entities used for bullets, quotes, dashes, and others.
- index entries are links to the exact locations.
- <h4> and <h5> used for @sub and @subsubsections again.
- accented dotless i supported.
. XML output: many new tags and structure to preserve more source features.
. Docbook output:
- upgraded DTD to Docbook XML 4.2, no longer using Docbook SGML.
- improved translation in general, for instance:
- line annotations and marked quotations.
* texi2dvi:
. if available, use etex (pdfetex if --pdf) by default.
. if the input file includes thumbpdf.sty (for LaTeX), then run thumbpdf.
. more output if --debug.
* texinfo.tex:
. @defun names are now printed in typewriter (instead of bold), and
within the arguments, @var text is printed in slanted typewriter.
. @tex code is executed inside a TeX group, so that any changes must
be prefixed with \global (or the equivalent) to be effective. (This
change was actually made years ago, but never made it into the NEWS.)
* info:
. new option --where (aka --location, -w) to report where an Info file
would be found, instead of reading it.
. by default, output ANSI terminal escape sequences as-is; new option
--no-raw-escapes overrides this.
. use the newly-generated index line numbers.
* Distribution:
. new script gendocs.sh (not installed), for use by GNU maintainers in
getting their manuals on the GNU web site. Documented in
maintain.texi (http://www.gnu.org/prep/maintain_toc.html).
. Most code uses ANSI C prototypes, to some extent.
. New translation: nb.
. automake 1.8.3, autoconf 2.59, gettext 0.14.1.
2004-07-13 03:26:33 +04:00
|
|
|
|
is_dir_name (char *filename)
|
2001-07-25 20:20:30 +04:00
|
|
|
|
{
|
|
|
|
|
unsigned i;
|
2003-01-17 17:54:14 +03:00
|
|
|
|
|
|
|
|
|
for (i = 0; info_suffixes[i]; i++)
|
2001-07-25 20:20:30 +04:00
|
|
|
|
{
|
2003-01-17 17:54:14 +03:00
|
|
|
|
unsigned c;
|
|
|
|
|
char trydir[50];
|
|
|
|
|
strcpy (trydir, "dir");
|
|
|
|
|
strcat (trydir, info_suffixes[i]);
|
|
|
|
|
|
|
|
|
|
if (strcasecmp (filename, trydir) == 0)
|
2001-07-25 20:20:30 +04:00
|
|
|
|
return 1;
|
2003-01-17 17:54:14 +03:00
|
|
|
|
|
|
|
|
|
for (c = 0; compress_suffixes[c].suffix; c++)
|
|
|
|
|
{
|
|
|
|
|
char dir_compressed[50]; /* can be short */
|
|
|
|
|
strcpy (dir_compressed, trydir);
|
|
|
|
|
strcat (dir_compressed, compress_suffixes[c].suffix);
|
|
|
|
|
if (strcasecmp (filename, dir_compressed) == 0)
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-25 20:20:30 +04:00
|
|
|
|
return 0;
|
|
|
|
|
}
|