/* makeinfo -- convert Texinfo source into other formats. $Id: makeinfo.c,v 1.8 2006/07/17 16:12:36 espie Exp $ Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 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. Original author of makeinfo: Brian Fox (bfox@ai.mit.edu). */ #include "system.h" #include "getopt.h" #define COMPILING_MAKEINFO #include "makeinfo.h" #include "cmds.h" #include "files.h" #include "float.h" #include "footnote.h" #include "html.h" #include "index.h" #include "insertion.h" #include "lang.h" #include "macro.h" #include "node.h" #include "sectioning.h" #include "toc.h" #include "xml.h" /* You can change some of the behavior of Makeinfo by changing the following defines: */ /* Define INDENT_PARAGRAPHS_IN_TABLE if you want the paragraphs which appear within an @table, @ftable, or @itemize environment to have standard paragraph indentation. Without this, such paragraphs have no starting indentation. */ /* #define INDENT_PARAGRAPHS_IN_TABLE */ /* Define PARAGRAPH_START_INDENT to be the amount of indentation that the first lines of paragraphs receive by default, where no other value has been specified. Users can change this value on the command line, with the --paragraph-indent option, or within the texinfo file, with the @paragraphindent command. */ #define PARAGRAPH_START_INDENT 3 /* Define DEFAULT_PARAGRAPH_SPACING as the number of blank lines that you wish to appear between paragraphs. A value of 1 creates a single blank line between paragraphs. Paragraphs are defined by 2 or more consecutive newlines in the input file (i.e., one or more blank lines). */ #define DEFAULT_PARAGRAPH_SPACING 1 /* Global variables. */ /* The output file name. */ char *output_filename = NULL; /* Name of the output file that the user elected to pass on the command line. Such a name overrides any name found with the @setfilename command. */ char *command_output_filename = NULL; static char *save_command_output_filename = NULL; #define INITIAL_PARAGRAPH_SPACE 5000 int paragraph_buffer_len = INITIAL_PARAGRAPH_SPACE; /* The amount of indentation to add at the starts of paragraphs. 0 means don't change existing indentation at paragraph starts. > 0 is amount to indent new paragraphs by. < 0 means indent to column zero by removing indentation if necessary. This is normally zero, but some people prefer paragraph starts to be somewhat more indented than paragraph bodies. A pretty value for this is 3. */ int paragraph_start_indent = PARAGRAPH_START_INDENT; /* Indentation that is pending insertion. We have this for hacking lines which look blank, but contain whitespace. We want to treat those as blank lines. */ int pending_indent = 0; /* The index in our internal command table of the currently executing command. */ int command_index; /* A search string which is used to find the first @setfilename. */ char setfilename_search[] = { COMMAND_PREFIX, 's', 'e', 't', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', 0 }; /* Values for calling handle_variable_internal (). */ #define SET 1 #define CLEAR 2 #define IFSET 3 #define IFCLEAR 4 /* Flags controlling the operation of the program. */ /* Default is to remove output if there were errors. */ int force = 0; /* Default is to notify users of bad choices. */ int print_warnings = 1; /* Number of errors that we tolerate on a given fileset. */ int max_error_level = 100; /* The actual last inserted character. Note that this may be something other than NEWLINE even if last_char_was_newline is 1. */ int last_inserted_character = 0; /* Nonzero means that a newline character has already been inserted, so close_paragraph () should insert one less. */ int line_already_broken = 0; /* When nonzero we have finished an insertion (see end_insertion ()) and we want to ignore false continued paragraph closings. */ int insertion_paragraph_closed = 0; /* Nonzero means attempt to make all of the lines have fill_column width. */ int do_justification = 0; /* Nonzero means don't replace whitespace with   in HTML mode. */ int in_html_elt = 0; /* Nonzero means we are inserting a block level HTML element that must not be enclosed in a

, such as