indent-2.2.11/0000777000177400010010000000000011331331065010052 500000000000000indent-2.2.11/ChangeLog0000644000177400010010000001276411331330671011554 00000000000000-2010-01-31 david * Fixed Debian Bug report logs - #485764, Regression with --blank-lines-after-declarations in 2.2.10 * Fail instead of removing embedded NULLs in input files. * Release 2.2.11 -2009-11-11 Jean-Christophe Dubois jcd@tribudubois.net * fixed handling of '...' range 'operator in C++ language. -2009-10-11 david * fixed -nlps option. -2007-12-11 david * Added GPL version 3 as the COPYING file. * Added missing documentation of blf and brf as reported by Tom Tromey -2007-11-27 Matthew Wilcox * extended --indent-label with negative offsets. -il0 now gives no indentation, -il-2 is the default to match the old behaviour. 2007-11-11 Jean-Christophe Dubois * added --indent-label and --linux-style options. 2007-02-25 david Ingamells * Added doxygen profile and updated source to be better documented with doxygen. * Cleanup of code. 2003-09-28 Erik de Castro Lopo * indent.c Fixed Bug#212320: --blank-lines-after-procedures does not work * indent.c Fixed Bug#206785: indent segfaults on the attached file 2002-12-16 gettextize * configure.ac (AC_OUTPUT): Add po/Makefile.in. 2002-12-12 gettextize * Makefile.am (SUBDIRS): Add intl, (EXTRA_DIST): Add config/config.rpath config/mkinstalldirs. * configure.ac (AC_OUTPUT): Add intl/Makefile, 2002-12-12 gettextize * configure.ac (AC_OUTPUT): Add intl/Makefile. 2002-12-12 gettextize * Makefile.am (SUBDIRS): Add m4. (SUBDIRS): Remove intl. (ACLOCAL_AMFLAGS): New variable. (EXTRA_DIST): Add config/config.rpath config/mkinstalldirs. * configure.ac (AC_OUTPUT): Add m4/Makefile. (AC_OUTPUT): Remove command that created po/Makefile. 2002-11-10 Cristalle Azundris Sabon * Added --preprocessor-indentation (ppi) if set, will indent nested preprocessor-statements with n spaces per level. Overrides -lps. 2002-08-25 D.Ingamells * Added option break-function-decl-args-end (bfde) to break the function arguments list before the closing bracket. * -bdfa now causes a break after the opening bracket and before the first argument so that the first argument and subsequent arguments are indented one indentation step instead of being aligned with the opening bracket. 2002-08-05 Matthias and Eric Lloyd * Added support for -brf to place function opening brace after function * declaration. 2002-03-14 David Ingamells * args.c : fixed handling of comments in the profile file. * args.c : profile file can also be specified by the environment variable INDENT_PROFILE * io.c output.c : extracted output code from io.c and put it in output.c 2002-02-26 David Ingamells * comments.c : reduced problems with -st and repeated calls. Still a bug when 2 comments on one line. 2002-01-22 David Ingamells * indent.h : hopefully reduced problems when building without the gettext library. 2002-01-22 Charles Lecklider * config.h.watcom makefile.watcom.in : Added files for use with Watcom compiler. 2002-01-17 David Ingamells * io.c : Files will now always get a newline at the end of file if the input was missing one. This now matches the default behaviour of vi. * args.c : Parameterised argument lists for gnu, kr and orig setting sets. 2002-01-17 Carlo Wood * texinfo2man.c : Fixed handling of @@ within a @email{}. Now only one @ is output. 2002-01-08 David Ingamells * configure.ac : Fixed problems of autoconf items used by gettext being defined instead of just "required". This should fix problems with a missing stpcpy during build. * automake.am : fixed order that directories are listed. This ensure that the intl directory is built before the indent executable. Added the I18N files that have been delivered by the translation team. There are now 15 languages supported in addition the coded English messages. * po/* : Added 15 .po files from the I18N team. * src/indent.h : Fixed include of the gettext include file. (removed "intl/") * src/indent.c : Fixed problem in multi-file mode where input file is truncated if the backup file exists and is write protected. 2001-12-04 John Bridges * indent.dsp, wildcard.c : improvements for vc++. 2001-12-04 Vladislav Naumov * miscel/Makefile.mingw32 : Some fixes for the mingw32 compiler's makefile. * miscel/config.h.vc++ : prevent UTIME for mingw32. 2001-11-27 David Ingamells * makefile.am,*/makefile.am : Major changes to the Makefile.am files to reflect the new deep structure and to come closer to the current auto-tool styles. 2001-11-02 David Ingamells * general : Changing over to 'deep' release structure with src, doc, etc. directories. This is requiring a major revamp of the "auto" tool input files. * lexi.c : Allowed a string to be multi-line (i.e. newlines from code file is part of string). * all_source_files : ANSI-ize all functions and clean-up layout. Break up some too-big functions. indent-2.2.11/man/0000777000177400010010000000000011331331070010621 500000000000000indent-2.2.11/man/indent.1.in0000644000177400010010000000117510775646104012533 00000000000000.TH INDENT 1L .SH "NAME" indent \- @NAME@ .SH "SYNOPSIS" .B "indent " [options] [input\-files] .sp .B "indent " [options] [single\-input\-file] [\-o output\-file] .sp .B "indent " \-\-version .SH "DESCRIPTION" This man page is generated from the file \fIindent.texinfo\fR. @INTRO@ @DESCRIPTION@ .SH "OPTIONS" @OPTIONS@ @THEREST@ @CROSSREF@ .SH "RETURN VALUE" Unknown .SH FILES .br .nf .\" set tabstop to longest possible filename, plus a wee bit .ta \w'$HOME/.indent.pro 'u \fI$HOME/.indent.pro\fR holds default options for indent. .SH "AUTHORS" @AUTHORS@ .SH "HISTORY" Derived from the UCB program "indent". .SH "COPYING" @COPYING@ indent-2.2.11/man/Makefile.am0000644000177400010010000000065410776163475012626 00000000000000mandir = @mandir@ bin_PROGRAMS = texinfo2man texinfo2man_SOURCES = texinfo2man.c man_MANS = @PACKAGE@.1 EXTRA_DIST = $(man_MANS) @PACKAGE@.1.in # --------------- Maintainer's Section MAINTAINERCLEANFILES = @PACKAGE@.1 Makefile.in texinfo2man @PACKAGE@.1: ${srcdir}/@PACKAGE@.1.in ${srcdir}/../doc/@PACKAGE@.texinfo texinfo2man Makefile.am ./texinfo2man ${srcdir}/@PACKAGE@.1.in ${srcdir}/../doc/@PACKAGE@.texinfo > $@ indent-2.2.11/man/indent.10000644000177400010010000014735211331326642012125 00000000000000.TH INDENT 1L .SH "NAME" indent \- changes the appearance of a C program by inserting or deleting whitespace. .SH "SYNOPSIS" .B "indent " [options] [input\-files] .sp .B "indent " [options] [single\-input\-file] [\-o output\-file] .sp .B "indent " \-\-version .SH "DESCRIPTION" This man page is generated from the file \fIindent.texinfo\fR. This is Edition of "The \fBindent\fR Manual", for Indent Version , last updated . The \fBindent\fR program can be used to make code easier to read. It can also convert from one style of writing C to another. .B indent\fR understands a substantial amount about the syntax of C, but it also attempts to cope with incomplete and misformed syntax. In version 1.2 and more recent versions, the GNU style of indenting is the default. .SH "OPTIONS" .TP 4 .B -bad\fR, \fB--blank-lines-after-declarations\fR Force blank lines after the declarations. .br See \fB\ BLANK\ LINES\fR. .TP .B -bap\fR, \fB--blank-lines-after-procedures\fR Force blank lines after procedure bodies. .br See \fB\ BLANK\ LINES\fR. .TP .B -bbb\fR, \fB--blank-lines-before-block-comments\fR Force blank lines before block comments. .br See \fB\ BLANK\ LINES\fR. .TP .B -bbo\fR, \fB--break-before-boolean-operator\fR Prefer to break long lines before boolean operators. .br See \fB\ BREAKING\ LONG\ LINES\fR. .TP .B -bc\fR, \fB--blank-lines-after-commas\fR Force newline after comma in declaration. .br See \fB\ DECLARATIONS\fR. .TP .B -bl\fR, \fB--braces-after-if-line\fR Put braces on line after \fBif\fR, etc. .br See \fB\ STATEMENTS\fR. .TP .B -blf\fR, \fB--braces-after-func-def-line\fR Put braces on line following function definition line. .br See \fB\ DECLARATIONS\fR. .TP .B -bli\fIn\fB\fR, \fB--brace-indent\fIn\fB\fR Indent braces \fIn\fR spaces. .br See \fB\ STATEMENTS\fR. .TP .B -bls\fR, \fB--braces-after-struct-decl-line\fR Put braces on the line after \fBstruct\fR declaration lines. .br See \fB\ DECLARATIONS\fR. .TP .B -br\fR, \fB--braces-on-if-line\fR Put braces on line with \fBif\fR, etc. .br See \fB\ STATEMENTS\fR. .TP .B -brf\fR, \fB--braces-on-func-def-line\fR Put braces on function definition line. .br See \fB\ DECLARATIONS\fR. .TP .B -brs\fR, \fB--braces-on-struct-decl-line\fR Put braces on \fBstruct\fR declaration line. .br See \fB\ DECLARATIONS\fR. .TP .B -bs\fR, \fB--Bill-Shannon\fR, \fB--blank-before-sizeof\fR Put a space between \fBsizeof\fR and its argument. .br See \fB\ STATEMENTS\fR. .TP .B -c\fIn\fB\fR, \fB--comment-indentation\fIn\fB\fR Put comments to the right of code in column \fIn\fR. .br See \fB\ COMMENTS\fR. .TP .B -cbi\fIn\fB\fR, \fB--case-brace-indentation\fIn\fB\fR Indent braces after a case label N spaces. .br See \fB\ STATEMENTS\fR. .TP .B -cd\fIn\fB\fR, \fB--declaration-comment-column\fIn\fB\fR Put comments to the right of the declarations in column \fIn\fR. .br See \fB\ COMMENTS\fR. .TP .B -cdb\fR, \fB--comment-delimiters-on-blank-lines\fR Put comment delimiters on blank lines. .br See \fB\ COMMENTS\fR. .TP .B -cdw\fR, \fB--cuddle-do-while\fR Cuddle while of \fBdo {} while;\fR and preceding \(oq}\(cq. .br See \fB\ COMMENTS\fR. .TP .B -ce\fR, \fB--cuddle-else\fR Cuddle else and preceding \(oq}\(cq. .br See \fB\ COMMENTS\fR. .TP .B -ci\fIn\fB\fR, \fB--continuation-indentation\fIn\fB\fR Continuation indent of \fIn\fR spaces. .br See \fB\ STATEMENTS\fR. .TP .B -cli\fIn\fB\fR, \fB--case-indentation\fIn\fB\fR Case label indent of \fIn\fR spaces. .br See \fB\ STATEMENTS\fR. .TP .B -cp\fIn\fB\fR, \fB--else-endif-column\fIn\fB\fR Put comments to the right of \fB#else\fR and \fB #endif\fR statements in column \fIn\fR. .br See \fB\ COMMENTS\fR. .TP .B -cs\fR, \fB--space-after-cast\fR Put a space after a cast operator. .br See \fB\ STATEMENTS\fR. .TP .B -d\fIn\fB\fR, \fB--line-comments-indentation\fIn\fB\fR Set indentation of comments not to the right of code to \fIn\fR spaces. .br See \fB\ COMMENTS\fR. .TP .B -bfda\fR, \fB--break-function-decl-args\fR Break the line before all arguments in a declaration. .br See \fB\ DECLARATIONS\fR. .TP .B -bfde\fR, \fB--break-function-decl-args-end\fR Break the line after the last argument in a declaration. .br See \fB\ DECLARATIONS\fR. .TP .B -dj\fIn\fB\fR, \fB--left-justify-declarations\fR If -cd 0 is used then comments after declarations are left justified behind the declaration. .br See \fB\ DECLARATIONS\fR. .TP .B -di\fIn\fB\fR, \fB--declaration-indentation\fIn\fB\fR Put variables in column \fIn\fR. .br See \fB\ DECLARATIONS\fR. .TP .B -fc1\fR, \fB--format-first-column-comments\fR Format comments in the first column. .br See \fB\ COMMENTS\fR. .TP .B -fca\fR, \fB--format-all-comments\fR Do not disable all formatting of comments. .br See \fB\ COMMENTS\fR. .TP .B -gnu\fR, \fB--gnu-style\fR Use GNU coding style. This is the default. .br See \fB\ COMMON\ STYLES\fR. .TP .B -hnl\fR, \fB--honour-newlines\fR Prefer to break long lines at the position of newlines in the input. .br See \fB\ BREAKING\ LONG\ LINES\fR. .TP .B -i\fIn\fB\fR, \fB--indent-level\fIn\fB\fR Set indentation level to \fIn\fR spaces. .br See \fB\ INDENTATION\fR. .TP .B -il\fIn\fB\fR, \fB--indent-label\fIn\fB\fR Set offset for labels to column \fIn\fR. .br See \fB\ INDENTATION\fR. .TP .B -ip\fIn\fB\fR, \fB--parameter-indentation\fIn\fB\fR Indent parameter types in old-style function definitions by \fIn\fR spaces. .br See \fB\ INDENTATION\fR. .TP .B -kr\fR, \fB--k-and-r-style\fR Use Kernighan & Ritchie coding style. .br See \fB\ COMMON\ STYLES\fR. .TP .B -l\fIn\fB\fR, \fB--line-length\fIn\fB\fR Set maximum line length for non-comment lines to \fIn\fR. .br See \fB\ BREAKING\ LONG\ LINES\fR. .TP .B -lc\fIn\fB\fR, \fB--comment-line-length\fIn\fB\fR Set maximum line length for comment formatting to \fIn\fR. .br See \fB\ COMMENTS\fR. .TP .B -linux\fR, \fB--linux-style\fR Use Linux coding style. .br See \fB\ COMMON\ STYLES\fR. .TP .B -lp\fR, \fB--continue-at-parentheses\fR Line up continued lines at parentheses. .br See \fB\ INDENTATION\fR. .TP .B -lps\fR, \fB--leave-preprocessor-space\fR Leave space between \(oq#\(cq and preprocessor directive. .br See \fB\ INDENTATION\fR. .TP .B -nbad\fR, \fB--no-blank-lines-after-declarations\fR Do not force blank lines after declarations. .br See \fB\ BLANK\ LINES\fR. .TP .B -nbap\fR, \fB--no-blank-lines-after-procedures\fR Do not force blank lines after procedure bodies. .br See \fB\ BLANK\ LINES\fR. .TP .B -nbbo\fR, \fB--break-after-boolean-operator\fR Do not prefer to break long lines before boolean operators. .br See \fB\ BREAKING\ LONG\ LINES\fR. .TP .B -nbc\fR, \fB--no-blank-lines-after-commas\fR Do not force newlines after commas in declarations. .br See \fB\ DECLARATIONS\fR. .TP .B -nbfda\fR, \fB--dont-break-function-decl-args\fR Don\(cqt put each argument in a function declaration on a separate line. .br See \fB\ DECLARATIONS\fR. .TP .B -ncdb\fR, \fB--no-comment-delimiters-on-blank-lines\fR Do not put comment delimiters on blank lines. .br See \fB\ COMMENTS\fR. .TP .B -ncdw\fR, \fB--dont-cuddle-do-while\fR Do not cuddle \fB}\fR and the \fBwhile\fR of a \fBdo {} while;\fR. .br See \fB\ STATEMENTS\fR. .TP .B -nce\fR, \fB--dont-cuddle-else\fR Do not cuddle \fB}\fR and \fBelse\fR. .br See \fB\ STATEMENTS\fR. .TP .B -ncs\fR, \fB--no-space-after-casts\fR Do not put a space after cast operators. .br See \fB\ STATEMENTS\fR. .TP .B -ndj\fIn\fB\fR, \fB--dont-left-justify-declarations\fR Comments after declarations are treated the same as comments after other statements. .br See \fB\ DECLARATIONS\fR. .TP .B -nfc1\fR, \fB--dont-format-first-column-comments\fR Do not format comments in the first column as normal. .br See \fB\ COMMENTS\fR. .TP .B -nfca\fR, \fB--dont-format-comments\fR Do not format any comments. .br See \fB\ COMMENTS\fR. .TP .B -nhnl\fR, \fB--ignore-newlines\fR Do not prefer to break long lines at the position of newlines in the input. .br See \fB\ BREAKING\ LONG\ LINES\fR. .TP .B -nip\fR, \fB--no-parameter-indentation\fR Zero width indentation for parameters. .br See \fB\ INDENTATION\fR. .TP .B -nlp\fR, \fB--dont-line-up-parentheses\fR Do not line up parentheses. .br See \fB\ STATEMENTS\fR. .TP .B -npcs\fR, \fB--no-space-after-function-call-names\fR Do not put space after the function in function calls. .br See \fB\ STATEMENTS\fR. .TP .B -nprs\fR, \fB--no-space-after-parentheses\fR Do not put a space after every \(cq(\(cq and before every \(cq)\(cq. .br See \fB\ STATEMENTS\fR. .TP .B -npsl\fR, \fB--dont-break-procedure-type\fR Put the type of a procedure on the same line as its name. .br See \fB\ DECLARATIONS\fR. .TP .B -nsaf\fR, \fB--no-space-after-for\fR Do not put a space after every \fBfor\fR. .br See \fB\ STATEMENTS\fR. .TP .B -nsai\fR, \fB--no-space-after-if\fR Do not put a space after every \fBif\fR. .br See \fB\ STATEMENTS\fR. .TP .B -nsaw\fR, \fB--no-space-after-while\fR Do not put a space after every \fBwhile\fR. .br See \fB\ STATEMENTS\fR. .TP .B -nsc\fR, \fB--dont-star-comments\fR Do not put the \(oq*\(cq character at the left of comments. .br See \fB\ COMMENTS\fR. .TP .B -nsob\fR, \fB--leave-optional-blank-lines\fR Do not swallow optional blank lines. .br See \fB\ BLANK\ LINES\fR. .TP .B -nss\fR, \fB--dont-space-special-semicolon\fR Do not force a space before the semicolon after certain statements. Disables \(oq-ss\(cq. .br See \fB\ STATEMENTS\fR. .TP .B -nut\fR, \fB--no-tabs\fR Use spaces instead of tabs. .br See \fB\ INDENTATION\fR. .TP .B -nv\fR, \fB--no-verbosity\fR Disable verbose mode. .br See \fB\ MISCELLANEOUS\ OPTIONS\fR. .TP .B -orig\fR, \fB--original\fR Use the original Berkeley coding style. .br See \fB\ COMMON\ STYLES\fR. .TP .B -npro\fR, \fB--ignore-profile\fR Do not read \(oq.indent.pro\(cq files. .br See \fB\ INVOKING\ INDENT\fR. .TP .B -pcs\fR, \fB--space-after-procedure-calls\fR Insert a space between the name of the procedure being called and the \(oq(\(cq. .br See \fB\ STATEMENTS\fR. .TP .B -pi\fIn\fB\fR, \fB--paren-indentation\fIn\fB\fR Specify the extra indentation per open parentheses \(cq(\(cq when a statement is broken.See \fB\ STATEMENTS\fR. .TP .B -pmt\fR, \fB--preserve-mtime\fR Preserve access and modification times on output files.See \fB\ MISCELLANEOUS\ OPTIONS\fR. .TP .B -ppi\fIn\fB\fR, \fB--preprocessor-indentation\fIn\fB\fR Specify the indentation for preprocessor conditional statements.See \fB\ INDENTATION\fR. .TP .B -prs\fR, \fB--space-after-parentheses\fR Put a space after every \(cq(\(cq and before every \(cq)\(cq. .br See \fB\ STATEMENTS\fR. .TP .B -psl\fR, \fB--procnames-start-lines\fR Put the type of a procedure on the line before its name. .br See \fB\ DECLARATIONS\fR. .TP .B -saf\fR, \fB--space-after-for\fR Put a space after each \fBfor\fR. .br See \fB\ STATEMENTS\fR. .TP .B -sai\fR, \fB--space-after-if\fR Put a space after each \fBif\fR. .br See \fB\ STATEMENTS\fR. .TP .B -saw\fR, \fB--space-after-while\fR Put a space after each \fBwhile\fR. .br See \fB\ STATEMENTS\fR. .TP .B -sbi\fIn\fB\fR, \fB--struct-brace-indentation\fIn\fB\fR Indent braces of a struct, union or enum N spaces. .br See \fB\ STATEMENTS\fR. .TP .B -sc\fR, \fB--start-left-side-of-comments\fR Put the \(oq*\(cq character at the left of comments. .br See \fB\ COMMENTS\fR. .TP .B -sob\fR, \fB--swallow-optional-blank-lines\fR Swallow optional blank lines. .br See \fB\ BLANK\ LINES\fR. .TP .B -ss\fR, \fB--space-special-semicolon\fR On one-line \fBfor\fR and \fBwhile\fR statements, force a blank before the semicolon. .br See \fB\ STATEMENTS\fR. .TP .B -st\fR, \fB--standard-output\fR Write to standard output. .br See \fB\ INVOKING\ INDENT\fR. .TP .B -T\fR Tell \fBindent\fR the name of typenames. .br See \fB\ DECLARATIONS\fR. .TP .B -ts\fIn\fB\fR, \fB--tab-size\fIn\fB\fR Set tab size to \fIn\fR spaces. .br See \fB\ INDENTATION\fR. .TP .B -ut\fR, \fB--use-tabs\fR Use tabs. This is the default. .br See \fB\ INDENTATION\fR. .TP .B -v\fR, \fB--verbose\fR Enable verbose mode. .br See \fB\ MISCELLANEOUS\ OPTIONS\fR. .TP .B -version\fR Output the version number of \fBindent\fR. .br See \fB\ MISCELLANEOUS\ OPTIONS\fR. .SH "INVOKING INDENT" As of version 1.3, the format of the \fBindent\fR command is: .in +5 .nf .na indent [\fIoptions\fR] [\fIinput-files\fR] indent [\fIoptions\fR] [\fIsingle-input-file\fR] [-o \fIoutput-file\fR] .in -5 .ad .fi This format is different from earlier versions and other versions of .B indent\fR. In the first form, one or more input files are specified. \fBindent\fR makes a backup copy of each file, and the original file is replaced with its indented version. See \fBBACKUP\ FILES\fR, for an explanation of how backups are made. In the second form, only one input file is specified. In this case, or when the standard input is used, you may specify an output file after the \(oq-o\(cq option. To cause \fBindent\fR to write to standard output, use the \(oq-st\(cq option. This is only allowed when there is only one input file, or when the standard input is used. If no input files are named, the standard input is read for input. Also, if a filename named \(oq-\(cq is specified, then the standard input is read. As an example, each of the following commands will input the program \(oqslithy_toves.c\(cq and write its indented text to \(oqslithy_toves.out\(cq: .in +5 .nf .na indent slithy_toves.c -o slithy_toves.out indent -st slithy_toves.c > slithy_toves.out cat slithy_toves.c | indent -o slithy_toves.out .in -5 .ad .fi Most other options to \fBindent\fR control how programs are formatted. As of version 1.2, \fBindent\fR also recognizes a long name for each option name. Long options are prefixed by either \(oq--\(cq or \(oq+\(cq. [ \(oq+\(cq is being superseded by \(oq--\(cq to maintain consistency with the POSIX standard.] In most of this document, the traditional, short names are used for the sake of brevity. See \fBOPTION\ SUMMARY\fR, for a list of options, including both long and short names. Here is another example: .in +5 .nf .na indent -br test/metabolism.c -l85 .in -5 .ad .fi This will indent the program \(oqtest/metabolism.c\(cq using the \(oq-br\(cq and \(oq-l85\(cq options, write the output back to \(oqtest/metabolism.c\(cq, and write the original contents of \(oqtest/metabolism.c\(cq to a backup file in the directory \(oqtest\(cq. Equivalent invocations using long option names for this example would be: .in +5 .nf .na indent --braces-on-if-line --line-length185 test/metabolism.c indent +braces-on-if-line +line-length185 test/metabolism.c .in -5 .ad .fi If you find that you often use \fBindent\fR with the same options, you may put those options into a file named \(oq.indent.pro\(cq. .B indent\fR will look for a profile file in three places. First it will check the environment variable \fBINDENT_PROFILE\fR. If that exists its value is expected to name the file that is to be used. If the environment variable does not exist, indent looks for \(oq.indent.pro\(cq in the current directory and use that if found. Finally \fBindent\fR will search your home directory for \(oq.indent.pro\(cq and use that file if it is found. This behaviour is different from that of other versions of .B indent\fR, which load both files if they both exist. The format of \(oq.indent.pro\(cq is simply a list of options, just as they would appear on the command line, separated by white space (tabs, spaces, and newlines). Options in \(oq.indent.pro\(cq may be surrounded by C or C++ comments, in which case they are ignored. Command line switches are handled \fIafter\fR processing \(oq .indent.pro\(cq. Options specified later override arguments specified earlier, with one exception: Explicitly specified options always override background options (See \fBCOMMON\ STYLES\fR). You can prevent \fBindent\fR from reading an \(oq.indent.pro\(cq file by specifying the \(oq-npro\(cq option. .SH "BACKUP FILES" As of version 1.3, GNU \fBindent\fR makes GNU-style backup files, the same way GNU Emacs does. This means that either \fIsimple\fR or .I numbered\fR backup filenames may be made. Simple backup file names are generated by appending a suffix to the original file name. The default for this suffix is the one-character string \(oq~\(cq (tilde). Thus, the backup file for \(oqpython.c\(cq would be \(oqpython.c~\(cq. Instead of the default, you may specify any string as a suffix by setting the environment variable \fBSIMPLE_BACKUP_SUFFIX\fR to your preferred suffix. Numbered backup versions of a file \(oqmomeraths.c\(cq look like \(oqmomeraths.c.~23~\(cq, where 23 is the version of this particular backup. When making a numbered backup of the file \(oqsrc/momeraths.c\(cq, the backup file will be named \(oqsrc/momeraths.c.~\fIV\fR~\(cq, where .I V\fR is one greater than the highest version currently existing in the directory \(oqsrc\(cq. The environment variable \fBVERSION_WIDTH\fR controls the number of digits, using left zero padding when necessary. For instance, setting this variable to "2" will lead to the backup file being named \(oqmomeraths.c.~04~\(cq. The type of backup file made is controlled by the value of the environment variable \fBVERSION_CONTROL\fR. If it is the string \(oqsimple\(cq, then only simple backups will be made. If its value is the string \(oqnumbered\(cq, then numbered backups will be made. If its value is \(oqnumbered-existing\(cq, then numbered backups will be made if there \fIalready exist\fR numbered backups for the file being indented; otherwise, a simple backup is made. If \fBVERSION_CONTROL\fR is not set, then \fBindent\fR assumes the behaviour of \(oqnumbered-existing\(cq. Other versions of \fBindent\fR use the suffix \(oq.BAK\(cq in naming backup files. This behaviour can be emulated by setting .B SIMPLE_BACKUP_SUFFIX\fR to \(oq.BAK\(cq. Note also that other versions of \fBindent\fR make backups in the current directory, rather than in the directory of the source file as GNU \fBindent\fR now does. .SH "COMMON STYLES" There are several common styles of C code, including the GNU style, the Kernighan & Ritchie style, and the original Berkeley style. A style may be selected with a single \fIbackground\fR option, which specifies a set of values for all other options. However, explicitly specified options always override options implied by a background option. As of version 1.2, the default style of GNU \fBindent\fR is the GNU style. Thus, it is no longer necessary to specify the option \(oq-gnu\(cq to obtain this format, although doing so will not cause an error. Option settings which correspond to the GNU style are: .in +5 .nf .na -nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2 -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob .in -5 .ad .fi The GNU coding style is that preferred by the GNU project. It is the style that the GNU Emacs C mode encourages and which is used in the C portions of GNU Emacs. (People interested in writing programs for Project GNU should get a copy of "The GNU Coding Standards", which also covers semantic and portability issues such as memory usage, the size of integers, etc.) The Kernighan & Ritchie style is used throughout their well-known book "The C Programming Language". It is enabled with the \(oq-kr\(cq option. The Kernighan & Ritchie style corresponds to the following set of options: .in +5 .nf .na -nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf -sai -saw -nsc -nsob -nss .in -5 .ad .fi Kernighan & Ritchie style does not put comments to the right of code in the same column at all times (nor does it use only one space to the right of the code), so for this style \fBindent\fR has arbitrarily chosen column 33. The style of the original Berkeley \fBindent\fR may be obtained by specifying \(oq-orig\(cq (or by specifying \(oq--original\(cq, using the long option name). This style is equivalent to the following settings: .in +5 .nf .na -nbad -nbap -bbo -bc -br -brs -c33 -cd33 -cdb -ce -ci4 -cli0 -cp33 -di16 -fc1 -fca -hnl -i4 -ip4 -l75 -lp -npcs -nprs -psl -saf -sai -saw -sc -nsob -nss -ts8 .in -5 .ad .fi The Linux style is used in the linux kernel code and drivers. Code generally has to follow the Linux coding style to be accepted. This style is equivalent to the following settings: .in +5 .nf .na -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1 .in -5 .ad .fi .SH "BLANK LINES" Various programming styles use blank lines in different places. .B indent\fR has a number of options to insert or delete blank lines in specific places. The \(oq-bad\(cq option causes \fBindent\fR to force a blank line after every block of declarations. The \(oq-nbad\(cq option causes .B indent\fR not to force such blank lines. The \(oq-bap\(cq option forces a blank line after every procedure body. The \(oq-nbap\(cq option forces no such blank line. The \(oq-bbb\(cq option forces a blank line before every boxed comment (See \fBCOMMENTS\fR.) The \(oq-nbbb\(cq option does not force such blank lines. The \(oq-sob\(cq option causes \fBindent\fR to swallow optional blank lines (that is, any optional blank lines present in the input will be removed from the output). If the \(oq-nsob\(cq is specified, any blank lines present in the input file will be copied to the output file. .SH "--blank-lines-after-declarations" The \(oq-bad\(cq option forces a blank line after every block of declarations. The \(oq-nbad\(cq option does not add any such blank lines. For example, given the input .in +5 .nf .na char *foo; char *bar; /* This separates blocks of declarations. */ int baz; .in -5 .ad .fi .B indent -bad\fR produces .in +5 .nf .na char *foo; char *bar; /* This separates blocks of declarations. */ int baz; .in -5 .ad .fi and \fBindent -nbad\fR produces .in +5 .nf .na char *foo; char *bar; /* This separates blocks of declarations. */ int baz; .in -5 .ad .fi .SH "--blank-lines-after-procedures" The \(oq-bap\(cq option forces a blank line after every procedure body. For example, given the input .in +5 .nf .na int foo () { puts("Hi"); } /* The procedure bar is even less interesting. */ char * bar () { puts("Hello"); } .in -5 .ad .fi .B indent -bap\fR produces .in +5 .nf .na int foo () { puts ("Hi"); } /* The procedure bar is even less interesting. */ char * bar () { puts ("Hello"); } .in -5 .ad .fi and \fBindent -nbap\fR produces .in +5 .nf .na int foo () { puts ("Hi"); } /* The procedure bar is even less interesting. */ char * bar () { puts ("Hello"); } .in -5 .ad .fi No blank line will be added after the procedure \fBfoo\fR. .SH "COMMENTS" .B indent\fR formats both C and C++ comments. C comments are begun with \(oq/*\(cq, terminated with \(oq*/\(cq and may contain newline characters. C++ comments begin with the delimiter \(oq//\(cq and end at the newline. .B indent\fR handles comments differently depending upon their context. .B indent\fR attempts to distinguish between comments which follow statements, comments which follow declarations, comments following preprocessor directives, and comments which are not preceded by code of any sort, i.e., they begin the text of the line (although not necessarily in column 1). .B indent\fR further distinguishes between comments found outside of procedures and aggregates, and those found within them. In particular, comments beginning a line found within a procedure will be indented to the column at which code is currently indented. The exception to this is a comment beginning in the leftmost column; such a comment is output at that column. .B indent\fR attempts to leave \fIboxed comments\fR unmodified. The general idea of such a comment is that it is enclosed in a rectangle or \(oq\(oqbox\(cq\(cq of stars or dashes to visually set it apart. More precisely, boxed comments are defined as those in which the initial \(oq/*\(cq is followed immediately by the character \(oq*\(cq, \(oq=\(cq, \(oq_\(cq, or \(oq-\(cq, or those in which the beginning comment delimiter (\(oq/*\(cq) is on a line by itself, and the following line begins with a \(oq*\(cq in the same column as the star of the opening delimiter. Examples of boxed comments are: .in +5 .nf .na /********************** * Comment in a box!! * **********************/ /* * A different kind of scent, * for a different kind of comment. */ .in -5 .ad .fi .B indent\fR attempts to leave boxed comments exactly as they are found in the source file. Thus the indentation of the comment is unchanged, and its length is not checked in any way. The only alteration made is that an embedded tab character may be converted into the appropriate number of spaces. If the \(oq-bbb\(cq option is specified, all such boxed comments will be preceded by a blank line, unless such a comment is preceded by code. Comments which are not boxed comments may be formatted, which means that the line is broken to fit within a right margin and left-filled with whitespace. Single newlines are equivalent to a space, but blank lines (two or more newlines in a row) are taken to mean a paragraph break. Formatting of comments which begin after the first column is enabled with the \(oq-fca\(cq option. To format those beginning in column one, specify \(oq-fc1\(cq. Such formatting is disabled by default. The right margin for formatting defaults to 78, but may be changed with the \(oq-lc\(cq option. If the margin specified does not allow the comment to be printed, the margin will be automatically extended for the duration of that comment. The margin is not respected if the comment is not being formatted. If the comment begins a line (i.e., there is no program text to its left), it will be indented to the column it was found in unless the comment is within a block of code. In that case, such a comment will be aligned with the indented code of that block (unless the comment began in the first column). This alignment may be affected by the \(oq-d\(cq option, which specifies an amount by which such comments are moved to the \fIleft\fR, or unindented. For example, \(oq-d2\(cq places comments two spaces to the left of code. By default, comments are aligned with code, unless they begin in the first column, in which case they are left there by default --- to get them aligned with the code, specify \(oq-fc1\(cq. Comments to the right of code will appear by default in column 33. This may be changed with one of three options. \(oq-c\(cq will specify the column for comments following code, \(oq-cd\(cq specifies the column for comments following declarations, and \(oq-cp\(cq specifies the column for comments following preprocessor directives \fB#else\fR and \fB#endif\fR. \(oq-dj\(cq together with \(oq-cd0\(cq can be used to suppress alignment of comments to the right of declarations, causing the comment to follow one tabstop from the end of the declaration. Normally \(oq-cd0\(cq causes \(oq-c\(cq to become effective. If the code to the left of the comment exceeds the beginning column, the comment column will be extended to the next tabstop column past the end of the code, or in the case of preprocessor directives, to one space past the end of the directive. This extension lasts only for the output of that particular comment. The \(oq-cdb\(cq option places the comment delimiters on blank lines. Thus, a single line comment like \fB/* Loving hug */\fR can be transformed into: .in +5 .nf .na /* Loving hug */ .in -5 .ad .fi Stars can be placed at the beginning of multi-line comments with the \(oq-sc\(cq option. Thus, the single-line comment above can be transformed (with \(oq-cdb -sc\(cq) into: .in +5 .nf .na /* * Loving hug */ .in -5 .ad .fi .SH "STATEMENTS" The \(oq-br\(cq or \(oq-bl\(cq option specifies how to format braces. The \(oq-br\(cq option formats statement braces like this: .in +5 .nf .na if (x > 0) { x--; } .in -5 .ad .fi The \(oq-bl\(cq option formats them like this: .in +5 .nf .na if (x > 0) { x--; } .in -5 .ad .fi If you use the \(oq-bl\(cq option, you may also want to specify the \(oq-bli\(cq option. This option specifies the number of spaces by which braces are indented. \(oq-bli2\(cq, the default, gives the result shown above. \(oq-bli0\(cq results in the following: .in +5 .nf .na if (x > 0) { x--; } .in -5 .ad .fi If you are using the \(oq-br\(cq option, you probably want to also use the \(oq-ce\(cq option. This causes the \fBelse\fR in an if-then-else construct to cuddle up to the immediately preceding \(oq}\(cq. For example, with \(oq-br -ce\(cq you get the following: .in +5 .nf .na if (x > 0) { x--; } else { fprintf (stderr, "...something wrong?\\n"); } .in -5 .ad .fi With \(oq-br -nce\(cq that code would appear as .in +5 .nf .na if (x > 0) { x--; } else { fprintf (stderr, "...something wrong?\\n"); } .in -5 .ad .fi This causes the \fBwhile\fR in a do-while loop to cuddle up to the immediately preceding \(oq}\(cq. For example, with \(oq-cdw\(cq you get the following: .in +5 .nf .na do { x--; } while (x); .in -5 .ad .fi With \(oq-ncdw\(cq that code would appear as .in +5 .nf .na do { x--; } while (x); .in -5 .ad .fi The \(oq-cli\(cq option specifies the number of spaces that case labels should be indented to the right of the containing \fBswitch\fR statement. The default gives code like: .in +5 .nf .na switch (i) { case 0: break; case 1: { ++i; } default: break; } .in -5 .ad .fi Using the \(oq-cli2\(cq that would become: .in +5 .nf .na switch (i) { case 0: break; case 1: { ++i; } default: break; } .in -5 .ad .fi The indentation of the braces below a case statement can be controlled with the \(oq-cbi\fIn\fR\(cq option. For example, using \(oq-cli2 -cbi0\(cq results in: .in +5 .nf .na switch (i) { case 0: break; case 1: { ++i; } default: break; } .in -5 .ad .fi If a semicolon is on the same line as a \fBfor\fR or \fBwhile\fR statement, the \(oq-ss\(cq option will cause a space to be placed before the semicolon. This emphasizes the semicolon, making it clear that the body of the \fBfor\fR or \fBwhile\fR statement is an empty statement. \(oq-nss\(cq disables this feature. The \(oq-pcs\(cq option causes a space to be placed between the name of the procedure being called and the \(oq(\(cq (for example, \fBputs\ ("Hi");\fR. The \(oq-npcs\(cq option would give \fBputs("Hi");\fR). If the \(oq-cs\(cq option is specified, \fBindent\fR puts a space between a cast operator and the object to be cast. The \(oq-ncs\(cq ensures that there is no space between the cast operator and the object. Remember that \fBindent\fR only knows about the standard C data types and so cannot recognise user-defined types in casts. Thus \fB(mytype)thing\fR is not treated as a cast. The \(oq-bs\(cq option ensures that there is a space between the keyword \fBsizeof\fR and its argument. In some versions, this is known as the \(oqBill_Shannon\(cq option. The \(oq-saf\(cq option forces a space between a \fBfor\fR and the following parenthesis. This is the default. The \(oq-sai\(cq option forces a space between a \fBif\fR and the following parenthesis. This is the default. The \(oq-saw\(cq option forces a space between a \fBwhile\fR and the following parenthesis. This is the default. The \(oq-prs\(cq option causes all parentheses to be separated with a space from whatever is between them. For example, using \(oq-prs\(cq results in code like: .in +5 .nf .na while ( ( e_code - s_code ) < ( dec_ind - 1 ) ) { set_buf_break ( bb_dec_ind ); *e_code++ = \(cq \(cq; } .in -5 .ad .fi .SH "DECLARATIONS" By default \fBindent\fR will line up identifiers, in the column specified by the \(oq-di\(cq option. For example, \(oq-di16\(cq makes things look like: .in +5 .nf .na int foo; char *bar; .in -5 .ad .fi Using a small value (such as one or two) for the \(oq-di\(cq option can be used to cause the identifiers to be placed in the first available position; for example: .in +5 .nf .na int foo; char *bar; .in -5 .ad .fi The value given to the \(oq-di\(cq option will still affect variables which are put on separate lines from their types, for example \(oq-di2\(cq will lead to: .in +5 .nf .na int foo; .in -5 .ad .fi If the \(oq-bc\(cq option is specified, a newline is forced after each comma in a declaration. For example, .in +5 .nf .na int a, b, c; .in -5 .ad .fi With the \(oq-nbc\(cq option this would look like .in +5 .nf .na int a, b, c; .in -5 .ad .fi The \(oq-bfda\(cq option causes a newline to be forced after the comma separating the arguments of a function declaration. The arguments will appear at one indention level deeper than the function declaration. This is particularly helpful for functions with long argument lists. The option \(oq-bfde\(cq causes a newline to be forced before the closing bracket of the function declaration. For both options the \(cqn\(cq setting is the default: -nbdfa and -nbdfe. For example, .in +5 .nf .na void foo (int arg1, char arg2, int *arg3, long arg4, char arg5); .in -5 .ad .fi With the \(oq-bfda\(cq option this would look like .in +5 .nf .na void foo ( int arg1, char arg2, int *arg3, long arg4, char arg5); .in -5 .ad .fi With, in addition, the \(oq-bfde\(cq option this would look like .in +5 .nf .na void foo ( int arg1, char arg2, int *arg3, long arg4, char arg5 ); .in -5 .ad .fi The \(oq-psl\(cq option causes the type of a procedure being defined to be placed on the line before the name of the procedure. This style is required for the \fBetags\fR program to work correctly, as well as some of the \fBc-mode\fR functions of Emacs. You must use the \(oq-T\(cq option to tell \fBindent\fR the name of all the typenames in your program that are defined by \fBtypedef\fR. \(oq-T\(cq can be specified more than once, and all names specified are used. For example, if your program contains .in +5 .nf .na typedef unsigned long CODE_ADDR; typedef enum {red, blue, green} COLOR; .in -5 .ad .fi you would use the options \(oq-T CODE_ADDR -T COLOR\(cq. The \(oq-brs\(cq or \(oq-bls\(cq option specifies how to format braces in struct declarations. The \(oq-brs\(cq option formats braces like this: .in +5 .nf .na struct foo { int x; }; .in -5 .ad .fi The \(oq-bls\(cq option formats them like this: .in +5 .nf .na struct foo { int x; }; .in -5 .ad .fi Similarly to the structure brace \(oq-brs\(cq and \(oq-bls\(cq options, the function brace options \(oq-brf\(cq or \(oq-blf\(cq specify how to format the braces in function definitions. The \(oq-brf\(cq option formats braces like this: .in +5 .nf .na int one(void) { return 1; }; .in -5 .ad .fi The \(oq-blf\(cq option formats them like this: .in +5 .nf .na int one(void) { return 1; }; .in -5 .ad .fi .SH "INDENTATION" One issue in the formatting of code is how far each line should be indented from the left margin. When the beginning of a statement such as \fBif\fR or \fBfor\fR is encountered, the indentation level is increased by the value specified by the \(oq-i\(cq option. For example, use \(oq-i8\(cq to specify an eight character indentation for each level. When a statement is broken across two lines, the second line is indented by a number of additional spaces specified by the \(oq-ci\(cq option. \(oq-ci\(cq defaults to 0. However, if the \(oq-lp\(cq option is specified, and a line has a left parenthesis which is not closed on that line, then continuation lines will be lined up to start at the character position just after the left parenthesis. This processing also applies to \(oq[\(cq and applies to \(oq{\(cq when it occurs in initialization lists. For example, a piece of continued code might look like this with \(oq-nlp -ci3\(cq in effect: .in +5 .nf .na p1 = first_procedure (second_procedure (p2, p3), third_procedure (p4, p5)); .in -5 .ad .fi With \(oq-lp\(cq in effect the code looks somewhat clearer: .in +5 .nf .na p1 = first_procedure (second_procedure (p2, p3), third_procedure (p4, p5)); .in -5 .ad .fi When a statement is broken in between two or more paren pairs (...), each extra pair causes the indentation level extra indentation: .in +5 .nf .na if ((((i < 2 && k > 0) || p == 0) && q == 1) || n = 0) .in -5 .ad .fi The option \(oq-ip\fIN\fR\(cq can be used to set the extra offset per paren. For instance, \(oq-ip0\(cq would format the above as: .in +5 .nf .na if ((((i < 2 && k > 0) || p == 0) && q == 1) || n = 0) .in -5 .ad .fi .B indent\fR assumes that tabs are placed at regular intervals of both input and output character streams. These intervals are by default 8 columns wide, but (as of version 1.2) may be changed by the \(oq-ts\(cq option. Tabs are treated as the equivalent number of spaces. The indentation of type declarations in old-style function definitions is controlled by the \(oq-ip\(cq parameter. This is a numeric parameter specifying how many spaces to indent type declarations. For example, the default \(oq-ip5\(cq makes definitions look like this: .in +5 .nf .na char * create_world (x, y, scale) int x; int y; float scale; { . . . } .in -5 .ad .fi For compatibility with other versions of indent, the option \(oq-nip\(cq is provided, which is equivalent to \(oq-ip0\(cq. ANSI C allows white space to be placed on preprocessor command lines between the character \(oq#\(cq and the command name. By default, .B indent\fR removes this space, but specifying the \(oq-lps\(cq option directs \fBindent\fR to leave this space unmodified. The option \(oq-ppi\(cq overrides \(oq-nlps\(cq and \(oq-lps\(cq. This option can be used to request that preprocessor conditional statements can be indented by to given number of spaces, for example with the option \(oq-ppi 3\(cq .in +5 .nf .na #if X #if Y #define Z 1 #else #define Z 0 #endif #endif .in -5 .ad .fi becomes .in +5 .nf .na #if X # if Y # define Z 1 # else # define Z 0 # endif #endif .in -5 .ad .fi This option sets the offset at which a label (except case labels) will be positioned. If it is set to zero or a positive number, this indicates how far from the left margin to indent a label. If it is set to a negative number, this indicates how far back from the current indent level to place the label. The default setting is -2 which matches the behaviour of earlier versions of indent. Note that this parameter does not affect the placing of case labels; see the \(oq-cli\(cq parameter for that. For example with the option \(oq-il 1\(cq .in +5 .nf .na group function() { if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; } .in -5 .ad .fi becomes .in +5 .nf .na group function() { if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; } .in -5 .ad .fi .SH "BREAKING LONG LINES" With the option \(oq-l\fIn\fR\(cq, or \(oq--line-length\fIn\fR\(cq, it is possible to specify the maximum length of a line of C code, not including possible comments that follow it. When lines become longer than the specified line length, GNU \fBindent\fR tries to break the line at a logical place. This is new as of version 2.1 however and not very intelligent or flexible yet. Currently there are two options that allow one to interfere with the algorithm that determines where to break a line. The \(oq-bbo\(cq option causes GNU \fBindent\fR to prefer to break long lines before the boolean operators \fB&&\fR and \fB||\fR. The \(oq-nbbo\(cq option causes GNU \fBindent\fR not have that preference. For example, the default option \(oq-bbo\(cq (together with \(oq--line-length60\(cq and \(oq--ignore-newlines\(cq) makes code look like this: .in +5 .nf .na if (mask && ((mask[0] == \(cq\\0\(cq) || (mask[1] == \(cq\\0\(cq && ((mask[0] == \(cq0\(cq) || (mask[0] == \(cq*\(cq))))) .in -5 .ad .fi Using the option \(oq-nbbo\(cq will make it look like this: .in +5 .nf .na if (mask && ((mask[0] == \(cq\\0\(cq) || (mask[1] == \(cq\\0\(cq && ((mask[0] == \(cq0\(cq) || (mask[0] == \(cq*\(cq))))) .in -5 .ad .fi The default \(oq-hnl\(cq, however, honours newlines in the input file by giving them the highest possible priority to break lines at. For example, when the input file looks like this: .in +5 .nf .na if (mask && ((mask[0] == \(cq\\0\(cq) || (mask[1] == \(cq\\0\(cq && ((mask[0] == \(cq0\(cq) || (mask[0] == \(cq*\(cq))))) .in -5 .ad .fi then using the option \(oq-hnl\(cq, or \(oq--honour-newlines\(cq, together with the previously mentioned \(oq-nbbo\(cq and \(oq--line-length60\(cq, will cause the output not to be what is given in the last example but instead will prefer to break at the positions where the code was broken in the input file: .in +5 .nf .na if (mask && ((mask[0] == \(cq\\0\(cq) || (mask[1] == \(cq\\0\(cq && ((mask[0] == \(cq0\(cq) || (mask[0] == \(cq*\(cq))))) .in -5 .ad .fi The idea behind this option is that lines which are too long, but are already broken up, will not be touched by GNU \fBindent\fR. Really messy code should be run through \fBindent\fR at least once using the \(oq--ignore-newlines\(cq option though. .SH "DISABLING FORMATTING" Formatting of C code may be disabled for portions of a program by embedding special \fIcontrol comments\fR in the program. To turn off formatting for a section of a program, place the disabling control comment \fB/* *INDENT-OFF* */\fR on a line by itself just before that section. Program text scanned after this control comment is output precisely as input with no modifications until the corresponding enabling comment is scanned on a line by itself. The disabling control comment is \fB/* *INDENT-ON* */\fR, and any text following the comment on the line is also output unformatted. Formatting begins again with the input line following the enabling control comment. More precisely, \fBindent\fR does not attempt to verify the closing delimiter (\fB*/\fR) for these C comments, and any whitespace on the line is totally transparent. These control comments also function in their C++ formats, namely .B // *INDENT-OFF*\fR and \fB// *INDENT-ON*\fR. It should be noted that the internal state of \fBindent\fR remains unchanged over the course of the unformatted section. Thus, for example, turning off formatting in the middle of a function and continuing it after the end of the function may lead to bizarre results. It is therefore wise to be somewhat modular in selecting code to be left unformatted. As a historical note, some earlier versions of \fBindent\fR produced error messages beginning with \fB*INDENT**\fR. These versions of .B indent\fR were written to ignore any input text lines which began with such error messages. I have removed this incestuous feature from GNU \fBindent\fR. .SH "MISCELLANEOUS OPTIONS" To find out what version of \fBindent\fR you have, use the command .B indent -version\fR. This will report the version number of .B indent\fR, without doing any of the normal processing. The \(oq-v\(cq option can be used to turn on verbose mode. When in verbose mode, \fBindent\fR reports when it splits one line of input into two more more lines of output, and gives some size statistics at completion. The \(oq-pmt\(cq option causes \fBindent\fR to preserve the access and modification times on the output files. Using this option has the advantage that running indent on all source and header files in a project won\(cqt cause \fBmake\fR to rebuild all targets. This option is only available on Operating Systems that have the POSIX \fButime(2)\fR function. .SH "BUGS" Please report any bugs to bug-indent@gnu.org. When \fBindent\fR is run twice on a file, with the same profile, it should \fInever\fR change that file the second time. With the current design of \fBindent\fR, this can not be guaranteed, and it has not been extensively tested. .B indent\fR does not understand C. In some cases this leads to the inability to join lines. The result is that running a file through \fBindent\fR is \fIirreversible\fR, even if the used input file was the result of running \fBindent\fR with a given profile (\(oq.indent.pro\(cq). While an attempt was made to get \fBindent\fR working for C++, it will not do a good job on any C++ source except the very simplest. .B indent\fR does not look at the given \(oq--line-length\(cq option when writing comments to the output file. This results often in comments being put far to the right. In order to prohibit \fBindent\fR from joining a broken line that has a comment at the end, make sure that the comments start on the first line of the break. .B indent\fR does not count lines and comments (see the \(oq-v\(cq option) when \fBindent\fR is turned off with .B /* *INDENT-OFF* */\fR. Comments of the form \fB/*UPPERCASE*/\fR are not treated as comment but as an identifier, causing them to be joined with the next line. This renders comments of this type useless, unless they are embedded in the code to begin with. .SH "COPYRIGHT" The following copyright notice applies to the \fBindent\fR program. The copyright and copying permissions for this manual appear near the beginning of \(oqindent.texinfo\(cq and \(oqindent.info\(cq, and near the end of \(oqindent.1\(cq. .nf .na Copyright (c) 2001 David Ingamells. Copyright (c) 1999 Carlo Wood. Copyright (c) 1995, 1996 Joseph Arceneaux. Copyright (c) 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED \(oq\(oqAS IS\(cq\(cq AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. .ad .fi .SH "Options\(cq Cross Key" Here is a list of options alphabetized by long option, to help you find the corresponding short option. .in +5 .nf .na --blank-lines-after-commas -bc --blank-lines-after-declarations -bad --blank-lines-after-procedures -bap --blank-lines-before-block-comments -bbb --braces-after-if-line -bl --braces-after-func-def-line -blf --brace-indent -bli --braces-after-struct-decl-line -bls --braces-on-if-line -br --braces-on-func-def-line -brf --braces-on-struct-decl-line -brs --break-after-boolean-operator -nbbo --break-before-boolean-operator -bbo --break-function-decl-args -bfda --break-function-decl-args-end -bfde --case-indentation -cli\fIn\fR --case-brace-indentation -cbi\fIn\fR --comment-delimiters-on-blank-lines -cdb --comment-indentation -c\fIn\fR --continuation-indentation -ci\fIn\fR --continue-at-parentheses -lp --cuddle-do-while -cdw --cuddle-else -ce --declaration-comment-column -cd\fIn\fR --declaration-indentation -di\fIn\fR --dont-break-function-decl-args -nbfda --dont-break-function-decl-args-end -nbfde --dont-break-procedure-type -npsl --dont-cuddle-do-while -ncdw --dont-cuddle-else -nce --dont-format-comments -nfca --dont-format-first-column-comments -nfc1 --dont-line-up-parentheses -nlp --dont-left-justify-declarations -ndj --dont-space-special-semicolon -nss --dont-star-comments -nsc --else-endif-column -cp\fIn\fR --format-all-comments -fca --format-first-column-comments -fc1 --gnu-style -gnu --honour-newlines -hnl --ignore-newlines -nhnl --ignore-profile -npro --indent-label -il\fIn\fR --indent-level -i\fIn\fR --k-and-r-style -kr --leave-optional-blank-lines -nsob --leave-preprocessor-space -lps --left-justify-declarations -dj --line-comments-indentation -d\fIn\fR --line-length -l\fIn\fR --linux-style -linux --no-blank-lines-after-commas -nbc --no-blank-lines-after-declarations -nbad --no-blank-lines-after-procedures -nbap --no-blank-lines-before-block-comments -nbbb --no-comment-delimiters-on-blank-lines -ncdb --no-space-after-casts -ncs --no-parameter-indentation -nip --no-space-after-for -nsaf --no-space-after-function-call-names -npcs --no-space-after-if -nsai --no-space-after-parentheses -nprs --no-space-after-while -nsaw --no-tabs -nut --no-verbosity -nv --original -orig --parameter-indentation -ip\fIn\fR --paren-indentation -pi\fIn\fR --preserve-mtime -pmt --preprocessor-indentation -ppi\fIn\fR --procnames-start-lines -psl --space-after-cast -cs --space-after-for -saf --space-after-if -sai --space-after-parentheses -prs --space-after-procedure-calls -pcs --space-after-while -saw --space-special-semicolon -ss --standard-output -st --start-left-side-of-comments -sc --struct-brace-indentation -sbi\fIn\fR --swallow-optional-blank-lines -sob --tab-size -ts\fIn\fR --use-tabs -ut --verbose -v .in -5 .ad .fi .SH "RETURN VALUE" Unknown .SH FILES .br .nf .\" set tabstop to longest possible filename, plus a wee bit .ta \w'$HOME/.indent.pro 'u \fI$HOME/.indent.pro\fR holds default options for indent. .SH "AUTHORS" .br Carlo Wood .br Joseph Arceneaux .br Jim Kingdon .br David Ingamells .SH "HISTORY" Derived from the UCB program "indent". .SH "COPYING" Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Copyright (C) 1995, 1996 Joseph Arceneaux. Copyright (C) 1999 Carlo Wood. Copyright (C) 2001 David Ingamells. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. indent-2.2.11/man/Makefile.in0000644000177400010010000004570011331327361012620 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = texinfo2man$(EXEEXT) subdir = man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/aclocal/UTIMBUF.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intdiv0.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_texinfo2man_OBJECTS = texinfo2man.$(OBJEXT) texinfo2man_OBJECTS = $(am_texinfo2man_OBJECTS) texinfo2man_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(texinfo2man_SOURCES) DIST_SOURCES = $(texinfo2man_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ texinfo2man_SOURCES = texinfo2man.c man_MANS = @PACKAGE@.1 EXTRA_DIST = $(man_MANS) @PACKAGE@.1.in # --------------- Maintainer's Section MAINTAINERCLEANFILES = @PACKAGE@.1 Makefile.in texinfo2man all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) texinfo2man$(EXEEXT): $(texinfo2man_OBJECTS) $(texinfo2man_DEPENDENCIES) @rm -f texinfo2man$(EXEEXT) $(LINK) $(texinfo2man_OBJECTS) $(texinfo2man_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texinfo2man.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 @PACKAGE@.1: ${srcdir}/@PACKAGE@.1.in ${srcdir}/../doc/@PACKAGE@.texinfo texinfo2man Makefile.am ./texinfo2man ${srcdir}/@PACKAGE@.1.in ${srcdir}/../doc/@PACKAGE@.texinfo > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: indent-2.2.11/man/texinfo2man.c0000644000177400010010000006231211276612333013153 00000000000000#include #include #include #include /* texinfo2man. * Convert a texinfo document to man format. * Author: Carlo Wood . * Copyright (c) 1999, 2000 Carlo Wood. All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, advertising * materials, and other materials related to such distribution and use * acknowledge that the software was developed by Carlo Wood. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * HISTORY * 2002 Jan 17 Carlo Wood. Fixed handling of @@ within an @email{}. */ int at_start_of_line = 1; int at_start_of_line_for_dot = 1; int to_upper = 0; int ignore = 0; int disabled = 0; int in_section = 0; int in_item = 0; int in_table = 0; int no_break = 0; int indentation = 0; int bold = 0; int underlined = 0; char *texinfoname; static char * where( int line_no) { static char b[256]; sprintf (b, "%s line %-3d", texinfoname, line_no); return b; } static void start_bold(void) { if (!bold && !underlined) { if (at_start_of_line) { printf (".B "); at_start_of_line_for_dot = 0; } else { printf ("\\fB"); at_start_of_line_for_dot = at_start_of_line; } at_start_of_line = 0; } ++bold; } static void stop_bold(void) { if (--bold == 0 && !underlined) { printf ("\\fR"); at_start_of_line_for_dot = at_start_of_line; at_start_of_line = 0; } } static void start_I(void) { if (!underlined) { if (at_start_of_line) { printf (".I "); at_start_of_line_for_dot = 0; } else { printf ("\\fI"); at_start_of_line_for_dot = at_start_of_line; } at_start_of_line = 0; } ++underlined; } static void stop_I(void) { if (--underlined == 0) { if (bold) { if (at_start_of_line) { printf (".B "); at_start_of_line_for_dot = 0; } else { printf ("\\fB"); at_start_of_line_for_dot = at_start_of_line; } } else { printf ("\\fR"); at_start_of_line_for_dot = at_start_of_line; } } at_start_of_line = 0; } static void putone( char c) { if (disabled || (in_item && c == ' ')) { return; } if (at_start_of_line_for_dot && c == '.') { if (!at_start_of_line) { printf (" ."); } else if (underlined) { printf (".I .\fI"); } else if (bold) { printf (".B .\fB"); } else { printf (" ."); } return; } if (c == '\'') { printf("\\(cq"); return; } if (c == '`') { printf("\\(oq"); return; } if (no_break && (c == '\n')) { c = ' '; } if (no_break && (c == ' ')) { putchar ('\\'); } if (to_upper) { c = toupper (c); } if (c == '\\') { putchar ('\\'); } putchar (c); at_start_of_line = at_start_of_line_for_dot = (c == '\n'); } /* Replacement stack */ int nr = 0; char * vars[256] = {NULL}; char * replacement[256] = {NULL}; int start_line[256] = {0}; static char value_updated[64] = ""; static char value_edition[64] = ""; static char value_version[64] = ""; static void process_texi( FILE * in) { char buf[1024]; int in_block = 0; int line_no = 0; while (fgets (buf, sizeof (buf), in)) { ++line_no; if (strncmp (buf, "@include ", 9) == 0) { FILE *in2; char *p = strchr (buf, '\n'); if (p) *p = 0; in2 = fopen (buf + 9, "r"); if (p) *p = '\n'; if (in2) { process_texi (in2); fclose (in2); } } else if (strncmp (buf, "@set ", 5) == 0) { char *p = strchr (buf, '\n'); if (p) *p = 0; if (!strncmp (buf + 5, "UPDATED ", 8)) strcpy (value_updated, buf + 13); if (!strncmp (buf + 5, "EDITION ", 8)) strcpy (value_edition, buf + 13); if (!strncmp (buf + 5, "VERSION ", 8)) strcpy (value_version, buf + 13); if (p) *p = '\n'; } if (strncmp (buf, "@c !BEGIN ", 10) == 0) { char *p = buf + 10; size_t len = strlen (p); if (nr == 256) exit (-1); vars[nr] = (char *) malloc (len + 1); replacement[nr] = (char *) malloc (131072); start_line[nr] = line_no + 1; strcpy (vars[nr], p); if ((p = strchr (vars[nr], '\n'))) *p = 0; if ((p = strchr (vars[nr], ' '))) *p = 0; in_block = 1; } else if (strncmp (buf, "@c !END", 7) == 0) { size_t len = strlen (replacement[nr]); if (replacement[nr][len - 1] == '\n') { replacement[nr][len - 1] = 0; --len; } in_block = 0; replacement[nr] = (char *) realloc (replacement[nr], len + 1); ++nr; } else if (in_block) { if (in_block == 1) { strcpy (replacement[nr], buf); in_block = 2; } else strcat (replacement[nr], buf); } } } int main( int argc, char *argv[]) { FILE *in; char buf[1024]; int line_no = 0; texinfoname = argv[2]; in = fopen (argv[2], "r"); process_texi (in); fclose (in); in = fopen (argv[1], "r"); while (fgets (buf, sizeof (buf), in)) { char *p; for (p = buf; *p; ++p) { if (*p != '@') { putchar (*p); } else { int i; for (i = 0; i < nr; ++i) { size_t len = strlen (vars[i]); if (strncmp (p + 1, vars[i], len) == 0 && p[len + 1] == '@') { int stack[16]; int *what = stack; int at_start_of_input_line = 1; char *q; *what = 0; p += strlen (vars[i]) + 1; line_no = start_line[i]; for (q = replacement[i]; *q; ++q) { if (*q != '@') { int was_at_start_of_input_line = at_start_of_input_line; at_start_of_input_line = (*q == '\n'); if (at_start_of_input_line) ++line_no; if (ignore) { continue; } if (in_section && *q == '\n') { in_section = 0; to_upper = 0; putone ('"'); } if (in_item && *q == '\n') { in_item = 0; stop_bold (); } if (in_table && *q == '\n') { continue; } if (*what && *q == '}') { switch (*what--) { case 6: to_upper = 0; --no_break; /* fall through */ case 1: if (!in_section) stop_bold (); break; case 2: putone ('"'); break; case 3: stop_I (); break; case 4: putone (']'); break; case 5: /* Emphasis */ /* putone('*'); */ stop_I (); break; case 7: putone ('\''); break; case 8: --no_break; break; case 9: break; } } else { if (in_table && was_at_start_of_input_line && !in_item) { putone ('\n'); /* Kludge :/ */ } putone (*q); } } else { if (at_start_of_input_line) { if (!strncmp (q, "@end ignore", 11) || !strncmp (q, "@end menu", 9) || !strncmp (q, "@end iftex", 10) || !strncmp (q, "@end tex", 8) || !strncmp (q, "@end direntry", 13)) { --ignore; if (!(q = strchr (q, '\n'))) { break; } ++line_no; continue; } else if (!strncmp (q, "@ignore\n", 8) || !strncmp (q, "@menu\n", 6) || !strncmp (q, "@iftex\n", 7) || !strncmp (q, "@tex\n", 5) || !strncmp (q, "@direntry\n", 10)) { ++ignore; if (!(q = strchr (q, '\n'))) { break; } ++line_no; continue; } else if (ignore) { continue; } else if (!strncmp (q, "@author ", 8)) { printf (".br\n"); q += 7; continue; } else if (!strncmp (q, "@example\n", 9) || !strncmp (q, "@smallexample\n", 14)) { if (!at_start_of_line) { putchar ('\n'); } printf (".in +5\n"); indentation += 5; printf (".nf\n.na\n"); q = strchr (q, '\n'); ++line_no; continue; } else if (!strncmp (q, "@end example", 12) || !strncmp (q, "@end smallexample", 17)) { if (!at_start_of_line) { putchar ('\n'); } printf (".in -5\n"); indentation -= 5; printf (".ad\n.fi\n"); q = strchr (q, '\n'); if (!q) { break; } ++line_no; continue; } else if (!strncmp (q, "@noindent", 9)) { if (indentation) { if (!at_start_of_line) { putchar ('\n'); } printf (".in -%d\n", indentation); at_start_of_line = at_start_of_line_for_dot = 1; indentation = 0; } q = strchr (q, '\n'); if (!q) { break; } ++line_no; continue; } else if (!strncmp (q, "@display\n", 9)) { if (!at_start_of_line) { putchar ('\n'); } printf (".nf\n.na\n"); q += 8; ++line_no; continue; } else if (!strncmp (q, "@end display", 12)) { if (!at_start_of_line) putchar ('\n'); printf (".ad\n.fi\n"); q = strchr (q, '\n'); if (!q) { break; } ++line_no; continue; } else if (!strncmp (q, "@section ", 9) || !strncmp (q, "@appendix ", 10) || !strncmp (q, "@subsection ", 12) || !strncmp (q, "@subheading ", 12)) { if (!at_start_of_line) { putchar ('\n'); } printf (".SH \""); at_start_of_line = at_start_of_line_for_dot = 0; in_section = 1; to_upper = 1; if (q[2] == 'e') { q += 8; } else if (q[2] == 'p') { q += 9; } else { q += 11; to_upper = 0; } continue; } else if (!strncmp (q, "@table", 6)) { in_table = 1; q = strchr (q, '\n'); ++line_no; continue; } else if (!strncmp (q, "@end table", 10)) { disabled = 0; in_table = 0; q = strchr (q, '\n'); if (!q) { break; } ++line_no; continue; } else if (!strncmp (q, "@item ", 6) || !strncmp (q, "@itemx ", 7)) { disabled = 0; if (in_table && q[5] == ' ') { if (!at_start_of_line) { putchar ('\n'); } if (in_table == 1) { in_table = 2; printf (".TP 4\n"); at_start_of_line = at_start_of_line_for_dot = 1; } else { printf (".TP\n"); at_start_of_line = at_start_of_line_for_dot = 1; } } if (in_table && q[5] == 'x') { printf (", "); at_start_of_line = at_start_of_line_for_dot = 0; } in_item = 1; q = strchr (q, ' '); start_bold (); continue; } } else if (ignore) { continue; } if (!strncmp (q, "@code{", 6) || !strncmp (q, "@env{", 5) || !strncmp (q, "@command{", 9)) { if (!in_section) { start_bold (); } *++what = 1; if (q[1] == 'e') { q += 4; } else if (q[3] == 'd') { q += 5; } else { q += 8; } } else if (!strncmp (q, "@samp{", 6) || !strncmp (q, "@option{", 8) || !strncmp (q, "@file{", 6)) { putone ('`'); *++what = 7; if (q[1] == 'o') { q += 7; } else { q += 5; } } else if (!strncmp (q, "@cite{", 6)) { putone ('"'); *++what = 2; q += 5; } else if (!strncmp (q, "@var{", 5) || !strncmp (q, "@dfn{", 5)) { start_I (); *++what = 3; q += 4; } else if (!strncmp (q, "@copyright{}", 12)) { printf ("(c)"); q += 11; } else if (!strncmp (q, "@value{UPDATED}", 15)) { printf ("%s", value_updated); q += 14; } else if (!strncmp (q, "@value{VERSION}", 15)) { printf ("%s", value_version); q += 14; } else if (!strncmp (q, "@value{EDITION}", 15)) { printf ("%s", value_edition); q += 14; } else if (!strncmp (q, "@refill", 7)) { q += 6; } else if (!strncmp (q, "@footnote{", 10)) { if (!at_start_of_line) { putone (' '); } putone ('['); *++what = 4; q += 9; } else if (!strncmp (q, "@emph{", 6)) { /* putone('*'); */ start_I (); *++what = 5; q += 5; } else if (!strncmp (q, "@xref{", 6) || !strncmp (q, "@pxref{", 7)) { if (!disabled) { printf ("See "); at_start_of_line = at_start_of_line_for_dot = 0; start_bold (); to_upper = 1; ++no_break; *++what = 6; } if (q[1] == 'p') { q += 6; } else { q += 5; } } else if (!strncmp (q, "@w{", 3)) { ++no_break; *++what = 8; q += 2; } else if (!strncmp (q, "@email{", 7)) { *++what = 9; q += 6; } else if (!strncmp (q, "@{", 2)) { putone ('{'); ++q; } else if (!strncmp (q, "@}", 2)) { putone ('}'); ++q; } else if (!strncmp (q, "@*", 2)) { if (!at_start_of_line_for_dot) { putchar ('\n'); } printf (".br\n"); at_start_of_line = at_start_of_line_for_dot = 1; ++q; } else if (!strncmp (q, "@@", 2)) { putone ('@'); ++q; } else { char *s = strchr (q, ' '); char *a = strchr (q, '{'); if (!s || !a || s < a) { char *q2 = strchr (q, '\n'); if (strncmp (q, "@ifinfo", 7) && strncmp (q, "@end ifinfo", 11) && strncmp (q, "@cindex", 7) && strncmp (q, "@kindex", 7) && strncmp (q, "@refill", 7) && strncmp (q, "@include", 8) && strncmp (q, "@set", 4) && strncmp (q, "@group", 6) && strncmp (q, "@end group", 10) && strncmp (q, "@node", 5) && strncmp (q, "@comment", 8) && strncmp (q, "@c\n", 3) && strncmp (q, "@c ", 3) && strncmp (q, "@need", 5) && strncmp (q, "@dircategory", 12)) { if (a) { *a = 0; } if (q2) { *q2 = 0; } fprintf (stderr, "%s: Unknown texinfo command %s\n", where (line_no), q); if (a) { *a = '{'; } } q = q2; ++line_no; if (!q) { break; } continue; } } } } break; } } if (i == nr) { putone ('@'); } } } } return 0; } indent-2.2.11/aclocal/0000777000177400010010000000000011331331065011450 500000000000000indent-2.2.11/aclocal/UTIMBUF.m40000644000177400010010000000121710775646104012760 00000000000000dnl dnl Macro: indent_UTIMBUF dnl dnl Check if we have `struct utimbuf'. dnl AC_DEFUN([indent_UTIMBUF], [dnl Do we have a working utime.h? AC_CACHE_CHECK([if struct utimbuf needs -posix], unet_cv_sys_utimbuf_needs_posix, [AC_TRY_COMPILE([#include #include ], [struct utimbuf buf;], unet_cv_sys_utimbuf_needs_posix=no, [OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -posix" AC_TRY_COMPILE([#include #include ], [struct utimbuf buf;], unet_cv_sys_utimbuf_needs_posix=yes, unet_cv_sys_utimbuf_needs_posix=no) CFLAGS="$OLDCFLAGS" ])]) if test $unet_cv_sys_utimbuf_needs_posix = yes; then CFLAGS="$CFLAGS -posix" fi]) indent-2.2.11/miscel/0000777000177400010010000000000011331331065011326 500000000000000indent-2.2.11/miscel/vaxc-make.com0000644000177400010010000000254510775646104013642 00000000000000$!XXXXXXXXXXXXXXXXXXXXXXXX FILE VAXC-MAKE.COM XXXXXXXXXXXXXXXXXXXXXXXXX $!++ $! BCOPY from GNU Sources, This module is not included in $! VAXCRTL. $!-- $ ON WARNING THEN CONTINUE $ MACRO/OBJ=BCOPY.OBJ SYS$INPUT .TITLE BCOPY Copy bytes from one array to another .IDENT /1.00/ .PSECT $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT ; bcopy(from, to, size) .ENTRY BCOPY,^M MOVL 4(AP),R1 MOVL 8(AP),R3 MOVL 12(AP),R6 CMPL R1,R3 BGTR 2$ ; NORMAL FORWARD CASE BLSS 3$ ; OVERLAPPING, MUST DO BACKWARDS RET ; EQUAL, NOTHING TO DO 1$: SUBL2 R0,R6 MOVC3 R0,(R1),(R3) 2$: MOVZWL #65535,R0 CMPL R6,R0 BGTR 1$ MOVC3 R6,(R1),(R3) RET 3$: ADDL2 R6,R1 ADDL2 R6,R3 MOVZWL #65535,R0 BRW 5$ 4$: SUBL2 R0,R6 SUBL2 R0,R1 SUBL2 R0,R3 MOVC3 R0,(R1),(R3) MOVZWL #65535,R0 SUBL2 R0,R1 SUBL2 R0,R3 5$: CMPL R6,R0 BGTR 4$ SUBL2 R6,R1 SUBL2 R6,R3 MOVC3 R6,(R1),(R3) RET .END $ COMPILE :== "CC" $ COMPILE ARGS.C $ COMPILE BACKUP.C $ COMPILE GLOBS.C $ COMPILE INDENT.C $ COMPILE IO.C $ COMPILE LEXI.C $ COMPILE MEMCPY.C $ COMPILE PARSE.C $ COMPILE COMMENTS.C $ LINK INDENT,ARGS,BACKUP,GLOBS,IO, - LEXI,MEMCPY,PARSE,PR_COMMENT,BCOPY, - SYS$INPUT/OPT SYS$LIBRARY:VAXCRTL.EXE/SHARE $!XXXXXXXXXXXXXXXXXXXXXXXXXXX END OF FILE VAXC-MAKE.COM XXXXXXXXXXXXXXXXXXXXXXXXXXX indent-2.2.11/miscel/README.VMS0000644000177400010010000000271111331327557012602 00000000000000README.VMS for GNU `indent' 2.2.11 ---------------------------------- This file describes how to build indent under VMS. ---- Date: Mon, 29 Nov 1999 09:43:01 -0600 From: forrest.cahoon@merrillcorp.com Subject: VMS/DECC [...] DECC is the default compiler for VMS these days, superceding VAXC. [...] VMSers should be able to just rename config.h.vms to config.h and run @make-decc. ---- Date: long long ago From: MEHRDAD@glum.dev.cf.ac.uk Subject: VMS/VAXC and gcc If you are using GCC, you should run GNUC-MAKE.COM. If you have VAXC on your machine, run VAXC-MAKE.COM, to create indent.exe. When compiling INDENT sources, VAXC will issue warning messages about the length of some external identifiers. You can ignore these warnings. Set up symbol INDENT as a foreign command, for example: INDENT :== "$DUA0:[INDENT-DIR]INDENT.EXE" POSSIBLE PROBLEMS The function for reading, `read', is defined by the macro SYS_READ. By default under VMS, this is defined to be the functions `vms_read' defined in code_io.c. People have sent me various versions of this function, with differring semantics. I have no way of testing these, so I have done my best to 1) ensure the correctness of the function, and 2) use the algorithm most folks seem to suggest. If you experience problems in the read function, you might try using the plain, system read. You can also sent me a bug report, if you think you have a clue to the problem. See the file README for reporting bugs. ---- indent-2.2.11/miscel/README.vc++0000644000177400010010000000344611331327557012701 00000000000000README.VC++ for GNU `indent' 2.2.11 ---------------------------------- This file contains instructions for compiling GNU indent on the Win32 platform, and, in particular, Microsoft Visual C++ version 6.0 (though it may compile happily on earlier releases, this has not been tested) There are a couple of methods of compiling it - either from the command line or from within Visual C++ itself Preparation steps ----------------- 1. As Win32 has no equivalent of the 'configure' shell script, it is necessary to manually create the config.h file yourself. This can be done by renaming 'config.vc++' to 'config.h'. These options are sufficient for VC++ 6. If you are having problems compiling on an earlier releases, this file may be the place to look and modify the #defines. Compilation procedure --------------------- For both methods first move the file miscel/indent.dsp to the src directory. Option 1 - From within Visual C++ 1. Open the project file ('indent.dsp') 2. Select a Debug or Release build 3. Build. The final destination of indent.exe may be dependant on your configuration. Option 2 - From the command line (Visual C++ 6.0 and later) 1. Ensure your PATH is setup to correctly find the Visual C++ directories. This can be achieved by running x:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT (where x: is the drive VC++ is installed on) 2. At the command prompt, and from the indent distribution directory, run the following command: msdev indent.dsp /MAKE "indent - Win32 Release" Notes ----- The 'indent.exe' compiled under Visual C++ 6.0 has been tested successfully on Windows 95, 98, NT 4 and 2000. Contact ------- If you have any issues regarding compilation on Win32, please contact me at ben@parisoffice.com - Ben Bourner 28 September 1999 indent-2.2.11/miscel/Makefile.mingw320000644000177400010010000000106510776162746014215 00000000000000 # # Simple makefile to make indent on win32 systems. # Requires: # - gcc (mingw32) # - Unixlike make (preferably gmake) # # Sudhi Herle (sherle@sta.samsung.com) # OBJS = \ args.o \ backup.o \ comments.o \ globs.o \ indent.o \ io.o \ lexi.o \ parse.o \ wildexp.o CC = gcc DEFS = -DWIN32 -D_CONSOLE -DHAVE_CONFIG_H CFLAGS = -mno-cygwin -s -O6 $(DEFS) all: indent.exe indent.exe: $(OBJS) $(CC) -o $@ $(OBJS) $(OBJS): config.h config.h: ..\miscel\config.h.vc++ copy $< $@ clean: -del *.o indent.exe indent-2.2.11/miscel/makefile.watcom0000644000177400010010000000056310776162746014263 00000000000000OBJ = src\args.obj src\backup.obj src\comments.obj src\globs.obj src\indent.obj src\io.obj src\lexi.obj src\parse.obj src\wildexp.obj .BEFORE : @set WCC386=/zq /oneatx /oh /ei /zp8 /6 /fp6 -bt=nt -DHAVE_CONFIG_H -i=intl indent.exe : $(OBJ) wlink name indent.exe sys nt op q FIL *.obj .c : src .c.obj : .AUTODEPEND wcc386 $[@ -fo=$^@ indent-2.2.11/miscel/make-decc.com0000644000177400010010000000126110775646104013571 00000000000000$ cc/prefix=all/define=HAVE_CONFIG_H/warnings=(disable=LONGEXTERN) args.c $ cc/prefix=all/define=HAVE_CONFIG_H/warnings=(disable=LONGEXTERN) backup.c $ cc/prefix=all/define=HAVE_CONFIG_H/warnings=(disable=LONGEXTERN) comments.c $ cc/prefix=all/define=HAVE_CONFIG_H/warnings=(disable=LONGEXTERN) globs.c $ cc/prefix=all/define=HAVE_CONFIG_H/warnings=(disable=LONGEXTERN) indent.c $ cc/prefix=all/define=HAVE_CONFIG_H/warnings=(disable=LONGEXTERN) code_io.c $ cc/prefix=all/define=HAVE_CONFIG_H/warnings=(disable=LONGEXTERN) lexi.c $ cc/prefix=all/define=HAVE_CONFIG_H/warnings=(disable=LONGEXTERN) parse.c $ link/exe=indent.exe - args, backup, comments, globs, indent, code_io, lexi, parse indent-2.2.11/miscel/gnuc-make.com0000644000177400010010000000105010775646104013623 00000000000000$!XXXXXXXXXXXXXXXXXXXXXXXXXXXXX FILE GNUC-MAKE.COM XXXXXXXXXXXXXXXXXXXXXXXXXXXXX $ COMPILE :== "GCC" $ COMPILE ARGS.C $ COMPILE BACKUP.C $ COMPILE GLOBS.C $ COMPILE INDENT.C $ COMPILE IO.C $ COMPILE LEXI.C $ COMPILE MEMCPY.C $ COMPILE PARSE.C $ COMPILE COMMENTS.C $ LINK INDENT,ARGS,BACKUP,GLOBS,IO, - LEXI,MEMCPY,PARSE,PR_COMMENT, - GNU_CC:[000000]OPTIONS_SHR.OPT/OPT $!XXXXXXXXXXXXXXXXXXXXXXXXXXXXX END OF FILE GNUC-MAKE.COM XXXXXXXXXXXXXXXXXXXXXXXXX indent-2.2.11/configure.ac0000644000177400010010000000307611331327131012261 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(GNU Indent, 2.2.11, bug-indent@gnu.org) AC_CONFIG_SRCDIR(src/indent.c) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE(indent, 2.2.11) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_AIX AC_MINIX dnl Checks for UNIX variants that set DEFS, AC_ISC_POSIX dnl Checks for compiler output filename suffixes. AC_EXEEXT AC_OBJEXT dnl Checks for typedefs, structures, and compiler characteristics. dnl AM_C_PROTOTYPES AC_C_CONST dnl Check for tools needed for formatting the documentation. ac_aux_dir_abs=`cd $ac_aux_dir && pwd` AC_PATH_PROG(DVIPS, dvips, $ac_aux_dir_abs/missing dvips) AC_PATH_PROG(TEXI2PDF, texi2pdf, $ac_aux_dir_abs/missing texi2pdf) AC_PATH_PROG(TEXI2HTML, texi2html, $ac_aux_dir_abs/missing texi2html) dnl These are the only lines required to internationalize the package. dnl (OK, not quite, the AC_OUTPUT has also some parts.) AM_GNU_GETTEXT AM_GNU_GETTEXT_VERSION(0.11.5) AH_TEMPLATE(HAVE_LC_MESSAGES) AH_TEMPLATE(ENABLE_NLS) AH_TEMPLATE(HAVE_GETTEXT) AH_TEMPLATE(HAVE_CATGETS) AH_TEMPLATE(HAVE_STPCPY) localedir=${datadir}/locale AC_SUBST(localedir) AC_HEADER_STDC AC_CHECK_FUNCS(strchr memcpy memmove utime) AC_CHECK_HEADERS(unistd.h string.h malloc.h utime.h sys/utime.h) if test "$ac_cv_func_utime" = yes ; then if test "$ac_cv_header_utime_h" = yes ; then indent_UTIMBUF fi fi AC_HEADER_DIRENT AC_OUTPUT([ intl/Makefile po/Makefile.in Makefile src/Makefile doc/Makefile man/Makefile ], [touch Makefile.in]) indent-2.2.11/aclocal.m40000644000177400010010000011067611331327351011644 00000000000000# generated automatically by aclocal 1.11 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, [m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([aclocal/UTIMBUF.m4]) m4_include([m4/codeset.m4]) m4_include([m4/gettext.m4]) m4_include([m4/glibc21.m4]) m4_include([m4/iconv.m4]) m4_include([m4/intdiv0.m4]) m4_include([m4/inttypes-pri.m4]) m4_include([m4/inttypes.m4]) m4_include([m4/inttypes_h.m4]) m4_include([m4/isc-posix.m4]) m4_include([m4/lcmessage.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/progtest.m4]) m4_include([m4/stdint_h.m4]) m4_include([m4/uintmax_t.m4]) m4_include([m4/ulonglong.m4]) indent-2.2.11/ChangeLog-19900000644000177400010010000003424710775646104012170 00000000000000Thu Jan 3 14:35:15 1991 Richard Stallman (rms at mole.ai.mit.edu) * lexi.c (lexi): Recognize <<= and >>= as a single token. Sat Mar 17 17:43:45 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) * Version 1.1.3. * indent.c (main, case ident): Only treat thing as decl if parser_state_tos->p_l_follow == 0 as well as parser_state_tos->in_decl. * indent.c (main, case decl): Only indent parameters if parser_state_tos->p_l_follow == 0. * indent_globs.h (parser_state): Add field noncast_mask. indent.c (main, case lparen): Replace code of 21 Feb with code to set or clear bit in parser_state_tos->noncast_mask. lexi.c (lexi, case rw_decl & rw_struct_like): Check noncast_mask. Wed Feb 21 16:49:24 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) * indent.c (main, case lparen): At end, set not_cast (need to think about this more. when to clear it. does it need to be a mask type thing). * pr_comment.c (pr_comment): Indent comments in K&R1 style parameter declaration. Tue Jan 23 21:04:31 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) * lexi.c (is_reserved): Check if len == strlen (s). Thu Jan 11 13:12:15 1990 Jim Kingdon (kingdon at mole) * lexi.c (lexi): In procname loop, start scanning after '('. * indent.c (main): Change 0 to false in one place. * args.c: Remove declaration of index() (never used). Mon Jan 8 20:52:21 1990 Jim Kingdon (kingdon at pogo) * lexi.c (lexi): Rewrite loop that looks for procname so that it deals with stuff (e.g. '\n', '(') between (). Fri Dec 29 20:05:45 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * io.c (fill_buffer): Compare against in_prog_size to detect end of file when scanning for \n. Thu Dec 28 18:13:35 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * io.c (fill_buffer): Check p - in_prog not just p against in_prog_size. * lexi.c (lexi, user_specials lookup): Set p to NULL if not found. Mon Dec 18 15:49:44 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * io.c (fill_buffer): Compare against in_prog_size to detect EOF rather than looking for '\0'. Sun Dec 17 13:55:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * lexi.c (lexi): Call diag correctly on "x=-1". Also only call it ambiguous if it is (+,-,*,&). Sat Dec 16 15:36:17 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) * lexi.c (lexi): Remove extraneous unmatched ')' that prevented the file from compiling. Thu Dec 14 15:24:58 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * lexi.c (lexi): print warning for "x=-1". Thu Nov 30 22:39:42 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * ident.c (main): Initialize all fields of parser_state_tos. * indent_globs.h, indent.c, io.c, pr_comment.c: Move out_coms, out_lines, and com_lines out of struct parser_state. * lexi.c (lexi): Remove unused variables tok and j. * globs.c (xmalloc) [DEBUG]: Fill allocated memory with junk. Wed Nov 1 11:01:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * parse.c (parse_lparen_in_decl): New function. indent.c (main, case lparen): Call parse_lparen_in_decl. * Move definition of break_comma from args.c to indent.c Tue Oct 31 11:07:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * args.c (pro, "gnu"): Change -di1 to -di2. indent.texinfo: Add to description of -di. Wed Oct 11 15:32:49 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * lexi.c (lexi): Check for user_specials keywords as well as is_reserved. Tue Oct 10 17:20:36 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * lexi.c (addkey): Don't write past end of user_specials. * lexi.c (addkey): Remove test for 0 return from xmalloc. * lexi.c (lexi): Handle "<<=". Thu Oct 5 14:50:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * many: Make all variables "extern" in indent_globs.h and define them in files associated with their function. * indent_globs.h: Comment out Mon Oct 2 13:49:01 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * indent.c (indent, "the turkey..."): Do not put a space before the comment if it is the first thing on the line. Mon Sep 25 12:42:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * globs.c (x{m,re}alloc): Change long to unsigned. * args.c (set_profile): Add ONE_DOT_PER_FILENAME stuff. * args.c (set_profile): Check for null return from getenv("HOME"). Mon Sep 11 20:03:56 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * Indent 1.1 released. * io.c (diag): Add "char *msg". * Makefile (indent.tar.Z): Use -h. * Makefile (indent.tar.Z): Fix so it uses dist-indent. Tue Sep 5 21:11:00 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * indent.c (main, case lparen): Do not call dump_line on '{' if line is empty. Sun Sep 3 13:37:17 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * args.c: Remove PRO_STDIN and have -st just set use_stdinout. indent.c (main): Check use_stdinout. indent_globs.h: Add use_stdinout * indent.c (main, case lbrace): Set parser_state_tos->in_or_st to false. Sat Sep 2 20:53:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * parse.c (reduce): Tidy up comment before reduce. * lexi.c (lexi): Change (*tp == ';') to (*tp == ';' || *tp == ',') * lexi.c: Change #include "ctype.h" to #include * io.c (count_spaces): Replace quoted actual ^H in source file with 010. * various: Remove formfeeds (and one spurious ^\ that snuck into a comment in parse.c). * io.c (dump_line): Convert random text after #else and #endif to comments. * various: Remove unnecessary semicolons after "}". * indent.c (main, case comment) Remove unnecesary label proc_comment. * indent.c (main): Allow space between '#' and preprocessor directives (two changes: 1. skip over the space; 2. change strncmp's with "#if", "#else", and "#endif" to compare with "if", etc. instead.). * indent.c (main): Break declarations after comma if the declaration is getting too long. * args.c (set_option, PRO_INT): Check for !isdigit, not just for end of string. * args.c (option_source): Add variable and code using it. * indent.c (main, search_brace, case lbrace): Put braces around "else" code in "if (btype_2)". Thu Aug 31 20:25:27 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * indent_globs.h: Replace check_size with check_{code,com,lab}_size. everywhere: Replace calls to check_size with calls to check_{code,com,lab}_size. * indent.c (main, case rparen): Do not set last_token_ends_sp if it is the while of a do-while. * indent.c (main, search_brace, case lbrace): If not BTYPE_2, put '{' at end of save_com. * indent.c (main): Dynamically allocate di_stack. * globs.c, indent_globs.h (mymemcpy): New function. indent.c: Use it instead of memcpy. * indent.c (main, case lparen): if encountered '{' in initializer list, force it to a new line. Tue Aug 22 01:12:53 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * indent.c (main, case comment): Check for end of file (indicating an unclosed comment). * args.c (pro, "gnu"): change -di0 to -di1. * lexi.c: Use gperf. Thu Aug 10 18:21:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * indent.c (bakcopy): Use mode 0666 for creat * indent.c (indent, case newline): Add "else_or_endif = false;" Sun Aug 6 17:32:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * indent.texinfo (Comments): Clarify that -gnu and -kr include -nfca. Thu Aug 3 18:23:17 1989 Jim Kingdon (kingdon at susie) * args.c (pro): Added flags -cs, -ncs. indent_globs.h: Added variable cast_space indent.c (main) at rparen: Add test for cast and cast_space. indent.texinfo (Statements, Option summary): Document -cs. * lexi.c (lexi): In the code that checks for keywords, comment out performance hack that doesn't work right. * indent.c (main): Don't set parser_state_tos->last_token if the token is a formfeed. * io.c (read_stdin): Remove unused variables i and pos. * indent.c (main): Remove unnecessary label do_binary. * many places: Clean up int<->enum conversions to avoid compiler warnings (and to make debugging easy by declaring everything as an enum which should be one). * indent.c (main): Initialize last_token_ends_sp to 0. * io.c (read_stdio): Change ch from char to int so that EOF will work when it doesn't fit in a char. Wed Aug 2 18:37:10 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * lexi.c (specials): Correct misspelling of "typedef". Sat Jul 15 19:37:56 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * globs.c: Change copyright notice to be consistent with other files. Wed Jul 12 00:16:59 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * Makefile: Change it so that all files in the tar file are in a directory dist-indent. * Remove LIBC from Makefile. * Released GNU indent 1.0 * io.c: Remove #ifdef USG and always include . * version.h: New file containing version number. Makefile: Add version.h. args.c (pro, set_option): Add -version option and PRO_PRSTRING. indent.texinfo (Miscellaneous options): Document -version. Tue Jul 4 22:19:36 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * indent.c (main): Put call to bakcopy() inside if (output == 0) * io.c: Include rather than (#ifdef USG) * indent_globs.h, io.c, lexi.c: Replace realloc with xrealloc * indent_globs.h, parse.c, args.c, io.c: Remove function prototypes, void *, (read_file)variable size array. Mon Jul 3 15:04:29 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * Everywhere: use xrealloc and xmalloc instead of realloc and malloc. * globs.c: Give the program name in the error messages. * io.c (diag): Change error messages to : : form. * lexi.c (lexi): Rewrite string/character constant copying loop to fix problems with backslashes. Change error message for unterminated constant to use terminology consistent with K&R and to use the diag routine. Sun Jul 2 16:51:23 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * parse.c (parse): Replaced parser_state_tos->tos++ with inc_pstack in one place it had been missed before. * parse.c, indent_globs.h: Move Inc_pstack to parse.c and make it a function to facilitate debugging (it is probably getting a bit big to be inline anyway). * indent_globs.h: Have all of the parser stacks (p_stack, il, and cstk) share a common allocated size (p_stack_size). (Inc_pstack) realloc them all, not just p_stack. indent.c (main): Change all references to {il,cstk}_size to p_stack_size. * indent.c (main): In initialization of parser_state_tos->p_stack, etc., multiply size given to malloc by sizeof (@var{whatever}). * indent_globs.h (Inc_pstack): multiply size given to realloc by sizeof (enum codes). * indent.c (main): In the main case statement, in the lparen case, change parser_state_tos->p_stack = xrealloc(parser_state_tos, . . . to . . . xrealloc (parser_state_tos->p_stack, . . . ^^^^^^^^^ This fixes a bug which caused core dumps. Sat Jul 1 23:02:50 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * args.c: Add -kr option to pro. Fri Jun 30 14:06:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) (actually these changes were made some time ago) * indent.c: Treat va_dcl specially so we indent it right. * lexi.c (lexi): Make it so that initializations will get lined up correctly by uncommenting out code that says code = ps.block_init ? lparen : lbrace; * indent_codes.h: eliminated and put into indent_globs.h. Converted from #defines to enum. lexi.c, parse.c, indent.c, perhaps others: various variables changed to enum codes from int. * args.c: Add explicit flag to pro, and to set_option(). Add support for PRO_SETTINGS. Streamline pro to eliminate PRO_SPECIAL. Use enum for PRO_*. * indent.c (bakcopy): Give error from perror instead of vague error message. * indent.c (bakcopy): bakfile dynamically allocated. * io.c (dump_line): fix bug involving a formfeed on a line of its own. * io.c (read_file, fill_buffer): read input file into memory. change token, procname to be a pointer into input file. indent.c (main): use token as pointer into input file. Move troff mode string constant stuff here from fill_buffer. io.c, indent.c: change save_com to be realloc'd as necessary. * indent.c (main): Change it so 'indent foo bar baz' gives an error message without clobbering bar. Tue Jun 27 03:10:53 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) Note: Up until this point this ChangeLog is fairly sketchy. From here on I promise to log all changes. * all files: Change the parser_state structure and the stack of parser states to be a dynamically allocated linked list instead of a 5 member structure. Also change the p_stack, il, cstk, and paren_indents arrays within the parser state to be dynamically allocated and realloc'd as necessary. Wed Jun 21 21:28:37 1989 Roland McGrath (roland at hobbes.ai.mit.edu) * indent_globs.h: Use ANSI token pasting #ifdef __STDC__. (check_size): Check the return value of realloc and exit if it's nil. * lexi.c (user_specials{_max,_idx}): New variables for user-defined specials. (addkey): Define new specials in user_specials, which is dynamically expanded if necessary. Thu Jun 8 15:45:07 1989 Jim Kingdon (kingdon at spiff) * Add -fca option. If -fca is set, comments will be reformatted. If -nfca is set, comments will be left untouched (as with comments starting with '*'). The default is -fca. * Add -cp option. The column number for comments to the right of #else and #endif. The default is -cp33. * Add -ss and -nss option. When specified, -ss places a space before a semicolon when it occurs after a while or for, e.g. while (*p++ == ' ') ; whereas -nss would give while (*p++ == ' '); The default is -nss. Tue Jun 6 10:43:20 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * Add -bli option This allows you to indent a compound statement within an if, while, etc., e.g. -bli2 gives if (foo == bar) { baz = 2; } whereas -bli0 (the default) gives if (foo == bar) { baz = 2; } * Make -ip numeric The -ip parameter now is numeric--the value is the number of spaces to indent them. The -d, -ci, and -cli parameters are also now in spaces rather than indent levels. Local Variables: mode: indented-text left-margin: 8 version-control: never End: indent-2.2.11/config.h.in0000644000177400010010000001700011331327403012010 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* */ #undef ENABLE_NLS /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* */ #undef HAVE_CATGETS /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the `feof_unlocked' function. */ #undef HAVE_FEOF_UNLOCKED /* Define to 1 if you have the `fgets_unlocked' function. */ #undef HAVE_FGETS_UNLOCKED /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getc_unlocked' function. */ #undef HAVE_GETC_UNLOCKED /* Define to 1 if you have the `getegid' function. */ #undef HAVE_GETEGID /* Define to 1 if you have the `geteuid' function. */ #undef HAVE_GETEUID /* Define to 1 if you have the `getgid' function. */ #undef HAVE_GETGID /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* */ #undef HAVE_GETTEXT /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define if exists and doesn't clash with . */ #undef HAVE_INTTYPES_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_INTTYPES_H_WITH_UINTMAX /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* */ #undef HAVE_LC_MESSAGES /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NL_TYPES_H /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_STDINT_H_WITH_UINTMAX /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* */ #undef HAVE_STPCPY /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UTIME_H /* Define to 1 if you have the `tsearch' function. */ #undef HAVE_TSEARCH /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the unsigned long long type. */ #undef HAVE_UNSIGNED_LONG_LONG /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the `__argz_count' function. */ #undef HAVE___ARGZ_COUNT /* Define to 1 if you have the `__argz_next' function. */ #undef HAVE___ARGZ_NEXT /* Define to 1 if you have the `__argz_stringify' function. */ #undef HAVE___ARGZ_STRINGIFY /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define if integer division by zero raises signal SIGFPE. */ #undef INTDIV0_RAISES_SIGFPE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define if exists and defines unusable PRI* macros. */ #undef PRI_MACROS_BROKEN /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `long int' if does not define. */ #undef off_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to unsigned long or unsigned long long if and don't define. */ #undef uintmax_t indent-2.2.11/NEWS0000644000177400010010000005224410775646104010512 00000000000000Release notes for GNU indent version 2.2.9, Aug 2002 * Matthias and Eric Lloyd Added support for -brf to place function opening brace after function declaration. * Cristalle Azundris Sabon Added --preprocessor-indentation (ppi) if set, will indent nested preprocessor-statements with n spaces per level. Overrides -lps. * D.Ingamells Added option break-function-decl-args-end (bfde) to break the function arguments list before the closing bracket. -bdfa now causes a break after the opening bracket and before the first argument so that the first argument and subsequent argments are indented one indentation step instead of being aligned with the opening bracket. Release notes for GNU indent version 2.2.8, March 2002 * Fixed bug where file got truncated if backup file was not writable. * Cleaned up several problems of building with the gettext package. * Added lots of internationalisation translations. * The indent profile file (normally in ./.indent.pro or ~/.indent.pro) can now be specified by the environment variable $INDENT_PROFILE Release notes for GNU indent version 2.2.7, November 2001 * Compilation under cygwin should be fixed. * Added support for i18n. Note for non GNU Linux/UNIX users, this requires building the code in the intl directory. For GNU Linux and other UNIX-like systems this will happen automatically, but for other platforms the make files in the miscel directory have not been updated to handle this. Versions of these make files will be made available once a generous soul provides an update. Release notes for GNU indent version 2.2.6, November 2000 * New option --break-function-decl-args (-bfda). This causes each argument of a function declaration to be put on a seperate line, aligned with the opening parathesis of the function. For example, void udi_pio_trans(udi_pio_trans_call_t *callback, udi_cb_t *gcb, udi_pio_handle_t handle, udi_buf_t *buf, void *mem_ptr) * The option -diN does not any longer indent procedure names (when also using -npsl). Nested function are still indented however. * New options --no-space-after-for (-nsaf), --no-space-after-if (-nsai) and --no-space-after-while (-nsaw) to remove the space directly following `for', `if' and `while' respectively. * Nested functions (a gcc extension) were indented wrong. * --blank-lines-after-declarations (-bad) caused blank lines to be inserted in the middle of C-style comments when a multiple line comment was used after a declaration. * The option --dont-line-up-parentheses (-nlp) was broken, sometimes causing long lines that were broken twice or more being indented too little. * Renamed long option --blank-lines-after-block-comments to --blank-lines-before-block-comments. This was a very old bug. The equivalent short option is still -bbb. Idem for --no-blank-lines-after-block-comments. * New option --cuddle-do-while (-cdw). This causes the `while' in a do-while loop to cuddle up to the immediately preceding `}'. For example, do { x--; } while (x); * New option --no-tabs (-nut) causes indent to replace all TABS with the appropriate space in the output. Unlike using --tab-size 1, this has no influence on the column where comments start. * --line-comments-indentationN/-dN now works again. * Sometimes an extra blank line was inserted between two parts of a long, broken line. This should be fixed now. * The priority of breaking lines at a point that doesn't help, is now set at minus infinity. The means that instead of getting if ( extremely_long. struct_element) because breaking after a '.' has a very low priority, you'll now get if (extremely_long. struct_element) * The option --format-comments (-fca) was broken, it did not remove leading '*' in comments like: "/* this , this now becomes: "/* this <- one */". * <- one */" instead of "/* this * <- one */". Adjacent spaces are now always eaten and not only when they are at the start of a line: "/* a b. c d */" becomes now "/* a b. c d */". Two spaces are left after a dot. * A typo in indent.c caused types inside a sizeof() to be marked as a declaration. This caused a blank line to be put after them in some cases (when using the --blank-lines-after-declarations (-bad)). * A backslash-newline, outside a macro definition or string, was treated as two seperate characters, breaking compilation when the newline was repositioned. Now the backslash is simply eaten. Release notes for GNU indent version 2.2.5, Januari 2000 * When using --dont-break-procedure-type, indent wrongly joined lines of a procedure declaration ending in a '(' and followed by a comment. In the case of a C++-style comment that even broke compilation. int func( /* hello */ char c) { became int func( /* hello */ char c) { * Added missing README.VMS to tar ball. Added support for VMS' DECC compiler. (Patch by forrest.cahoon@merrillcorp.com). * New option --space-after-parentheses (-prs) causes parentheses to be printed with spaces: if ( foo( i + 1 ) == 1 ). * --braces-on-if-line (-br) caused indentation of statements after case: label to be indented wrongly (not relative to the start of the case: label). This fix means that when you use -br together with -cliN where N is not 0, then your code will change: subtract the value for -cli from -cbi to get the same results for { braced } case statements. The correct meaning when using -br is now: switch (i) { <--cliN-->case x: <--iN-->statement; <--cliN-->case y: <--cbiN-->{ <--iN-->statement; Without -br it still is: switch (i) <--bliN-->{ <--cliN-->case x: <--iN-->statement; <--cliN-->case y: <--cbiN-->{ <--iN-->statement; * Indentation options now accept negative values for greater flexibility. Release notes for GNU indent version 2.2.4, November 1999 * When using numbered backup files, setting environment variable VERSION_WIDTH now allows to use left zero padding (ie file.~001~). (Patch by Chris F.A. Johnson ) * --braces-on-if-line (-br) caused a '{' brace on the same line as a '}' not to be put automatically on the next line, as it should because the following { block } is not related to the previous { block } in any way. * Unpaired braces in `#if ..{.. #else/#elif ..{.. #endif }' constructs was broken for #elif and when there were spaces after the #. * Spelling, typo and general little improvements of indent.texinfo. Now using Texinfo 4.0 markup. (Patch by Kragen Sittler ) Release notes for GNU indent version 2.2.3, October 1999 * Fixed bit-fields with types other then `int' (no type still won't work). Fixed support for public:, private: and protected: labels. * Forgot to include the indent.dsp file in 2.2.2 (win32) Release notes for GNU indent version 2.2.2, September 1999 * Added support for win32 (need VC++) * Indent was sometimes adding a blank line at the top of an indented file when indenting multiple files at once. This bug has been fixed. Release notes for GNU indent version 2.2.1, September 1999 * Indent got confused when a function declaration contained an enum and did not contain a colon before using a '{' inside the function. enum foobar <-- returns enum func (enum foobar) <-- or uses an enum as parameter { if (1) { <-- uses '{' before any ';' was used func (1);} <-- fails here ... etc. * A new option to stop `make' from rebuilding your whole project after running `indent': -pmt, --preserve-mtime : Preserve modification time on output files. * Backup files now keep the same modification time as the original. * New -c++, --c-plus-plus option to allow better C++ formatting: Recognizes C++ keywords, including the GNU extension operators ?=. (Patch by Malekith ) Note: In general C++ still does NOT work! * EBCDIC charset support for BS2000/POSIX (Siemens mainframe OS). Contributed by . Release notes for GNU indent version 2.2.0, July 1999 * Indent was detecting `const' errornous as function qualifier in some cases. Resulting in void foo(fmt) constchar *fmt; { } * Compiles again with old K&R compilers. * The `GetText' macros `N_' and `_' do not get a space appended anymore. Release notes for GNU indent version 2.1, June 1999 * Merged in the changes made by Joseph Arceneaux from 1.9.1 -> 2.0. Thus: 1.10.0 == 1.9.1 + Carlo's patches 2.0 == 1.9.1 + Joseph's patches 2.1.0 == 1.9.1 + Joseph's patches + Carlo's patches. Below you can find the release notes of 2.0, which thus also apply to 2.1: The maintenance is now officially transfered to Carlo Wood. * GNU indent is now a lot more precise in honouring the --line-lengthN option: It now joins lines when they fit on one line, and it won't produce lines that are longer then the specified line length anymore (except when no reasonable break point was found). * Two new options to accommodate breaking long lines: -hnl, --honour-newlines : Prefer to break long lines at positions where the lines were broken in the input file. -nhnl, --ignore-newlines: Don't prefer that. -bbo, --break-before-boolean-operator : Prefer to break long lines before the boolean operators && and ||. -nbbo, --break-after-boolean-operator : Prefer to break long lines after the boolean operators && and ||. * The default is now not to indent the braces of struct, union and enum. A new option -sbiN or --struct-brace-indentationN allows to indent it nevertheless. Release notes for GNU indent version 2.0, November 1998 * indent withstands the U. Wisconsin fuzz test. (See http://www.cs.wisc.edu/Dienst/UI/2.0/Describe/ncstrl.uwmadison/CS-TR-95-1268 for details.) * indent compiles with gcc -Wall and MSVC++ with no warnings. * C++ code is handled to a great extent. There is no special switch or option. However, there are still several cases which are not handled as well as they should be, and there are no options controlling C++ formatting specifically. There is only one case I'm aware of in which the output of indent breaks compilation; this is nested templates such as: Aaa > anotherAB; are transformed into: Aaa < int, Bbb < int >>anotherAB; which is problematic for some compilers. This is, in my opinion, the fault of the incredibly brain-dead design of C++, and it's not clear when or if indent will deal properly with this example. * Wide strings and characters are now handled. * The manual page, indent.1, has been removed from the distribution because it is not supported and is seriously out of date (it corresponds to indent 1.4). * The "-bbb" option, which forces blanklines before boxed comments, has been re-instated. * Trailing spaces are removed from output. * Line-breaking behaviour has been improved. * The troff option has been removed. * You may now put either C ("/* ... */") or C++ ("// ...") comments in the indent profile. Options within comments are ignored. * The K&R style of leaving procedure names on the same line as their type is now better supported (the option "-psl"). * The "-l" option now works more consistently. This may change some behaviour by breaking lines where they were not broken before. Specifying an argument of "0" will turn off this option. * The unused options "-ps" and "-nps" were removed. * When `indent' completes its work successfully, it exits with a value of 0. Otherwise, one of the following values is returned: 1 : This means `indent' was incorrectly invoked. 2 : Errors occurred during formatting, but processing continued. 3 : An unrecoverable error occured during the processing of an input file. If there are more input files, indent will proceed to process them, but will return the error value 3. 4 : A serious internal error occured. All processing is terminated. 5 : A system error during processing occurred. In this case, `indent' terminates. Release notes for GNU indent version 1.10, May 1999. * New maintainer. New build environment, using automake now. VMS support is removed (sorry). * Many bug fixes - if you had problems before, try this version! * New options have been added: "-bls" ("--braces-after-struct-decl-line") "-brs" ("--braces-on-struct-decl-line") "-cbiN" ("--case-brace-indentationN") "-piN" ("--paren-indentationN") * Generated and thus up to date man page (indent.1). Release notes for GNU indent version 1.9. * All reported bugs have been fixed. * A new option "-lc" ("--comment-line-length") was added. * Please read the section "BUG REPORTS" in the README file. * Unless "interesting" bugs appear, this will be the last release of indent version 1. The next release planned is version 2, which will (hopefully) integrate support for C++, and possibly Objective C. Additionally, a couple more OS's may be supported. * A volunteer is now working on the `review' program, which examines C code and produces the options that GNU `indent' would use to produce code in that style. Release Notes for GNU indent version 1.8. * VMS and MS-DOS are now supported. Thanks to MEHRDAD@glum.dev.cf.ac.uk and hnyman@lesti.hut.fi for their contributions. Please note that I have no way of testing this code, and with slight modifications, have installed it "as is". Also, note that these systems do not use `configure'. See the file VMS-README for details of the VMS installation. For the MS-DOS version, it is expected that the compiler will recognize the define __MSDOS__ as being set. * C++ comments are now recognized. More C++ support will be forthcoming, possibly along with support for Objective C. * Formatting can be disabled for sections of code by placing that code between lines containing the comments /* *INDENT-OFF* */ and /* *INDENT-ON* */ (this also works in C++ comments). See the info node "Disabling Formatting" for more info. * The processing of comments has been changed. See the info node on "Comments" for a description. * The default (i.e., GNU) behaviour of struct handling has been slightly changed. * All reported bugs have been fixed. Release Notes for GNU indent version 1.7. * All reported bugs have been fixed, except some of those dealing with comments. I have completely rewritten the comment handling code in indent, but since this produces rather different comment formats (mostly, it makes several comment-related options actually work) I am waiting for the next release of indent to install this. To see what the differences in the comment handling will be, compare the file `comments.texinfo' to the section on comments in the info node for indent. It is possible that I have lost some bug reports, as some of my mail falls into a crack between two machines. In the future, please be sure to use the address "bug-gnu-utils@prep.ai.mit.edu". * All errors and warnings are output on the standard error stream, and conform to the GNU error message format. * There is now more support for small (i.e., 16-bit) machines. * There have been slight changes to the default behaviour, namely: - Column 1 comments are not formatted. - Preprocessor spaces are removed. * When "-lps" is specified, whitespace preceding the '#' character is left untouched, as well as following whitespace. * When the tabsize is specified as 1 or 0 (e.g., "-ts 0"), spaces are used instead of tabs. There may be bugs in this behaviour, but they should vanish with the new comment code. Release Notes for GNU indent version 1.6. * All reported bugs have been fixed. * The makefiles have been, hopefully, improved (see the file `README' for installation procedure). Essentially, it is sufficent to type "make" to build indent. `indent' is distributed with `configure' just as other GNU software. Thus, in conformance with the GNU standards, "configure; make" should function properly and `indent' should fit properly in a GNU software tree. However, it is my hope that for most users, "make" is all they will have to type. Release Notes for GNU indent version 1.5. * All reported bugs (and some unreported ones) have been fixed. * The default behaviour of `indent' has changed slightly to be more compatible with Emacs' C-mode. In particular, where version 1.4 produced code looking like: struct token_data { enum token_data_type type; union { struct { char *text; } u_t; } u; }; version 1.5 now generates the following: struct token_data { enum token_data_type type; union { struct { char *text; } u_t; } u; }; * There is a new option, "-lps" ("--leave-preprocessor-space") which causes `indent' to leave the space between the `#' and the command on preprocessor lines. * `indent' now understands spaces between options and their arguments. It is thus now possible to type: "indent -ip 4 latex.c" Such spaces are also understood in a profile. * indent 1.5 uses a configuration script generated by autoconf. It examines the system to produce a host-dependent makefile. This has changed little with regard to building indent; typing "make" will build `indent'. See the file "README" for details of this process. * The file "indent.1" is a man document for indent 1.4 sent to me by vogel@c-17igp.wpafb.af.mil. The GNU project uses texinfo for its documentation system, so this man page will remain officially unsupported. However, I will continue to distribute it as long as it appears reasonably up to date. * Thanks to the folks that sent me patches. Release Notes for GNU indent version 1.4. Essentially, this version fixes bugs in version 1.3. Release Notes for GNU indent version 1.3. For more details, read the manual. * All reported bugs have been fixed. * The manual has been upgraded somewhat. * Command line syntax has changed with regard to input and output files. The command: indent *.c for each file iguana.c, will indent iguana.c into iguana.c, after first making a backup copy. indent liver_oil.c -o gullet.c cat liver_oil.c | indent -o gullet.c indent liver_iol.c -st > gullet.c Each of the above will indent "liver_oil.c" into "gullet.c". The "-st" ("--standard-output") option can only be used when the standard input, or only a single input file is specified. It is also possible to use the standard input by specifying the single filename "-" on the command line. In this case, no other files may be specified. * indent now makes GNU-style backup files. This behaviour is controlled by two environment variables, VERSION_CONTROL and SIMPLE_BACKUP_SUFFIX. VERSION_CONTROL determines what kinds of backups are made. If it's value is "numbered", then the first modification of some file "eraserhead.c" will yield a backup file "eraserhead.c.~1~", the second modification will yield "eraserhead.c.~2~", and so on. It does not matter if the version numbers are not a sequence; the next version will be one greater than the highest in that directory. If the value of VERSION_CONTROL is "numbered_existing", then such numbered backups will be made if there are already numbered backup versions of the file. Otherwise, the backup name will be that of the original file with "~" (tilde) appended. E.g., "eraserhead.c~". If the value of VERSION_CONTROL is "simple", then the backup name will be that of the original file with "~" appended, regardless of whether or not there exist numbered versions in the directory. For simple backups, the value of SIMPLE_BACKUP_SUFFIX will be used rather than "~" if it is set. If VERSION_CONTROL is unset, "numbered_existing" is assumed. For lisp lovers, "nil" is equivalent to "numbered_existing" and "t" is equivalent to "numbered". Finally, if VERSION_CONTROL is "none" or "never", backups are not made. I suggest you avoid this behaviour. Note also that backup files are made in the directory of the source file, not the current directory (where indent was invoked). * Only one indent profile is read. indent searches first for a profile in the current directory and reads that if found. Otherwise, indent looks for a profil in the home directory. * "-nip" is now handled. This is equivalent to "-ip0". * The long name for "-bs" has been changed from "--Bill_Shannon" to "--blank_after_sizeof". Release notes for GNU indent version 1.7 The default style of indent is now the GNU style. The option "-gnu" is still recognized. To obtain the original indent default, use "-orig". It is possible to obtain the original defaults by compiling args.c with -DBERKELEY_DEFAULTS. Long options are now handled, prefaced by either "+" or "--". A new option, "-ts", allows specification of tab sizes. All reported bugs have been fixed. The man format of documentation is no longer included. indent.texinfo is the official document, in accordance with GNU standards. Investigate the program "texi2roff" for generating a MAN page. indent-2.2.11/configure0000755000177400010010000117762711331327354011730 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for GNU Indent 2.2.11. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='GNU Indent' PACKAGE_TARNAME='indent' PACKAGE_VERSION='2.2.11' PACKAGE_STRING='GNU Indent 2.2.11' PACKAGE_BUGREPORT='bug-indent@gnu.org' ac_unique_file="src/indent.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS POSUB LTLIBINTL LIBINTL INTLLIBS INTL_LIBTOOL_SUFFIX_PREFIX GENCAT INSTOBJEXT DATADIRNAME INTLOBJS CATOBJEXT USE_INCLUDED_LIBINTL BUILD_INCLUDED_LIBINTL USE_NLS INTLBISON LTLIBICONV LIBICONV GLIBC21 ALLOCA RANLIB host_os host_vendor host_cpu host build_os build_vendor build_cpu build MSGMERGE XGETTEXT GMSGFMT MSGFMT MKINSTALLDIRS TEXI2HTML TEXI2PDF DVIPS EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking with_gnu_ld enable_rpath with_libiconv_prefix enable_nls with_included_gettext with_libintl_prefix ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures GNU Indent 2.2.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/indent] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of GNU Indent 2.2.11:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-rpath do not hardcode runtime library paths --disable-nls do not use Native Language Support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-included-gettext use the GNU gettext library included here --with-libintl-prefix=DIR search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GNU Indent configure 2.2.11 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GNU Indent $as_me 2.2.11, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 $as_echo "$as_me: error: unsafe absolute working directory name" >&2;} { (exit 1); exit 1; }; };; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 $as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} { (exit 1); exit 1; }; };; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=indent VERSION=2.2.11 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" { $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_minix_config_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 $as_echo_n "checking for minix/config.h... " >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 $as_echo "$ac_cv_header_minix_config_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 $as_echo_n "checking minix/config.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 $as_echo_n "checking minix/config.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to bug-indent@gnu.org ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 $as_echo_n "checking for minix/config.h... " >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 $as_echo "$ac_cv_header_minix_config_h" >&6; } fi if test "x$ac_cv_header_minix_config_h" = x""yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test "${ac_cv_safe_to_define___extensions__+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_safe_to_define___extensions__=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _TANDEM_SOURCE 1 _ACEOF if test "${ac_cv_header_minix_config_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 $as_echo_n "checking for minix/config.h... " >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 $as_echo "$ac_cv_header_minix_config_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 $as_echo_n "checking minix/config.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 $as_echo_n "checking minix/config.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to bug-indent@gnu.org ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 $as_echo_n "checking for minix/config.h... " >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 $as_echo "$ac_cv_header_minix_config_h" >&6; } fi if test "x$ac_cv_header_minix_config_h" = x""yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test "${ac_cv_safe_to_define___extensions__+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_safe_to_define___extensions__=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _TANDEM_SOURCE 1 _ACEOF { $as_echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 $as_echo_n "checking for strerror in -lcposix... " >&6; } if test "${ac_cv_lib_cposix_strerror+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_cposix_strerror=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cposix_strerror=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 $as_echo "$ac_cv_lib_cposix_strerror" >&6; } if test "x$ac_cv_lib_cposix_strerror" = x""yes; then LIBS="$LIBS -lcposix" fi { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const /**/ _ACEOF fi ac_aux_dir_abs=`cd $ac_aux_dir && pwd` # Extract the first word of "dvips", so it can be a program name with args. set dummy dvips; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_DVIPS+set}" = set; then $as_echo_n "(cached) " >&6 else case $DVIPS in [\\/]* | ?:[\\/]*) ac_cv_path_DVIPS="$DVIPS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DVIPS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DVIPS" && ac_cv_path_DVIPS="$ac_aux_dir_abs/missing dvips" ;; esac fi DVIPS=$ac_cv_path_DVIPS if test -n "$DVIPS"; then { $as_echo "$as_me:$LINENO: result: $DVIPS" >&5 $as_echo "$DVIPS" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "texi2pdf", so it can be a program name with args. set dummy texi2pdf; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_TEXI2PDF+set}" = set; then $as_echo_n "(cached) " >&6 else case $TEXI2PDF in [\\/]* | ?:[\\/]*) ac_cv_path_TEXI2PDF="$TEXI2PDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_TEXI2PDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_TEXI2PDF" && ac_cv_path_TEXI2PDF="$ac_aux_dir_abs/missing texi2pdf" ;; esac fi TEXI2PDF=$ac_cv_path_TEXI2PDF if test -n "$TEXI2PDF"; then { $as_echo "$as_me:$LINENO: result: $TEXI2PDF" >&5 $as_echo "$TEXI2PDF" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "texi2html", so it can be a program name with args. set dummy texi2html; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_TEXI2HTML+set}" = set; then $as_echo_n "(cached) " >&6 else case $TEXI2HTML in [\\/]* | ?:[\\/]*) ac_cv_path_TEXI2HTML="$TEXI2HTML" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_TEXI2HTML="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_TEXI2HTML" && ac_cv_path_TEXI2HTML="$ac_aux_dir_abs/missing texi2html" ;; esac fi TEXI2HTML=$ac_cv_path_TEXI2HTML if test -n "$TEXI2HTML"; then { $as_echo "$as_me:$LINENO: result: $TEXI2HTML" >&5 $as_echo "$TEXI2HTML" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then $as_echo_n "(cached) " >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:$LINENO: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:$LINENO: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in /*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:$LINENO: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "$GMSGFMT" != ":"; then if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` { $as_echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 $as_echo "found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } GMSGFMT=":" fi fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else { $as_echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi rm -f messages.po fi ac_config_commands="$ac_config_commands default-1" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi { $as_echo "$as_me:$LINENO: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking for off_t" >&5 $as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_off_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((off_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 $as_echo "$ac_cv_type_off_t" >&6; } if test "x$ac_cv_type_off_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((size_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_working_alloca_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_alloca_works=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF { $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if test "${ac_cv_os_cray+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in stdlib.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to bug-indent@gnu.org ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 1; if (write (fd, data, pagesize) != pagesize) return 1; close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 1; data2 = (char *) malloc (2 * pagesize); if (!data2) return 1; data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 1; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 1; if (read (fd, data3, pagesize) != pagesize) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 1; close (fd); return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 $as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } if test "${ac_cv_gnu_library_2_1+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2_1=yes else ac_cv_gnu_library_2_1=no fi rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 $as_echo "$ac_cv_gnu_library_2_1" >&6; } GLIBC21="$ac_cv_gnu_library_2_1" { $as_echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 $as_echo_n "checking whether integer division by zero raises SIGFPE... " >&6; } if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Guess based on the CPU. case "$host_cpu" in alpha* | i3456786 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_int_divbyzero_sigfpe=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gt_cv_int_divbyzero_sigfpe=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 $as_echo "$gt_cv_int_divbyzero_sigfpe" >&6; } case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac cat >>confdefs.h <<_ACEOF #define INTDIV0_RAISES_SIGFPE $value _ACEOF { $as_echo "$as_me:$LINENO: checking for inttypes.h" >&5 $as_echo_n "checking for inttypes.h... " >&6; } if test "${jm_ac_cv_header_inttypes_h+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then jm_ac_cv_header_inttypes_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 jm_ac_cv_header_inttypes_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $jm_ac_cv_header_inttypes_h" >&5 $as_echo "$jm_ac_cv_header_inttypes_h" >&6; } if test $jm_ac_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H_WITH_UINTMAX 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for stdint.h" >&5 $as_echo_n "checking for stdint.h... " >&6; } if test "${jm_ac_cv_header_stdint_h+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then jm_ac_cv_header_stdint_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 jm_ac_cv_header_stdint_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $jm_ac_cv_header_stdint_h" >&5 $as_echo "$jm_ac_cv_header_stdint_h" >&6; } if test $jm_ac_cv_header_stdint_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H_WITH_UINTMAX 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for unsigned long long" >&5 $as_echo_n "checking for unsigned long long... " >&6; } if test "${ac_cv_type_unsigned_long_long+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ unsigned long long ull = 1; int i = 63; int main () { unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_type_unsigned_long_long=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_long=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 $as_echo "$ac_cv_type_unsigned_long_long" >&6; } if test $ac_cv_type_unsigned_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_LONG_LONG 1 _ACEOF fi if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' cat >>confdefs.h <<_ACEOF #define uintmax_t $ac_type _ACEOF fi { $as_echo "$as_me:$LINENO: checking for inttypes.h" >&5 $as_echo_n "checking for inttypes.h... " >&6; } if test "${gt_cv_header_inttypes_h+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_header_inttypes_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_header_inttypes_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5 $as_echo "$gt_cv_header_inttypes_h" >&6; } if test $gt_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF fi if test $gt_cv_header_inttypes_h = yes; then { $as_echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 $as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } if test "${gt_cv_inttypes_pri_broken+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef PRId32 char *p = PRId32; #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_inttypes_pri_broken=no else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_inttypes_pri_broken=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 $as_echo "$gt_cv_inttypes_pri_broken" >&6; } fi if test "$gt_cv_inttypes_pri_broken" = yes; then cat >>confdefs.h <<_ACEOF #define PRI_MACROS_BROKEN 1 _ACEOF fi if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${acl_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { $as_echo "$as_me:$LINENO: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no fi fi { $as_echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if test "${acl_cv_rpath+set}" = set; then $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; : else enable_rpath=yes fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi fi LIBICONV= LTLIBICONV= INCICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to bug-indent@gnu.org ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:$LINENO: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if test "${am_cv_func_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_func_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:$LINENO: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:$LINENO: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:$LINENO: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if test "${am_cv_proto_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 $as_echo "${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } if test "${am_cv_langinfo_codeset+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* cs = nl_langinfo(CODESET); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_langinfo_codeset=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 $as_echo "$am_cv_langinfo_codeset" >&6; } if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LANGINFO_CODESET 1 _ACEOF fi if test $ac_cv_header_locale_h = yes; then { $as_echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 $as_echo_n "checking for LC_MESSAGES... " >&6; } if test "${am_cv_val_LC_MESSAGES+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_val_LC_MESSAGES=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_val_LC_MESSAGES=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 $as_echo "$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF fi fi for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_INTLBISON+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$INTLBISON"; then ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_INTLBISON="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi INTLBISON=$ac_cv_prog_INTLBISON if test -n "$INTLBISON"; then { $as_echo "$as_me:$LINENO: result: $INTLBISON" >&5 $as_echo "$INTLBISON" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$INTLBISON" && break done if test -z "$INTLBISON"; then ac_verc_fail=yes else { $as_echo "$as_me:$LINENO: checking version of bison" >&5 $as_echo_n "checking version of bison... " >&6; } ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac { $as_echo "$as_me:$LINENO: result: $ac_prog_version" >&5 $as_echo "$ac_prog_version" >&6; } fi if test $ac_verc_fail = yes; then INTLBISON=: fi { $as_echo "$as_me:$LINENO: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no LIBINTL= LTLIBINTL= POSUB= if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no { $as_echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 $as_echo_n "checking whether included gettext is requested... " >&6; } # Check whether --with-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval=$with_included_gettext; nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no fi { $as_echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 $as_echo "$nls_cv_force_use_gnu_gettext" >&6; } nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then { $as_echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if test "${gt_cv_func_gnugettext1_libc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return (long) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then gt_cv_func_gnugettext1_libc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libc=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 $as_echo "$gt_cv_func_gnugettext1_libc" >&6; } if test "$gt_cv_func_gnugettext1_libc" != "yes"; then use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi fi LIBINTL= LTLIBINTL= INCINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); int main () { bindtextdomain ("", ""); return (long) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then gt_cv_func_gnugettext1_libintl=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libintl=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); int main () { bindtextdomain ("", ""); return (long) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext1_libintl=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 $as_echo "$gt_cv_func_gnugettext1_libintl" >&6; } fi if test "$gt_cv_func_gnugettext1_libc" = "yes" \ || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ && test "$PACKAGE" != gettext; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test "$gt_use_preinstalled_gnugettext" != "yes"; then nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then INTLOBJS="\$(GETTOBJS)" BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV" LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then CATOBJEXT=.gmo fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF else USE_NLS=no fi fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then { $as_echo "$as_me:$LINENO: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:$LINENO: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi POSUB=po fi if test "$PACKAGE" = gettext; then BUILD_INCLUDED_LIBINTL=yes fi nls_cv_header_intl= nls_cv_header_libgt= DATADIRNAME=share INSTOBJEXT=.mo GENCAT=gencat INTL_LIBTOOL_SUFFIX_PREFIX= INTLLIBS="$LIBINTL" localedir=${datadir}/locale { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_func in strchr memcpy memmove utime do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in unistd.h string.h malloc.h utime.h sys/utime.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to bug-indent@gnu.org ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_func_utime" = yes ; then if test "$ac_cv_header_utime_h" = yes ; then { $as_echo "$as_me:$LINENO: checking if struct utimbuf needs -posix" >&5 $as_echo_n "checking if struct utimbuf needs -posix... " >&6; } if test "${unet_cv_sys_utimbuf_needs_posix+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct utimbuf buf; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then unet_cv_sys_utimbuf_needs_posix=no else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -posix" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct utimbuf buf; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then unet_cv_sys_utimbuf_needs_posix=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 unet_cv_sys_utimbuf_needs_posix=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$OLDCFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $unet_cv_sys_utimbuf_needs_posix" >&5 $as_echo "$unet_cv_sys_utimbuf_needs_posix" >&6; } if test $unet_cv_sys_utimbuf_needs_posix = yes; then CFLAGS="$CFLAGS -posix" fi fi fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_opendir=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_opendir=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi ac_config_files="$ac_config_files intl/Makefile po/Makefile.in Makefile src/Makefile doc/Makefile man/Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by GNU Indent $as_me 2.2.11, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ GNU Indent config.status 2.2.11 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it # from automake. eval 'ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "intl/Makefile") CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "default-1":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' fi case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= GMOFILES= UPDATEPOFILES= DUMMYPOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; "default":C) touch Makefile.in ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi indent-2.2.11/regression/0000777000177400010010000000000011331327613012236 500000000000000indent-2.2.11/regression/TIME0000755000177400010010000000101410775646104012644 00000000000000#/bin/sh # First, make sure the executable exists if test -x ../indent; then if test -d ./output; then echo '****' echo 'Errors remain; output directory still exists' echo '****' ls -ld ./output exit 1 fi echo -n "Regression testing " ../indent --version echo else echo '****' echo First, you must make ../indent echo '****' echo exit 1 fi for i in 1 2 3 4 5 6 7 8 9 10 ; do cp indent.c time$i.c sync time ../indent -o foo time$i.c rm -f foo sync done rm -f time*.c foo indent-2.2.11/regression/standard/0000777000177400010010000000000011331315632014034 500000000000000indent-2.2.11/regression/standard/proto.c0000644000177400010010000000027710775646104015301 00000000000000static void bar (char *foo) { long whizzo; short spazzo; if (*foo == gibberish ()) whizzo = spazzo; } char * nevermind (char harrumph) { char buf[1024]; buf[3] = harrumph; } indent-2.2.11/regression/standard/brackets36.c0000644000177400010010000000050710775646104016101 00000000000000void foo () { if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) mask = NULL; if ((acptr = FindUser (nick)) && ((!(bitsel & WHOSELECT_OPER)) || IsAnOper (acptr)) && Process (acptr) && SHOW_MORE (sptr, counter)) mask = NULL; } indent-2.2.11/regression/standard/memcpy.c0000644000177400010010000000051210775646104015420 00000000000000/* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined if the source overlaps with the destination. Return DESTADDR. */ char * memcpy (destaddr, srcaddr, len) char *destaddr; char *srcaddr; int len; { char *dest = destaddr; while (len-- > 0) *destaddr++ = *srcaddr++; return dest; } indent-2.2.11/regression/standard/preesc-comment.c0000644000177400010010000000061010775646104017046 00000000000000 /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ #if x /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ #if x /** */ foo #endif indent-2.2.11/regression/standard/boxed.c-30000644000177400010010000000450310775646104015373 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/newlines.c-70000644000177400010010000000211010775646104016112 00000000000000/* Redistribution and use in source and binary * forms are permitted permission. THIS SOFTWARE * IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS * OR Now here are some blank lines: * * * * * * IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE. */ /* Redistribution and use in source and binary * forms are permitted permission. THIS SOFTWARE * IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS * OR * * IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE. */ int some_global; /* Redistribution and use in source and binary * forms are permitted permission. THIS * SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT * ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/outer.c-20000644000177400010010000000207610775646104015432 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/else-comment-br.c0000644000177400010010000000301710775646104017122 00000000000000void foo () { if (0) i = 0; else /* This is a dirty place to put a comment */ if (1) i = 0; else /* comment behind else */ /* comment on new line, after else */ i = 0; if (0) /* Lets put a comment here too */ i = 0; else /* This is a dirty place to put a multi-line comment */ if (1) i = 0; else /* multi-line comment behind else */ i = 0; if (0) /* Lets put a comment here too */ i = 0; else /* This is a dirty place to put a comment */ if (1) i = 0; else /* comment behind else */ /* comment on new line, after else */ i = 0; if (0) i = 0; else if (1) /* comment after if */ i = 0; else /* multi-line comment */ i = 0; if (0) { i = 0; } else /* This is a dirty place to put a comment */ if (1) { i = 0; } else { /* comment behind else */ /* comment on new line, after else */ i = 0; } if (0) { /* Lets put a comment here too */ i = 0; } else /* This is a dirty place to put a multi-line comment */ if (1) { i = 0; } else { /* multi-line comment behind else */ i = 0; } if (0) { /* Lets put a comment here too */ i = 0; } else /* This is a dirty place to put a comment */ if (1) { i = 0; } else { /* comment behind else */ /* comment on new line, after else */ i = 0; } if (0) { i = 0; } else if (1) { /* comment after if */ i = 0; } else { /* multi-line comment */ i = 0; } } indent-2.2.11/regression/standard/pre.c0000644000177400010010000000025410775646104014717 00000000000000#if x # if y # if z # define www # else # define ggg # endif # else # define kkk # endif #endif indent-2.2.11/regression/standard/enum.c0000644000177400010010000000021410775646104015071 00000000000000enum foo bar () { if (1) { func (1); } return SUCCESSFUL; } void bar (enum foo) { if (1) { func (1); } } indent-2.2.11/regression/standard/outer.c-50000644000177400010010000000213110775646104015425 00000000000000/* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * Here's a multi-line cooment where the * closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/sob.c0000644000177400010010000000021210775646104014706 00000000000000 /* Optional blanklines */ main (foo) int foo; { barf (); *foo = eat_me (); return 93; /* Because */ } /* there wre */ indent-2.2.11/regression/standard/newlines.c-40000644000177400010010000000204310775646104016114 00000000000000/* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * Now here are some blank lines: * * * * * * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS * OR * * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/case-br.c0000644000177400010010000000025110775646104015442 00000000000000int foo (void) { if (0) { switch (x) { case 1: ++x; break; case 1: { ++x; break; } } } } indent-2.2.11/regression/standard/outer.c-70000644000177400010010000000207610775646104015437 00000000000000/* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the * closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/continue.c0000644000177400010010000000077510775646104015765 00000000000000extern EXETOKEN savetkn; /* Last input token found. */ extern EXETOKEN NOTOKEN; /* Empty token */ word FilOpnTmp (uword maxr, word creat) /* i: 0 - copies existing mastfil to tmpfil, 1- creates tmpfil */ { here_is_an_incredibly_long_variable = my * but * this * (is + a) / lengthy * expression; for (mastfil_dta = 0; mastfil_dta < cnfils && (strcmp (mastfil->fname, dtafilarr[mastfil_dta]->fname) != 0); mastfil_dta++); for (mastfil_dta = 0; mastfil_dta < cnfils; mastfil_dta++); } indent-2.2.11/regression/standard/brackets35.c0000644000177400010010000000051210775646104016074 00000000000000void foo () { if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) mask = NULL; if ((acptr = FindUser (nick)) && ((!(bitsel & WHOSELECT_OPER)) || IsAnOper (acptr)) && Process (acptr) && SHOW_MORE (sptr, counter)) mask = NULL; } indent-2.2.11/regression/standard/nested.c0000644000177400010010000000072610775646104015417 00000000000000#include void inner_function (int foo, int bar) { int baz; printf ("Hi!\n"); if (foo) printf ("Foo (%d)\n", foo); if (bar) printf ("Bar (%d)\n", bar); } void outer_function () { void inner_function (int foo, int bar) { int baz; printf ("Hi!\n"); if (foo) printf ("Foo (%d)\n", foo); if (bar) printf ("Bar (%d)\n", bar); } inner_function (1, 1); } int main (void) { outer_function (); return 0; } indent-2.2.11/regression/standard/scope-br.c0000644000177400010010000000010610775646104015637 00000000000000int foo (void) { if (0) { ++i; } { ++i; } } indent-2.2.11/regression/standard/else-comment-br-ce.c0000644000177400010010000000277510775646104017521 00000000000000void foo () { if (0) i = 0; else /* This is a dirty place to put a comment */ if (1) i = 0; else /* comment behind else */ /* comment on new line, after else */ i = 0; if (0) /* Lets put a comment here too */ i = 0; else /* This is a dirty place to put a multi-line comment */ if (1) i = 0; else /* multi-line comment behind else */ i = 0; if (0) /* Lets put a comment here too */ i = 0; else /* This is a dirty place to put a comment */ if (1) i = 0; else /* comment behind else */ /* comment on new line, after else */ i = 0; if (0) i = 0; else if (1) /* comment after if */ i = 0; else /* multi-line comment */ i = 0; if (0) { i = 0; } else /* This is a dirty place to put a comment */ if (1) { i = 0; } else { /* comment behind else */ /* comment on new line, after else */ i = 0; } if (0) { /* Lets put a comment here too */ i = 0; } else /* This is a dirty place to put a multi-line comment */ if (1) { i = 0; } else { /* multi-line comment behind else */ i = 0; } if (0) { /* Lets put a comment here too */ i = 0; } else /* This is a dirty place to put a comment */ if (1) { i = 0; } else { /* comment behind else */ /* comment on new line, after else */ i = 0; } if (0) { i = 0; } else if (1) { /* comment after if */ i = 0; } else { /* multi-line comment */ i = 0; } } indent-2.2.11/regression/standard/bug-di.c0000644000177400010010000000007310775646104015277 00000000000000 int foo() { bar(); /* * A comment */ } indent-2.2.11/regression/standard/pre_lps.c0000644000177400010010000000013311264323510015554 00000000000000#if x #if y # if z #define www #else # define ggg #endif #else # define kkk #endif #endif indent-2.2.11/regression/standard/bug206785.c0000644000177400010010000000215310775646104015402 00000000000000int main () { /* Notice the missing close comment on the next line . * Lets see what indent thinks of it ... */ printf (_("aaaaaaaaaaaaaaaaaaaaaaaaaa)); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n "); printf(":"); } indent-2.2.11/regression/standard/case.c0000644000177400010010000000031010775646104015035 00000000000000int foo (void) { if (0) { switch (x) { case 1: ++x; break; case 1: { ++x; break; } } } } indent-2.2.11/regression/standard/typedef.h0000644000177400010010000000017510775646104015600 00000000000000 typedef boolean (*PFB) (); /* system defined globals */ extern int errno; extern int sys_nerr; extern char *sys_errlist[]; indent-2.2.11/regression/standard/boxed.c-50000644000177400010010000000452710775646104015403 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* * Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* * Note that Standard Input must be associated to a virtual terminal. */ /* * Further, it must be currently displayed for any sound to occur. */ /* * ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/const.c0000644000177400010010000000017210775646104015256 00000000000000void graph_error(fmt, va_alist) const char *fmt; va_dcl { } int label_width(str, lines) const char *str; int *lines; { } indent-2.2.11/regression/standard/outer.c-40000644000177400010010000000213110775646104015424 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/io.c0000644000177400010010000005020011145774471014535 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" #include /* POSIX says that should exist. Some systems might need to use or instead. */ #include #include #include /* number of levels a label is placed to left of code */ #define LABEL_OFFSET 2 /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *in_prog; char *in_prog_pos; char *cur_line; unsigned int in_prog_size; FILE *output; char *buf_ptr; char *buf_end; int had_eof; int out_lines; int com_lines; int suppress_blanklines = 0; int comment_open; int paren_target; /* Use `perror' to print the system error message caused by OFFENDER. */ static char *errbuf; void sys_error (offender) char *offender; { int size = strlen (offender); static int buffer_size; if (errbuf == 0) { buffer_size = size + 10; /* Extra for random unix lossage */ errbuf = (char *) xmalloc (buffer_size); } else if (size + 10 > buffer_size) { buffer_size = size + 10; errbuf = xrealloc (errbuf, buffer_size); } sprintf (errbuf, "indent: %s", offender); perror (errbuf); exit (1); } /* true if INDENT OFF is in effect */ static int inhibit_formatting; void dump_line () { /* dump_line is the routine that actually effects the printing of the new source. It prints the label section, followed by the code section with the appropriate nesting level, followed by any comments */ register int cur_col; register int target_col = 0; static not_first_line; if (parser_state_tos->procname[0]) { if (troff) { if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } fprintf (output, ".Pr \"%.*s\"\n", parser_state_tos->procname_end - parser_state_tos->procname, parser_state_tos->procname); } parser_state_tos->ind_level = 0; parser_state_tos->procname = "\0"; } /* A blank line */ if (s_code == e_code && s_lab == e_lab && s_com == e_com) { /* If we have a formfeed on a blank line, we should just output it, rather than treat it as a normal blank line. */ if (parser_state_tos->use_ff) { putc ('\014', output); parser_state_tos->use_ff = false; } else { if (suppress_blanklines > 0) suppress_blanklines--; else { parser_state_tos->bl_line = true; n_real_blanklines++; } } } else if (!inhibit_formatting) { suppress_blanklines = 0; parser_state_tos->bl_line = false; if (prefix_blankline_requested && not_first_line) { if (swallow_optional_blanklines && n_real_blanklines > 1) n_real_blanklines = 1; else if (n_real_blanklines == 0) n_real_blanklines = 1; } while (--n_real_blanklines >= 0) putc ('\n', output); n_real_blanklines = 0; if (parser_state_tos->ind_level == 0) parser_state_tos->ind_stmt = 0; /* this is a class A kludge. dont do additional statement indentation if we are at bracket level 0 */ if (e_lab != s_lab || e_code != s_code) ++code_lines; /* keep count of lines with code */ if (e_lab != s_lab) { /* print lab, if any */ if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; cur_col = pad_output (1, compute_label_target ()); if (s_lab[0] == '#' && (strncmp (s_lab, "#else", 5) == 0 || strncmp (s_lab, "#endif", 6) == 0)) { /* Treat #else and #endif as a special case because any text after #else or #endif should be converted to a comment. */ register char *s = s_lab; if (e_lab[-1] == '\n') e_lab--; do putc (*s++, output); while (s < e_lab && 'a' <= *s && *s <= 'z'); while ((*s == ' ' || *s == '\t') && s < e_lab) s++; if (s < e_lab) fprintf (output, s[0] == '/' && s[1] == '*' ? "\t%.*s" : "\t/* %.*s */", e_lab - s, s); } else fprintf (output, "%.*s", e_lab - s_lab, s_lab); cur_col = count_spaces (cur_col, s_lab); } else cur_col = 1; /* there is no label section */ parser_state_tos->pcase = false; if (s_code != e_code) { /* print code section, if any */ register char *p; if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } target_col = compute_code_target (); /* If a line ends in an lparen character, the following line should not line up with the parenthesis, but should be indented by the usual amount. */ if (parser_state_tos->last_token == lparen) { parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] += ind_size - 1; } { register i; for (i = 0; i < parser_state_tos->p_l_follow; i++) if (parser_state_tos->paren_indents[i] >= 0) parser_state_tos->paren_indents[i] = -(parser_state_tos->paren_indents[i] + target_col); } cur_col = pad_output (cur_col, target_col); for (p = s_code; p < e_code; p++) if (*p == (char) 0200) fprintf (output, "%d", target_col * 7); else putc (*p, output); cur_col = count_spaces (cur_col, s_code); } if (s_com != e_com) { if (troff) { int all_here = 0; register char *p; if (e_com[-1] == '/' && e_com[-2] == '*') e_com -= 2, all_here++; while (e_com > s_com && e_com[-1] == ' ') e_com--; *e_com = 0; p = s_com; while (*p == ' ') p++; if (p[0] == '/' && p[1] == '*') p += 2, all_here++; else if (p[0] == '*') p += p[1] == '/' ? 2 : 1; while (*p == ' ') p++; if (*p == 0) goto inhibit_newline; if (comment_open < 2 && parser_state_tos->box_com) { comment_open = 0; fprintf (output, ".*/\n"); } if (comment_open == 0) { if ('a' <= *p && *p <= 'z') *p = *p + 'A' - 'a'; if (e_com - p < 50 && all_here == 2) { register char *follow = p; fprintf (output, "\n.nr C! \\w\1"); while (follow < e_com) { switch (*follow) { case '\n': putc (' ', output); case 1: break; case '\\': putc ('\\', output); default: putc (*follow, output); } follow++; } putc (1, output); } fprintf (output, "\n./* %dp %d %dp\n", parser_state_tos->com_col * 7, (s_code != e_code || s_lab != e_lab) - parser_state_tos->box_com, target_col * 7); } comment_open = 1 + parser_state_tos->box_com; while (*p) { if (*p == BACKSLASH) putc (BACKSLASH, output); putc (*p++, output); } } else { /* print comment, if any */ register target = parser_state_tos->com_col; register char *com_st = s_com; target += parser_state_tos->comment_delta; while (*com_st == '\t') com_st++, target += tabsize; while (target <= 0) if (*com_st == ' ') target++, com_st++; else if (*com_st == '\t') { target = ((target - 1) & ~(tabsize - 1)) + (tabsize + 1); com_st++; } else target = 1; if (cur_col > target) { /* if comment cant fit on this line, put it on next line */ putc ('\n', output); cur_col = 1; ++out_lines; } while (e_com > com_st && isspace (e_com[-1])) e_com--; cur_col = pad_output (cur_col, target); if (!parser_state_tos->box_com) { if (star_comment_cont && (com_st[1] != '*' || e_com <= com_st + 1)) if (com_st[1] == ' ' && com_st[0] == ' ' && e_com > com_st + 1) com_st[1] = '*'; else fwrite (" * ", (com_st[0] == '\t' ? 2 : (com_st[0] == '*' ? 1 : 3)), 1, output); } fwrite (com_st, e_com - com_st, 1, output); parser_state_tos->comment_delta = parser_state_tos->n_comment_delta; cur_col = count_spaces (cur_col, com_st); ++com_lines; /* count lines with comments */ } } if (parser_state_tos->use_ff) { putc ('\014', output); parser_state_tos->use_ff = false; } else putc ('\n', output); inhibit_newline: ++out_lines; if (parser_state_tos->just_saw_decl == 1 && blanklines_after_declarations) { prefix_blankline_requested = 1; parser_state_tos->just_saw_decl = 0; } else prefix_blankline_requested = postfix_blankline_requested; postfix_blankline_requested = 0; } /* if we are in the middle of a declaration, remember that fact for proper comment indentation */ parser_state_tos->decl_on_line = parser_state_tos->in_decl; /* next line should be indented if we have not completed this stmt and if we are not in the middle of a declaration */ parser_state_tos->ind_stmt = (parser_state_tos->in_stmt & ~parser_state_tos->in_decl); parser_state_tos->dumped_decl_indent = 0; *(e_lab = s_lab) = '\0'; /* reset buffers */ *(e_code = s_code) = '\0'; *(e_com = s_com) = '\0'; parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->paren_level = parser_state_tos->p_l_follow; if (parser_state_tos->paren_level > 0) paren_target = -parser_state_tos->paren_indents[parser_state_tos->paren_level - 1]; else paren_target = 0; not_first_line = 1; return; } /* Figure out where we should put the code in codebuf. Return the column number in spaces. */ INLINE int compute_code_target () { register target_col = parser_state_tos->ind_level + 1; if (parser_state_tos->paren_level) if (!lineup_to_parens) target_col += continuation_indent * parser_state_tos->paren_level; else { register w; register t = paren_target; if ((w = count_spaces (t, s_code) - max_col) > 0 && count_spaces (target_col, s_code) <= max_col) { t -= w + 1; if (t > target_col) target_col = t; } else target_col = t; } else if (parser_state_tos->ind_stmt) target_col += continuation_indent; return target_col; } INLINE int compute_label_target () { return parser_state_tos->pcase ? case_ind + 1 : *s_lab == '#' ? 1 : parser_state_tos->ind_level - LABEL_OFFSET + 1; } /* Read file FILENAME into a `fileptr' structure, and return a pointer to that structure. */ static struct file_buffer fileptr; struct file_buffer * read_file (filename) char *filename; { int fd; struct stat file_stats; int namelen = strlen (filename); fd = open (filename, O_RDONLY, 0777); if (fd < 0) sys_error (filename); if (fstat (fd, &file_stats) < 0) sys_error (filename); if (fileptr.data != 0) free (fileptr.data); fileptr.size = file_stats.st_size; fileptr.data = (char *) xmalloc (file_stats.st_size + 1); if (read (fd, fileptr.data, fileptr.size) < 0) sys_error (filename); if (close (fd) < 0) sys_error (filename); fileptr.name = (char *) xmalloc (namelen + 1); memcpy (fileptr.name, filename, namelen); fileptr.name[namelen] = '\0'; fileptr.data[fileptr.size] = '\0'; return &fileptr; } /* This should come from stdio.h and be some system-optimal number */ #ifndef BUFSIZ #define BUFSIZ 1024 #endif /* Suck the standard input into a file_buffer structure, and return a pointer to that structure. */ struct file_buffer stdinptr; struct file_buffer * read_stdin () { unsigned int size = 15 * BUFSIZ; int ch; register char *p; if (stdinptr.data != 0) free (stdinptr.data); stdinptr.data = (char *) xmalloc (size + 1); stdinptr.size = 0; p = stdinptr.data; do { while (stdinptr.size < size) { ch = getc (stdin); if (ch == EOF) break; *p++ = ch; stdinptr.size++; } if (ch != EOF) { size += (2 * BUFSIZ); stdinptr.data = xrealloc (stdinptr.data, size); } } while (ch != EOF); stdinptr.name = "Standard Input"; stdinptr.data[stdinptr.size] = '\0'; return &stdinptr; } /* Advance buf_ptr so that it points to the next line of input. Skip over indent errors (comments beginning with *INDENT**), ignoring them. Process INDENT ON and INDENT OFF. (Note: the name of this function is a historical artifact from before the time that indent kept the whole source file in memory). */ INLINE void fill_buffer () { /* Point various places in the buffer. */ register char *p; /* Character P points to. */ register char c; /* Have we found INDENT ON or INDENT OFF ? */ enum { None, Indent_on, Indent_off } com; /* indent() may be saving the text between "if (...)" and the following statement. To do so, it uses another buffer (`save_com'). Switch back to the previous buffer here. */ if (bp_save != 0) { buf_ptr = bp_save; buf_end = be_save; bp_save = be_save = 0; /* only return if there is really something in this buffer */ if (buf_ptr < buf_end) return; } fill_it: cur_line = in_prog_pos; buf_ptr = in_prog_pos; if (*buf_ptr == '\0') { had_eof = true; return; } p = buf_ptr; do { c = *p; p++; } while (c != '\0' && c != '\n'); buf_end = p; p = buf_ptr; in_prog_pos = buf_end; while (*p == ' ' || *p == '\t') p++; if (*p == '/' && p[1] == '*') { p += 2; if (p[1] == 'I' && strncmp (p, "*INDENT**", 9) == 0) goto fill_it; while (*p == ' ' || *p == '\t') p++; com = None; if (p[0] == 'I' && p[1] == 'N' && p[2] == 'D' && p[3] == 'E' && p[4] == 'N' && p[5] == 'T') { p += 6; while (*p == ' ' || *p == '\t') p++; if (*p == '*') com = Indent_on; else if (*p == 'O') if (*++p == 'N') p++, com = Indent_on; else if (*p == 'F' && *++p == 'F') p++, com = Indent_off; while (*p == ' ' || *p == '\t') p++; if (p[0] == '*' && p[1] == '/' && p[2] == '\n' && com) { if (s_com != e_com || s_lab != e_lab || s_code != e_code) dump_line (); if (!(inhibit_formatting = (int) com - 1)) { n_real_blanklines = 0; postfix_blankline_requested = 0; prefix_blankline_requested = 0; suppress_blanklines = 1; } } } } if (inhibit_formatting) { p = buf_ptr; do putc (*p, output); while (*p++ != '\n'); } } /* Copyright (C) 1976 by the Board of Trustees of the University of Illinois All rights reserved NAME: pad_output FUNCTION: Writes tabs and spaces to move the current column up to the desired position. ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf. PARAMETERS: current integer The current column target nteger The desired column RETURNS: Integer value of the new column. (If current >= target, no action is taken, and current is returned. GLOBALS: None CALLS: write (sys) CALLED BY: dump_line HISTORY: initial coding November 1976 D A Willcox of CAC */ INLINE int pad_output (current, target) /* writes tabs and blanks (if necessary) to get the current output position up to the target column */ int current; /* the current column value */ int target; /* position we want it at */ { register int curr; /* internal column pointer */ register int tcur; if (troff) fprintf (output, "\\h'|%dp'", (target - 1) * 7); else { if (current >= target) return (current); /* line is already long enough */ curr = current; while ((tcur = curr + tabsize - (curr - 1) % tabsize) <= target) { putc ('\t', output); curr = tcur; } while (curr++ < target) putc (' ', output); /* pad with final blanks */ } return (target); } /* Copyright (C) 1976 by the Board of Trustees of the University of Illinois All rights reserved NAME: count_spaces FUNCTION: Find out where printing of a given string will leave the current character position on output. ALGORITHM: Run thru input string and add appropriate values to current position. RETURNS: Integer value of position after printing "buffer" starting in column "current". HISTORY: initial coding November 1976 D A Willcox of CAC */ INLINE int count_spaces (current, buffer) /* this routine figures out where the character position will be after printing the text in buffer starting at column "current" */ int current; char *buffer; { register char *buf; /* used to look thru buffer */ register int cur; /* current character counter */ cur = current; for (buf = buffer; *buf != '\0'; ++buf) { switch (*buf) { case '\n': case 014: /* form feed */ cur = 1; break; case '\t': cur = cur + tabsize - (cur - 1) % tabsize; break; case 010: /* backspace */ --cur; break; default: ++cur; break; } /* end of switch */ } /* end of for loop */ return (cur); } /* Nonzero if we have found an error (not a warning). */ int found_err; /* Signal an error. LEVEL is nonzero if it is an error (as opposed to a warning. MSG is a printf-style format string. Additional arguments are additional arguments for printf. */ /* VARARGS2 */ diag (level, msg, a, b) int level; unsigned int a, b; char *msg; { if (level) found_err = 1; if (output == stdout) { fprintf (stdout, "/**INDENT** %s@%d: ", level == 0 ? "Warning" : "Error", line_no); fprintf (stdout, msg, a, b); fprintf (stdout, " */\n"); } else { fprintf (stderr, "%s: %d: ", in_name, line_no); fprintf (stderr, msg, a, b); fprintf (stderr, "\n"); } } writefdef (f, nm) register struct fstate *f; unsigned int nm; { fprintf (output, ".ds f%c %s\n.nr s%c %d\n", nm, f->font, nm, f->size); } /* Write characters starting at S to change the font from OF to NF. Return a pointer to the character after the last character written. For troff mode only. */ char * chfont (of, nf, s) register struct fstate *of, *nf; char *s; { if (of->font[0] != nf->font[0] || of->font[1] != nf->font[1]) { *s++ = '\\'; *s++ = 'f'; if (nf->font[1]) { *s++ = '('; *s++ = nf->font[0]; *s++ = nf->font[1]; } else *s++ = nf->font[0]; } if (nf->size != of->size) { *s++ = '\\'; *s++ = 's'; if (nf->size < of->size) { *s++ = '-'; *s++ = '0' + of->size - nf->size; } else { *s++ = '+'; *s++ = '0' + nf->size - of->size; } } return s; } void parsefont (f, s0) register struct fstate *f; char *s0; { register char *s = s0; int sizedelta = 0; int i; f->size = 0; f->allcaps = 1; for (i = 0; i < 4; i++) f->font[i] = 0; while (*s) { if (isdigit (*s)) f->size = f->size * 10 + *s - '0'; else if (isupper (*s)) if (f->font[0]) f->font[1] = *s; else f->font[0] = *s; else if (*s == 'c') f->allcaps = 1; else if (*s == '+') sizedelta++; else if (*s == '-') sizedelta--; else { fprintf (stderr, "indent: bad font specification: %s\n", s0); exit (1); } s++; } if (f->font[0] == 0) f->font[0] = 'R'; if (bodyf.size == 0) bodyf.size = 11; if (f->size == 0) f->size = bodyf.size + sizedelta; else if (sizedelta > 0) f->size += bodyf.size; else f->size = bodyf.size - f->size; } #ifdef DEBUG void dump_debug_line () { fprintf (output, "\n*** Debug output marker line ***\n"); } #endif indent-2.2.11/regression/standard/embedded-cuddle2.c0000644000177400010010000000010010775646104017170 00000000000000void foo() { #ifdef foo if (1) { } /* if */ #endif } indent-2.2.11/regression/standard/indent.pro.c0000644000177400010010000000005610775646104016211 00000000000000main() { int i, j; i <<= 1; j >>= 1; } indent-2.2.11/regression/standard/comments.c0000644000177400010010000000155010775646104015756 00000000000000char * frob ( /* comment1 */ struct foo *param1, /* comment 2 * continued. */ int param (int (*)(char, void *, /* Really a * `struct foo *' */ char ccccccc, /* Extra param */ int *)), char *fooooooooooooooooo /* comment3, also * continued */ ) { int aaaaaaaaaaaaaaaaaaaaa, /* comment1 */ bc, /* comment2 */ def; /* comment3 */ if (1) { char *a, /* comment1 */ *bcccccccccccccccc, /* comment2 */ d; /* comment3 */ } if (strcmp (a /* comment a */ , b, /* comment b */ )) ; if (func_xxxxxxxxxxxxxxxx (a, /* comment 1 */ b, /* comment 2, * continued. */ c, /* comment 3 */ d (a + 11, /* comment 4a */ b - 11, /* comment 4b * continued. */ 11111), /* comment 5 */ e)) ; } indent-2.2.11/regression/standard/brackets34.c0000644000177400010010000000053110775646104016074 00000000000000void foo () { if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) mask = NULL; if ((acptr = FindUser (nick)) && ((!(bitsel & WHOSELECT_OPER)) || IsAnOper (acptr)) && Process (acptr) && SHOW_MORE (sptr, counter)) mask = NULL; } indent-2.2.11/regression/standard/dirent_def.h0000644000177400010010000000001710775646104016236 00000000000000#define DIRENT indent-2.2.11/regression/standard/empty.c0000644000177400010010000000007210775646104015265 00000000000000 /* */ /* */ /* */ /* */ indent-2.2.11/regression/standard/bad-comment.c0000644000177400010010000000016010775646104016313 00000000000000void zero (void) { struct cmtsConfig cmtscfg; /* CMTS configuration table used for initialization */ } indent-2.2.11/regression/standard/tabs.c-20000644000177400010010000000044410775646104015222 00000000000000 /* Here is a column 1 comment with tab tab and tab In the columns: ^ ^ ^ those */ main () { int i = 33; /* Here there everywhere here.. and that's it tab ^--------^------------^-----------^------------- */ foo (i); } indent-2.2.11/regression/standard/newlines.c-60000644000177400010010000000210410775646104016114 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR Now here are some blank lines: IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/pr_comment.c0000644000177400010010000003250111145774471016275 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* NAME: pr_comment FUNCTION: This routine takes care of scanning and printing comments. ALGORITHM: 1) Decide where the comment should be aligned, and if lines should be broken. 2) If lines should not be broken and filled, just copy up to end of comment. 3) If lines should be filled, then scan thru input_buffer copying characters to com_buf. Remember where the last blank, tab, or newline was. When line is filled, print up to last blank and continue copying. HISTORY: November 1976 D A Willcox of CAC Initial coding 12/6/76 A Willcox of CAC Modification to handle UNIX-style comments */ /* this routine processes comments. It makes an attempt to keep comments from going over the max line length. If a line is too long, it moves everything from the last blank to the next comment line. Blanks and tabs from the beginning of the input line are removed */ #include "sys.h" #include "indent.h" /* Declared and documented in indent.h. */ int out_coms; pr_comment () { int now_col; /* column we are in now */ int adj_max_col; /* Adjusted max_col for when we decide to spill comments over the right margin */ char *last_bl; /* points to the last blank in the output buffer */ char *t_ptr; /* used for moving string */ int unix_comment; /* tri-state variable used to decide if it is a unix-style comment. 0 means only blanks since /*, 1 means regular style comment, 2 means unix style comment */ int break_delim = comment_delimiter_on_blankline; int l_just_saw_decl = parser_state_tos->just_saw_decl; /* int parser_state_tos->last_nl = 0; /* true iff the last significant thing weve seen is a newline */ int one_liner = 1; /* true iff this comment is a one-liner */ adj_max_col = max_col; parser_state_tos->just_saw_decl = 0; last_bl = 0; /* no blanks found so far */ parser_state_tos->box_com = false; /* at first, assume that we are not in a boxed comment or some other comment that should not be touched */ ++out_coms; /* keep track of number of comments */ unix_comment = 1; /* set flag to let us figure out if there is a unix-style comment ** DISABLED: use 0 to reenable this hack! */ /* Figure where to align and how to treat the comment */ if (parser_state_tos->col_1 && !format_col1_comments) { /* if comment starts in column 1 it should not be touched */ parser_state_tos->box_com = true; parser_state_tos->com_col = 1; } else { if (*buf_ptr == '-' || *buf_ptr == '*' || !format_comments) { parser_state_tos->box_com = true; /* a comment with a '-' or '*' immediately after the /* is assumed to be a boxed comment */ break_delim = 0; } /* Used to also check that parser_state_tos->bl_line != 0 */ if ((s_lab == e_lab) && (s_code == e_code)) { /* klg: check only if this line is blank */ /* If this (*and previous lines are*) blank, dont put comment way out at left */ parser_state_tos->com_col = (parser_state_tos->ind_level - unindent_displace) + 1; adj_max_col = block_comment_max_col; if (parser_state_tos->com_col <= 1) parser_state_tos->com_col = 1 + !format_col1_comments; /* If we have a comment in an old-style (pre-ANSI) parameter declaration, indent it like we would the parameter declaration. For example: int destroy (what) / * N things to destroy. * / int what; */ if (parser_state_tos->in_parameter_declaration && indent_parameters != 0 && parser_state_tos->dec_nest == 0) { parser_state_tos->com_col = indent_parameters + 1; parser_state_tos->ind_stmt = 0; } } else { register target_col; break_delim = 0; if (s_code != e_code) target_col = count_spaces (compute_code_target (), s_code); else { target_col = 1; if (s_lab != e_lab) target_col = count_spaces (compute_label_target (), s_lab); } parser_state_tos->com_col = parser_state_tos->decl_on_line || parser_state_tos->ind_level == 0 ? decl_com_ind : com_ind; /* If we are already past the position for the comment, put it at the next tab stop. */ if (parser_state_tos->com_col < target_col) parser_state_tos->com_col = ((target_col + (tabsize - 1)) & ~(tabsize - 1)) + 1; if (else_or_endif) { parser_state_tos->com_col = else_endif_col; else_or_endif = false; /* We want the comment to appear one space after the #else or #endif. */ if (parser_state_tos->com_col < target_col) parser_state_tos->com_col = target_col + 1; } if (parser_state_tos->com_col + 24 > adj_max_col) adj_max_col = parser_state_tos->com_col + 24; } } if (parser_state_tos->box_com) { parser_state_tos->n_comment_delta = 1 - parser_state_tos->com_col; #if 0 buf_ptr[-2] = 0; parser_state_tos->n_comment_delta = 1 - count_spaces (1, cur_line); buf_ptr[-2] = '/'; #endif } else { parser_state_tos->n_comment_delta = 0; while (*buf_ptr == ' ' || *buf_ptr == '\t') buf_ptr++; } parser_state_tos->comment_delta = 0; *e_com++ = '/'; /* put '/*' into buffer */ *e_com++ = '*'; if (*buf_ptr != ' ' && !parser_state_tos->box_com) *e_com++ = ' '; *e_com = '\0'; if (troff) { now_col = 1; adj_max_col = 80; } else /* figure what column we would be in if we printed the comment now */ now_col = count_spaces (parser_state_tos->com_col, s_com); /* Start to copy the comment */ while (1) { /* this loop will go until the comment is copied */ if (*buf_ptr > 040 && *buf_ptr != '*') parser_state_tos->last_nl = 0; check_com_size; switch (*buf_ptr) { /* this checks for various spcl cases */ case 014: /* check for a form feed */ if (!parser_state_tos->box_com) { /* in a text comment, break the line here */ parser_state_tos->use_ff = true; /* fix so dump_line uses a form feed */ dump_line (); last_bl = 0; *e_com++ = ' '; *e_com++ = '*'; *e_com++ = ' '; while (*++buf_ptr == ' ' || *buf_ptr == '\t'); } else { if (++buf_ptr >= buf_end) fill_buffer (); *e_com++ = 014; } break; case '\n': if (had_eof) { /* check for unexpected eof */ printf ("Unterminated comment\n"); *e_com = '\0'; dump_line (); return; } one_liner = 0; if (parser_state_tos->box_com || parser_state_tos->last_nl) { /* if this is a boxed comment, we dont ignore the newline */ if (s_com == e_com) { *e_com++ = ' '; *e_com++ = ' '; } *e_com = '\0'; if (!parser_state_tos->box_com && e_com - s_com > 3) { if (break_delim == 1 && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } dump_line (); check_com_size; *e_com++ = ' '; *e_com++ = ' '; } dump_line (); now_col = parser_state_tos->com_col; } else { parser_state_tos->last_nl = 1; if (unix_comment != 1) { /* we not are in unix_style comment */ if (unix_comment == 0 && s_code == e_code) { /* if it is a UNIX-style comment, ignore the requirement that previous line be blank for unindention */ parser_state_tos->com_col = ((parser_state_tos->ind_level - unindent_displace) + ind_size); if (parser_state_tos->com_col <= 1) parser_state_tos->com_col = 2; } unix_comment = 2; /* permanently remember that we are in this type of comment */ dump_line (); ++line_no; now_col = parser_state_tos->com_col; *e_com++ = ' '; /* fix so that the star at the start of the line will line up */ do /* flush leading white space */ if (++buf_ptr >= buf_end) fill_buffer (); while (*buf_ptr == ' ' || *buf_ptr == '\t'); break; } if (*(e_com - 1) == ' ' || *(e_com - 1) == '\t') last_bl = e_com - 1; /* if there was a space at the end of the last line, remember where it was */ else { /* otherwise, insert one */ last_bl = e_com; check_com_size; *e_com++ = ' '; ++now_col; } } ++line_no; /* keep track of input line number */ if (!parser_state_tos->box_com) { int nstar = 1; do { /* flush any blanks and/or tabs at start of next line */ if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '*' && --nstar >= 0) { if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '/') goto end_of_comment; } } while (*buf_ptr == ' ' || *buf_ptr == '\t'); } else if (++buf_ptr >= buf_end) fill_buffer (); break; /* end of case for newline */ case '*': /* must check for possibility of being at end of comment */ if (++buf_ptr >= buf_end) /* get to next char after * */ fill_buffer (); if (unix_comment == 0) /* set flag to show we are not in unix-style comment */ unix_comment = 1; if (*buf_ptr == '/') { /* it is the end!!! */ end_of_comment: if (++buf_ptr >= buf_end) fill_buffer (); if (*(e_com - 1) != ' ' && !parser_state_tos->box_com) { /* insure blank before end */ *e_com++ = ' '; ++now_col; } if (break_delim == 1 && !one_liner && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } if (break_delim == 2 && e_com > s_com + 3 /* now_col > adj_max_col - 2 && !parser_state_tos->box_com */ ) { *e_com = '\0'; dump_line (); now_col = parser_state_tos->com_col; } check_com_size; *e_com++ = '*'; *e_com++ = '/'; *e_com = '\0'; parser_state_tos->just_saw_decl = l_just_saw_decl; return; } else { /* handle isolated '*' */ *e_com++ = '*'; ++now_col; } break; default: /* we have a random char */ if (unix_comment == 0 && *buf_ptr != ' ' && *buf_ptr != '\t') unix_comment = 1; /* we are not in unix-style comment */ *e_com = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); if (*e_com == '\t') /* keep track of column */ now_col = now_col + tabsize - (now_col - 1) % tabsize; else if (*e_com == '\b') /* this is a backspace */ --now_col; else ++now_col; if (*e_com == ' ' || *e_com == '\t') last_bl = e_com; /* remember we saw a blank */ ++e_com; if (now_col > adj_max_col && !parser_state_tos->box_com && unix_comment == 1 && e_com[-1] > ' ') { /* the comment is too long, it must be broken up */ if (break_delim == 1 && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } if (last_bl == 0) { /* we have seen no blanks */ last_bl = e_com; /* fake it */ *e_com++ = ' '; } *e_com = '\0'; /* print what we have */ *last_bl = '\0'; while (last_bl > s_com && last_bl[-1] < 040) *--last_bl = 0; e_com = last_bl; dump_line (); *e_com++ = ' '; /* add blanks for continuation */ *e_com++ = ' '; *e_com++ = ' '; t_ptr = last_bl + 1; last_bl = 0; if (t_ptr >= e_com) { while (*t_ptr == ' ' || *t_ptr == '\t') t_ptr++; while (*t_ptr != '\0') { /* move unprinted part of comment down in buffer */ if (*t_ptr == ' ' || *t_ptr == '\t') last_bl = e_com; *e_com++ = *t_ptr++; } } *e_com = '\0'; /* recompute current position */ now_col = count_spaces (parser_state_tos->com_col, s_com); } break; } } } indent-2.2.11/regression/standard/comments2.c0000644000177400010010000000017010775646104016035 00000000000000void count_memory() { int lc = 0, /* local clients */ ch = 0, /* channels */ co = 0; /* conf lines */ } indent-2.2.11/regression/standard/class-func.cc0000644000177400010010000000005310775646104016327 00000000000000classname::procname () { if (a) 1; } indent-2.2.11/regression/standard/bbb-test.c0000644000177400010010000000105410775646104015632 00000000000000int x; /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ #if x /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ void main (int argc, char *argv[]) { int y; printf ("foo"); /********************************* * Block Comment * * */ } indent-2.2.11/regression/standard/sizeof-in-while.c0000644000177400010010000000006110775646104017136 00000000000000f () { do g (); while (sizeof (char)); } indent-2.2.11/regression/standard/comment-break.c0000644000177400010010000000076210775646104016661 00000000000000int snafuscate ( // char *foo, /* text to be snafuscated */ int bar, /* snafuscation index. NOTE: For non-integral snafuscation indices, use fsnafuscate(). */ int flags) /* defined in snafuscate.h */ { } int snafuscate ( /* */ char *foo, /* text to be snafuscated */ int bar, /* snafuscation index. NOTE: For non-integral snafuscation indices, use fsnafuscate(). */ int flags) /* defined in snafuscate.h */ { } indent-2.2.11/regression/standard/else-comment-bl.c0000644000177400010010000000316310775646104017116 00000000000000void foo () { if (0) i = 0; else /* This is a dirty place to put a comment */ if (1) i = 0; else /* comment behind else */ /* comment on new line, after else */ i = 0; if (0) /* Lets put a comment here too */ i = 0; else /* This is a dirty place to put a multi-line comment */ if (1) i = 0; else /* multi-line comment behind else */ i = 0; if (0) /* Lets put a comment here too */ i = 0; else /* This is a dirty place to put a comment */ if (1) i = 0; else /* comment behind else */ /* comment on new line, after else */ i = 0; if (0) i = 0; else if (1) /* comment after if */ i = 0; else /* multi-line comment */ i = 0; if (0) { i = 0; } else /* This is a dirty place to put a comment */ if (1) { i = 0; } else /* comment behind else */ { /* comment on new line, after else */ i = 0; } if (0) { /* Lets put a comment here too */ i = 0; } else /* This is a dirty place to put a multi-line comment */ if (1) { i = 0; } else /* multi-line comment behind else */ { i = 0; } if (0) /* Lets put a comment here too */ { i = 0; } else /* This is a dirty place to put a comment */ if (1) { i = 0; } else /* comment behind else */ /* comment on new line, after else */ { i = 0; } if (0) { i = 0; } else if (1) /* comment after if */ { i = 0; } else { /* multi-line comment */ i = 0; } } indent-2.2.11/regression/standard/cplus.c-80000644000177400010010000000205610775646104015426 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to // right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here // is a very long C plus plus comment very long C // plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very // long C plus plus // comment Here is a // very long C plus // plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/cplus.c-30000644000177400010010000000175010775646104015421 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here is a very long C plus plus comment very long C plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very long C plus plus comment Here is a very long C plus plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/indent.c.~1~0000644000177400010010000014140411145773413016144 00000000000000 /* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" #include void usage () { fprintf (stderr, "usage: indent file [-o outfile ] [ options ]\n"); fprintf (stderr, " indent file1 file2 ... fileN [ options ]\n"); exit (1); } /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *labbuf; char *s_lab; char *e_lab; char *l_lab; char *codebuf; char *s_code; char *e_code; char *l_code; char *combuf; char *s_com; char *e_com; char *l_com; struct buf save_com; char *bp_save; char *be_save; int code_lines; int line_no; struct fstate keywordf; struct fstate stringf; struct fstate boxcomf; struct fstate blkcomf; struct fstate scomf; struct fstate bodyf; int break_comma; /* Insure that BUFSTRUC has at least REQ more chars left, if not extend it. Note: This may change bufstruc.ptr. */ #define need_chars(bufstruc, req) \ if ((bufstruc.end - bufstruc.ptr + (req)) >= bufstruc.size) \ {\ int cur_chars = bufstruc.end - bufstruc.ptr;\ bufstruc.size *= 2;\ bufstruc.ptr = xrealloc(bufstruc.ptr,bufstruc.size);\ bufstruc.end = bufstruc.ptr + cur_chars;\ } int else_or_endif; /* true iff last keyword was an else */ int last_else; /* True if we have just encountered the end of an if (...), etc. (i.e. the ')' of the if (...) was the last token). The variable is set to 2 in the middle of the main token reading loop and is decremented at the beginning of the loop, so it will reach zero when the second token after the ')' is read. */ int last_token_ends_sp; /* current indentation for declarations */ int dec_ind; /* structure indentation levels */ int *di_stack; /* Currently allocated size of di_stack. */ int di_stack_alloc; /* used when buffering up comments to remember that a newline was passed over */ int flushed_nl; int force_nl; /* set to true when we see a case, so we will know what to do with the following colon */ int scase; /* when true, we are in the expressin of if(...), while(...), etc. */ int sp_sw; /* when this is positive, we have seen a ? without the matching : in a ?: construct */ int squest; static void indent (this_file) struct file_buffer *this_file; { register int i; enum codes hd_type; register char *t_ptr; enum codes type_code; int dec_ind; /* current indentation for declarations */ int flushed_nl; int force_nl; int scase; /* true when we've just see a case */ int sp_sw; /* when true, we are in the expressin of if(...), while(...), etc. */ /* True if we have just encountered the end of an if (...), etc. (i.e. the ')' of the if (...) was the last token). The variable is set to 2 in the middle of the main token reading loop and is decremented at the beginning of the loop, so it will reach zero when the second token after the ')' is read. */ int last_token_ends_sp; int squest; /* when this is positive, we have seen a ? without the matching : in a ?: construct */ int last_else; /* true iff last keyword was an else */ in_prog = in_prog_pos = this_file->data; in_prog_size = this_file->size; hd_type = code_eof; dec_ind = 0; last_token_ends_sp = false; last_else = false; sp_sw = force_nl = false; scase = false; if (com_ind <= 1) com_ind = 2; /* dont put normal comments before column 2 */ if (troff) { if (bodyf.font[0] == 0) parsefont (&bodyf, "R"); if (scomf.font[0] == 0) parsefont (&scomf, "I"); if (blkcomf.font[0] == 0) blkcomf = scomf, blkcomf.size += 2; if (boxcomf.font[0] == 0) boxcomf = blkcomf; if (stringf.font[0] == 0) parsefont (&stringf, "L"); if (keywordf.font[0] == 0) parsefont (&keywordf, "B"); writefdef (&bodyf, 'B'); writefdef (&scomf, 'C'); writefdef (&blkcomf, 'L'); writefdef (&boxcomf, 'X'); writefdef (&stringf, 'S'); writefdef (&keywordf, 'K'); } if (block_comment_max_col <= 0) block_comment_max_col = max_col; if (decl_com_ind <= 0) /* if not specified by user, set this */ decl_com_ind = ljust_decl ? (com_ind <= 10 ? 2 : com_ind - 8) : com_ind; if (continuation_indent == 0) continuation_indent = ind_size; fill_buffer (); /* get first batch of stuff into input buffer */ parse (semicolon); { register char *p = buf_ptr; register col = 1; while (1) { if (*p == ' ') col++; else if (*p == '\t') col = ((col - 1) & ~7) + 9; else break; p++; } if (col > ind_size) parser_state_tos->ind_level = parser_state_tos->i_l_follow = col; } if (troff) { register char *p = in_name, *beg = in_name; while (*p) if (*p++ == '/') beg = p; fprintf (output, ".Fn \"%s\"\n", beg); } /* START OF MAIN LOOP */ while (1) { /* this is the main loop. it will go until we reach eof */ int is_procname; type_code = lexi (); /* lexi reads one token. "token" points to the actual characters. lexi returns a code indicating the type of token */ if (last_token_ends_sp > 0) last_token_ends_sp--; is_procname = parser_state_tos->procname[0]; /* The following code moves everything following an if (), while (), else, etc. up to the start of the following stmt to a buffer. This allows proper handling of both kinds of brace placement. */ flushed_nl = false; while (parser_state_tos->search_brace) { /* After scanning an if(), while (), etc., it might be necessary to keep track of the text between the if() and the start of the statement which follows. Use save_com to do so. */ switch (type_code) { case newline: ++line_no; flushed_nl = true; case form_feed: break; /* form feeds and newlines found here will be ignored */ case lbrace: /* this is a brace that starts the compound stmt */ if (save_com.end == save_com.ptr) { /* ignore buffering if a comment wasnt stored up */ parser_state_tos->search_brace = false; goto check_type; } /* We need to put the '{' back into save_com somewhere. */ if (btype_2) /* Put it at the beginning, e.g. if (foo) { / * comment here * / */ save_com.ptr[0] = '{'; else { /* Put it at the end, e.g. if (foo) / * comment here * / { */ /* Putting in this newline causes a dump_line to occur right after the comment, thus insuring that it will be put in the correct column. */ *save_com.end++ = '\n'; *save_com.end++ = '{'; } /* Go to common code to get out of this loop. */ goto sw_buffer; case comment: /* we have a comment, so we must copy it into the buffer */ if (!flushed_nl || save_com.end != save_com.ptr) { need_chars (save_com, 10); if (save_com.end == save_com.ptr) { /* if this is the first comment, we must set up the buffer */ save_com.ptr[0] = save_com.ptr[1] = ' '; save_com.end = save_com.ptr + 2; } else { *save_com.end++ = '\n'; /* add newline between comments */ *save_com.end++ = ' '; --line_no; } *save_com.end++ = '/'; /* copy in start of comment */ *save_com.end++ = '*'; for (;;) { /* loop until we get to the end of the comment */ /* make sure there is room for this character and (while we're at it) the '/' we might add at the end of the loop. */ need_chars (save_com, 2); *save_com.end = *buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer (); if (had_eof) { diag (1, "Unclosed comment"); exit (1); } } if (*save_com.end++ == '*' && *buf_ptr == '/') break; /* we are at end of comment */ } *save_com.end++ = '/'; /* add ending slash */ if (++buf_ptr >= buf_end) /* get past / in buffer */ fill_buffer (); break; } default: /* it is the start of a normal statment */ if (flushed_nl) /* if we flushed a newline, make sure it is put back */ force_nl = true; if ((type_code == sp_paren && *token == 'i' && last_else && else_if) || (type_code == sp_nparen && *token == 'e' && e_code != s_code && e_code[-1] == '}')) force_nl = false; if (save_com.end == save_com.ptr) { /* ignore buffering if comment wasnt saved up */ parser_state_tos->search_brace = false; goto check_type; } if (force_nl) { /* if we should insert a nl here, put it into the buffer */ force_nl = false; --line_no; /* this will be re-increased when the nl is read from the buffer */ need_chars (save_com, 2); *save_com.end++ = '\n'; *save_com.end++ = ' '; if (verbose && !flushed_nl) /* print error msg if the line was not already broken */ diag (0, "Line broken"); flushed_nl = false; } for (t_ptr = token; t_ptr < token_end; ++t_ptr) { need_chars (save_com, 1); *save_com.end++ = *t_ptr; /* copy token into temp buffer */ } parser_state_tos->procname = "\0"; sw_buffer: parser_state_tos->search_brace = false; /* stop looking for start of stmt */ bp_save = buf_ptr; /* save current input buffer */ be_save = buf_end; buf_ptr = save_com.ptr; /* fix so that subsequent calls to lexi will take tokens out of save_com */ need_chars (save_com, 1); *save_com.end++ = ' '; /* add trailing blank, just in case */ buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ break; } /* end of switch */ /* we must make this check, just in case there was an unexpected EOF */ if (type_code != code_eof) type_code = lexi (); /* read another token */ /* if (parser_state_tos->search_brace) parser_state_tos->procname[0] = 0; */ if ((is_procname = parser_state_tos->procname[0]) && flushed_nl && !procnames_start_line && parser_state_tos->in_decl && type_code == ident) flushed_nl = 0; } /* end of while (search_brace) */ last_else = 0; check_type: if (type_code == code_eof) { /* we got eof */ if (s_lab != e_lab || s_code != e_code || s_com != e_com) /* must dump end of line */ dump_line (); if (parser_state_tos->tos > 1) /* check for balanced braces */ diag (1, "Stuff missing from end of file."); if (verbose) { printf ("There were %d output lines and %d comments\n", out_lines, out_coms); printf ("(Lines with comments)/(Lines with code): %6.3f\n", (1.0 * com_lines) / code_lines); } fflush (output); if (found_err) exit (found_err); return; } if ((type_code != comment) && (type_code != newline) && (type_code != preesc) && (type_code != form_feed)) { if (force_nl && (type_code != semicolon) && (type_code != lbrace || !btype_2)) { /* we should force a broken line here */ if (verbose && !flushed_nl) diag (0, "Line broken"); flushed_nl = false; dump_line (); parser_state_tos->want_blank = false; /* dont insert blank at line start */ force_nl = false; } parser_state_tos->in_stmt = true; /* turn on flag which causes an extra level of indentation. this is turned off by a ; or } */ if (s_com != e_com) { /* the turkey has embedded a comment in a line. Move it from the com buffer to the code buffer. */ /* Do not add a space before the comment if it is the first thing on the line. */ if (e_code != s_code) { *e_code++ = ' '; } for (t_ptr = s_com; *t_ptr; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } *e_code++ = ' '; *e_code = '\0'; /* null terminate code sect */ parser_state_tos->want_blank = false; e_com = s_com; } } else if (type_code != comment) /* preserve force_nl thru a comment */ force_nl = false; /* cancel forced newline after newline, form feed, etc */ /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ check_code_size; switch (type_code) { /* now, decide what to do with the token */ case form_feed: /* found a form feed in line */ parser_state_tos->use_ff = true; /* a form feed is treated much like a newline */ dump_line (); parser_state_tos->want_blank = false; break; case newline: if (parser_state_tos->last_token != comma || parser_state_tos->p_l_follow > 0 || !leave_comma || parser_state_tos->block_init || !break_comma || s_com != e_com) { dump_line (); parser_state_tos->want_blank = false; } /* If we were on the line with a #else or a #endif, we aren't anymore. */ else_or_endif = false; ++line_no; /* keep track of input line number */ break; case lparen: /* Braces in initializer lists should be put on new lines. This is necessary so that -gnu does not cause things like char *this_is_a_string_array[] = { "foo", "this_string_does_not_fit", "nor_does_this_rather_long_string" } which is what happens because we are trying to line the strings up with the parentheses, and those that are too long are moved to the right an ugly amount. However, if the current line is empty, the left brace is already on a new line, so don't molest it. */ if (token[0] == '{' && (s_code != e_code || s_com != e_com || s_lab != e_lab)) { dump_line (); /* Do not put a space before the '{'. */ parser_state_tos->want_blank = false; } /* Count parens so we know how deep we are. */ if (++parser_state_tos->p_l_follow >= parser_state_tos->paren_indents_size) { parser_state_tos->paren_indents_size *= 2; parser_state_tos->paren_indents = (short *) xrealloc (parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } parser_state_tos->paren_depth++; if (parser_state_tos->want_blank && *token != '[' && (parser_state_tos->last_token != ident || proc_calls_space || (parser_state_tos->its_a_keyword && (!parser_state_tos->sizeof_keyword || blank_after_sizeof)))) *e_code++ = ' '; if (parser_state_tos->in_decl && !parser_state_tos->block_init) if (troff && !parser_state_tos->dumped_decl_indent && !is_procname && parser_state_tos->last_token == decl) { parser_state_tos->dumped_decl_indent = 1; sprintf (e_code, "\n.Du %dp+\200p \"%.*s\"\n", dec_ind * 7, token_end - token, token); e_code += strlen (e_code); } else { while ((e_code - s_code) < dec_ind) { check_code_size; *e_code++ = ' '; } *e_code++ = token[0]; } else *e_code++ = token[0]; parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] = e_code - s_code; if (sp_sw && parser_state_tos->p_l_follow == 1 && extra_expression_indent && parser_state_tos->paren_indents[0] < 2 * ind_size) parser_state_tos->paren_indents[0] = 2 * ind_size; parser_state_tos->want_blank = false; if (parser_state_tos->in_or_st && *token == '(' && parser_state_tos->tos <= 2) { /* this is a kluge to make sure that declarations will be aligned right if proc decl has an explicit type on it, i.e. "int a(x) {..." */ parse_lparen_in_decl (); /* Turn off flag for structure decl or initialization. */ parser_state_tos->in_or_st = false; } if (parser_state_tos->sizeof_keyword) parser_state_tos->sizeof_mask |= 1 << parser_state_tos->p_l_follow; /* The '(' that starts a cast can never be preceeded by an indentifier or decl. */ if (parser_state_tos->last_token == decl || (parser_state_tos->last_token == ident && parser_state_tos->last_rw != rw_return)) parser_state_tos->noncast_mask |= 1 << parser_state_tos->p_l_follow; else parser_state_tos->noncast_mask &= ~(1 << parser_state_tos->p_l_follow); break; case rparen: if (parser_state_tos->cast_mask & (1 << parser_state_tos->p_l_follow) & ~parser_state_tos->sizeof_mask) { parser_state_tos->last_u_d = true; parser_state_tos->cast_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (!parser_state_tos->cast_mask && cast_space) parser_state_tos->want_blank = true; else parser_state_tos->want_blank = false; } parser_state_tos->sizeof_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (--parser_state_tos->p_l_follow < 0) { parser_state_tos->p_l_follow = 0; diag (0, "Extra %c", *token); } parser_state_tos->paren_depth--; /* if the paren starts the line, then indent it */ if (e_code == s_code) { int level = parser_state_tos->p_l_follow; parser_state_tos->paren_level = level; if (level > 0) paren_target = -parser_state_tos->paren_indents[level - 1]; else paren_target = 0; } else if (parser_state_tos->in_decl && parser_state_tos->paren_depth == 0) parser_state_tos->want_blank = true; *e_code++ = token[0]; #if 0 if (!parser_state_tos->cast_mask || cast_space) parser_state_tos->want_blank = true; #endif /* check for end of if (...), or some such */ if (sp_sw && (parser_state_tos->p_l_follow == 0)) { /* Indicate that we have just left the parenthesized expression of a while, if, or for, unless we are getting out of the parenthesized expression of the while of a do-while loop. (do-while is different because a semicolon immediately following this will not indicate a null loop body). */ if (parser_state_tos->p_stack[parser_state_tos->tos] != dohead) last_token_ends_sp = 2; sp_sw = false; force_nl = true; /* must force newline after if */ parser_state_tos->last_u_d = true; /* inform lexi that a following operator is unary */ parser_state_tos->in_stmt = false; /* dont use stmt continuation indentation */ parse (hd_type); /* let parser worry about if, or whatever */ } parser_state_tos->search_brace = btype_2; /* this should insure that constructs such as main(){...} and int[]{...} have their braces put in the right place */ break; case unary_op: /* this could be any unary operation */ if (parser_state_tos->want_blank) *e_code++ = ' '; if (troff && !parser_state_tos->dumped_decl_indent && parser_state_tos->in_decl && !is_procname) { sprintf (e_code, "\n.Du %dp+\200p \"%.*s\"\n", dec_ind * 7, token_end - token, token); parser_state_tos->dumped_decl_indent = 1; e_code += strlen (e_code); } else { char *res = token; char *res_end = token_end; /* if this is a unary op in a declaration, we should indent this token */ if (parser_state_tos->paren_depth == 0 && parser_state_tos->in_decl && !parser_state_tos->block_init) { while ((e_code - s_code) < (dec_ind - (token_end - token))) { check_code_size; *e_code++ = ' '; } } if (troff && token[0] == '-' && token[1] == '>') { static char resval[] = "\\(->"; res = resval; res_end = res + sizeof (resval); } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } } parser_state_tos->want_blank = false; break; case binary_op: /* any binary operation */ if (parser_state_tos->want_blank || (e_code > s_code && *e_code != ' ')) *e_code++ = ' '; { char *res = token; char *res_end = token_end; #define set_res(str) \ {\ static char resval[] = str;\ res = resval;\ res_end = res + sizeof(resval);\ } if (troff) switch (token[0]) { case '<': if (token[1] == '=') set_res ("\\(<="); break; case '>': if (token[1] == '=') set_res ("\\(>="); break; case '!': if (token[1] == '=') set_res ("\\(!="); break; case '|': if (token[1] == '|') { set_res ("\\(br\\(br"); } else if (token[1] == 0) set_res ("\\(br"); break; } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; /* move the operator */ } } parser_state_tos->want_blank = true; break; case postop: /* got a trailing ++ or -- */ *e_code++ = token[0]; *e_code++ = token[1]; parser_state_tos->want_blank = true; break; case question: /* got a ? */ squest++; /* this will be used when a later colon appears so we can distinguish the ?: construct */ if (parser_state_tos->want_blank) *e_code++ = ' '; *e_code++ = '?'; parser_state_tos->want_blank = true; break; case casestmt: /* got word 'case' or 'default' */ scase = true; /* so we can process the later colon properly */ goto copy_id; case colon: /* got a ':' */ if (squest > 0) { /* it is part of the ?: construct */ --squest; if (parser_state_tos->want_blank) *e_code++ = ' '; *e_code++ = ':'; parser_state_tos->want_blank = true; break; } if (parser_state_tos->in_decl) { *e_code++ = ':'; parser_state_tos->want_blank = false; break; } parser_state_tos->in_stmt = false; /* seeing a label does not imply we are in a stmt */ for (t_ptr = s_code; *t_ptr; ++t_ptr) *e_lab++ = *t_ptr; /* turn everything so far into a label */ e_code = s_code; *e_lab++ = ':'; *e_lab++ = ' '; *e_lab = '\0'; /* parser_state_tos->pcas e will be used by dump_line to decide how to indent the label. force_nl will force a case n: to be on a line by itself */ force_nl = parser_state_tos->pcase = scase; scase = false; parser_state_tos->want_blank = false; break; case semicolon: /* we are not in an initialization or structure declaration */ parser_state_tos->in_or_st = false; scase = false; squest = 0; /* The following code doesn't seem to do much good. Just because we've found something like extern int foo(); or int (*foo)(); doesn't mean we are out of a declaration. Now if it was serving some purpose we'll have to address that.... if (parser_state_tos->last_token == rparen) parser_state_tos->in_parameter_declaration = 0; */ parser_state_tos->cast_mask = 0; parser_state_tos->sizeof_mask = 0; parser_state_tos->block_init = 0; parser_state_tos->block_init_level = 0; parser_state_tos->just_saw_decl--; if (parser_state_tos->in_decl && s_code == e_code && !parser_state_tos->block_init) while ((e_code - s_code) < (dec_ind - 1)) { check_code_size; *e_code++ = ' '; } /* if we were in a first level structure declaration, we aren't any more */ parser_state_tos->in_decl = (parser_state_tos->dec_nest > 0); if ((!sp_sw || hd_type != forstmt) && parser_state_tos->p_l_follow > 0) { /* This should be true iff there were unbalanced parens in the stmt. It is a bit complicated, because the semicolon might be in a for stmt */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; if (sp_sw) { /* this is a check for a if, while, etc. with unbalanced parens */ sp_sw = false; parse (hd_type); /* dont lose the if, or whatever */ } } /* If we have a semicolon following an if, while, or for, and the user wants us to, we should insert a space (to show that there is a null statement there). */ if (last_token_ends_sp && space_sp_semicolon) { *e_code++ = ' '; } *e_code++ = ';'; parser_state_tos->want_blank = true; /* we are no longer in the middle of a stmt */ parser_state_tos->in_stmt = (parser_state_tos->p_l_follow > 0); if (!sp_sw) { /* if not if for (;;) */ parse (semicolon); /* let parser know about end of stmt */ force_nl = true; /* force newline after a end of stmt */ } break; case lbrace: /* got a '{' */ parser_state_tos->in_stmt = false; /* dont indent the {} */ if (!parser_state_tos->block_init) force_nl = true; /* force other stuff on same line as '{' onto new line */ else if (parser_state_tos->block_init_level <= 0) parser_state_tos->block_init_level = 1; else parser_state_tos->block_init_level++; if (s_code != e_code && !parser_state_tos->block_init) { if (!btype_2) { dump_line (); parser_state_tos->want_blank = false; } else { if (parser_state_tos->in_parameter_declaration && !parser_state_tos->in_or_st) { parser_state_tos->i_l_follow = 0; dump_line (); parser_state_tos->want_blank = false; } else parser_state_tos->want_blank = true; } } if (parser_state_tos->in_parameter_declaration) prefix_blankline_requested = 0; if (parser_state_tos->p_l_follow > 0) { /* check for preceeding unbalanced parens */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; if (sp_sw) { /* check for unclosed if, for, etc. */ sp_sw = false; parse (hd_type); parser_state_tos->ind_level = parser_state_tos->i_l_follow; } } if (s_code == e_code) parser_state_tos->ind_stmt = false; /* dont put extra indentation on line with '{' */ if (parser_state_tos->in_decl && parser_state_tos->in_or_st) { /* This is a structure declaration. */ if (parser_state_tos->dec_nest >= di_stack_alloc) { di_stack_alloc *= 2; di_stack = (int *) xrealloc (di_stack, di_stack_alloc * sizeof (*di_stack)); } di_stack[parser_state_tos->dec_nest++] = dec_ind; /* ? dec_ind = 0; */ } else { parser_state_tos->decl_on_line = false; /* we cant be in the middle of a declaration, so dont do special indentation of comments */ #if 0 /* Doesn't work currently. */ if (blanklines_after_declarations_at_proctop && parser_state_tos->in_parameter_declaration) postfix_blankline_requested = 1; #endif parser_state_tos->in_parameter_declaration = 0; } dec_ind = 0; /* We are no longer looking for an initializer or structure. Needed so that the '=' in "enum bar {a = 1" does not get interpreted as the start of an initializer. */ parser_state_tos->in_or_st = false; parse (lbrace); /* let parser know about this */ if (parser_state_tos->want_blank) /* put a blank before '{' if '{' is not at start of line */ *e_code++ = ' '; parser_state_tos->want_blank = false; *e_code++ = '{'; parser_state_tos->just_saw_decl = 0; break; case rbrace: /* got a '}' */ /* semicolons can be omitted in declarations */ if (parser_state_tos->p_stack[parser_state_tos->tos] == decl && !parser_state_tos->block_init) parse (semicolon); if (parser_state_tos->p_l_follow) { /* check for unclosed if, for, else. */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; sp_sw = false; } parser_state_tos->just_saw_decl = 0; parser_state_tos->block_init_level--; if (s_code != e_code && !parser_state_tos->block_init) { /* '}' must be first on line */ if (verbose) diag (0, "Line broken"); dump_line (); } *e_code++ = '}'; parser_state_tos->want_blank = true; parser_state_tos->in_stmt = parser_state_tos->ind_stmt = false; if (parser_state_tos->dec_nest > 0) { /* we are in multi-level structure declaration */ dec_ind = di_stack[--parser_state_tos->dec_nest]; if (parser_state_tos->dec_nest == 0 && !parser_state_tos->in_parameter_declaration) parser_state_tos->just_saw_decl = 2; parser_state_tos->in_decl = true; } prefix_blankline_requested = 0; parse (rbrace); /* let parser know about this */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dohead && !btype_2) force_nl = true; parser_state_tos->search_brace = (cuddle_else && parser_state_tos->p_stack[parser_state_tos->tos] == ifhead); #if 0 parser_state_tos->search_brace = (cuddle_else && parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && (parser_state_tos->il[parser_state_tos->tos] >= parser_state_tos->ind_level)); #endif if (parser_state_tos->tos <= 1 && blanklines_after_procs && parser_state_tos->dec_nest <= 0) postfix_blankline_requested = 1; break; case swstmt: /* got keyword "switch" */ sp_sw = true; hd_type = swstmt; /* keep this for when we have seen the expression */ goto copy_id; /* go move the token into buffer */ case sp_paren: /* token is if, while, for */ sp_sw = true; /* the interesting stuff is done after the expression is scanned */ hd_type = (*token == 'i' ? ifstmt : (*token == 'w' ? whilestmt : forstmt)); /* remember the type of header for later use by parser */ goto copy_id; /* copy the token into line */ case sp_nparen: /* got else, do */ parser_state_tos->in_stmt = false; if (*token == 'e') { if (e_code != s_code && (!cuddle_else || e_code[-1] != '}')) { if (verbose) diag (0, "Line broken"); dump_line (); /* make sure this starts a line */ parser_state_tos->want_blank = false; } force_nl = true; /* also, following stuff must go onto new line */ last_else = 1; parse (elselit); } else { if (e_code != s_code) { /* make sure this starts a line */ if (verbose) diag (0, "Line broken"); dump_line (); parser_state_tos->want_blank = false; } force_nl = true; /* also, following stuff must go onto new line */ last_else = 0; parse (dolit); } goto copy_id; /* move the token into line */ case decl: /* we have a declaration type (int, register, etc.) */ parse (decl); /* let parser worry about indentation */ if (parser_state_tos->last_token == rparen && parser_state_tos->tos <= 1) { parser_state_tos->in_parameter_declaration = 1; if (s_code != e_code) { dump_line (); parser_state_tos->want_blank = false; } } if (parser_state_tos->in_parameter_declaration && indent_parameters && parser_state_tos->dec_nest == 0 && parser_state_tos->p_l_follow == 0) { parser_state_tos->ind_level = parser_state_tos->i_l_follow = indent_parameters; parser_state_tos->ind_stmt = 0; } /* in_or_st set for struct or initialization decl. Don't set it if we're in ansi prototype */ if (!parser_state_tos->paren_depth) parser_state_tos->in_or_st = true; parser_state_tos->in_decl = parser_state_tos->decl_on_line = true; #if 0 if (!parser_state_tos->in_or_st && parser_state_tos->dec_nest <= 0) #endif if (parser_state_tos->dec_nest <= 0) parser_state_tos->just_saw_decl = 2; if (prefix_blankline_requested && (parser_state_tos->block_init != 0 || parser_state_tos->block_init_level != -1 || parser_state_tos->last_token != rbrace || e_code != s_code || e_lab != s_lab || e_com != s_com)) prefix_blankline_requested = 0; i = token_end - token + 1; /* get length of token plus 1 */ /* dec_ind = e_code - s_code + (parser_state_tos->decl_indent>i ? parser_state_tos->decl_indent : i); */ dec_ind = decl_indent > 0 ? decl_indent : i; goto copy_id; case ident: /* got an identifier or constant */ /* If we are in a declaration, we must indent identifier. But not inside the parentheses of an ANSI function declaration. */ if (parser_state_tos->in_decl && parser_state_tos->p_l_follow == 0 && parser_state_tos->last_token != rbrace) { if (parser_state_tos->want_blank) *e_code++ = ' '; parser_state_tos->want_blank = false; if (is_procname == 0 || !procnames_start_line) { if (!parser_state_tos->block_init) if (troff && !parser_state_tos->dumped_decl_indent) { sprintf (e_code, "\n.De %dp+\200p\n", dec_ind * 7); parser_state_tos->dumped_decl_indent = 1; e_code += strlen (e_code); } else while ((e_code - s_code) < dec_ind) { check_code_size; *e_code++ = ' '; } } else { if (dec_ind && s_code != e_code) dump_line (); dec_ind = 0; parser_state_tos->want_blank = false; } } else if (sp_sw && parser_state_tos->p_l_follow == 0) { sp_sw = false; force_nl = true; parser_state_tos->last_u_d = true; parser_state_tos->in_stmt = false; parse (hd_type); } copy_id: if (parser_state_tos->want_blank) *e_code++ = ' '; if (troff && parser_state_tos->its_a_keyword) { e_code = chfont (&bodyf, &keywordf, e_code); for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size; *e_code++ = keywordf.allcaps && islower (*t_ptr) ? toupper (*t_ptr) : *t_ptr; } e_code = chfont (&keywordf, &bodyf, e_code); } else { /* Troff mode requires that strings be processed specially. */ if (troff && (*token == '"' || *token == '\'')) { char qchar; qchar = *token; *e_code++ = '`'; if (qchar == '"') *e_code++ = '`'; e_code = chfont (&bodyf, &stringf, e_code); t_ptr = token + 1; while (t_ptr < token_end) { *e_code = *t_ptr++; if (*e_code == '\\') { * ++e_code = '\\'; if (*t_ptr == '\\') * ++e_code = '\\'; /* Copy char after backslash. */ * ++e_code = *t_ptr++; /* Point after the last char we copied. */ e_code++; } } e_code = chfont (&stringf, &bodyf, e_code - 1); if (qchar == '"') *e_code++ = '\''; } else for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } } parser_state_tos->want_blank = true; /* If the token is va_dcl, it appears without a semicolon, so we need to pretend that one was there. */ if ((token_end - token) == 6 && strncmp (token, "va_dcl", 6) == 0) { parser_state_tos->in_or_st = false; parser_state_tos->just_saw_decl--; parser_state_tos->in_decl = 0; parse (semicolon); force_nl = true; } break; case period: /* treat a period kind of like a binary operation */ *e_code++ = '.'; /* move the period into line */ parser_state_tos->want_blank = false; /* dont put a blank after a period */ break; case comma: /* only put blank after comma if comma does not start the line */ parser_state_tos->want_blank = (s_code != e_code); if (parser_state_tos->paren_depth == 0 && parser_state_tos->in_decl && is_procname == 0 && !parser_state_tos->block_init) while ((e_code - s_code) < (dec_ind - 1)) { check_code_size; *e_code++ = ' '; } *e_code++ = ','; if (parser_state_tos->p_l_follow == 0) { if (parser_state_tos->block_init_level <= 0) parser_state_tos->block_init = 0; /* If we are in a declaration, and either the user wants all comma'd declarations broken, or the line is getting too long, break the line. */ if (break_comma && (!leave_comma || (compute_code_target () + (e_code - s_code) > max_col - 8))) force_nl = true; } break; case preesc: /* got the character '#' */ if ((s_com != e_com) || (s_lab != e_lab) || (s_code != e_code)) dump_line (); *e_lab++ = '#'; /* move whole line to 'label' buffer */ { int in_comment = 0; int com_start = 0; char quote = 0; int com_end = 0; /* ANSI allows spaces between '#' and preprocessor directives. Remove such spaces unless user has specified "-lpb". */ while (*buf_ptr == ' ' || *buf_ptr == '\t') { if (leave_preproc_space) *e_lab++ = *buf_ptr; buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } while (*buf_ptr != '\n' || (in_comment && !had_eof)) { check_lab_size; *e_lab = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); switch (*e_lab++) { case BACKSLASH: if (troff) *e_lab++ = BACKSLASH; if (!in_comment) { *e_lab++ = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } break; case '/': if (*buf_ptr == '*' && !in_comment && !quote) { in_comment = 1; *e_lab++ = *buf_ptr++; com_start = e_lab - s_lab - 2; } break; case '"': if (quote == '"') quote = 0; break; case '\'': if (quote == '\'') quote = 0; break; case '*': if (*buf_ptr == '/' && in_comment) { in_comment = 0; *e_lab++ = *buf_ptr++; com_end = e_lab - s_lab; } break; } } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on preprocessor line */ if (save_com.end != save_com.ptr) { need_chars (save_com, 2); *save_com.end++ = '\n'; /* add newline between comments */ *save_com.end++ = ' '; --line_no; } need_chars (save_com, com_end - com_start); strncpy (save_com.end, s_lab + com_start, com_end - com_start); save_com.end += com_end - com_start; e_lab = s_lab + com_start; while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; bp_save = buf_ptr; /* save current input buffer */ be_save = buf_end; buf_ptr = save_com.ptr; /* fix so that subsequent calls to lexi will take tokens out of save_com */ need_chars (save_com, 1); *save_com.end++ = ' '; /* add trailing blank, just in case */ buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ } *e_lab = '\0'; /* null terminate line */ parser_state_tos->pcase = false; } if (strncmp (s_lab + 1, "if", 2) == 0) { if (blanklines_around_conditional_compilation) { register c; prefix_blankline_requested++; while ((c = *in_prog_pos++) == '\n'); in_prog_pos--; } { /* Push a copy of the parser_state onto the stack. All manipulations will use the copy at the top of stack, and then we can return to the previous state by popping the stack. */ struct parser_state *new; new = (struct parser_state *) xmalloc (sizeof (struct parser_state)); memcpy (new, parser_state_tos, sizeof (struct parser_state)); /* We need to copy the dynamically allocated arrays in the struct parser_state too. */ new->p_stack = (enum codes *) xmalloc (parser_state_tos->p_stack_size * sizeof (enum codes)); memcpy (new->p_stack, parser_state_tos->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); new->il = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); memcpy (new->il, parser_state_tos->il, parser_state_tos->p_stack_size * sizeof (int)); new->cstk = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); memcpy (new->cstk, parser_state_tos->cstk, parser_state_tos->p_stack_size * sizeof (int)); new->paren_indents = (short *) xmalloc (parser_state_tos->paren_indents_size * sizeof (short)); memcpy (new->paren_indents, parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); new->next = parser_state_tos; parser_state_tos = new; } } else if (strncmp (s_lab + 1, "else", 4) == 0) { /* When we get #else, we want to restore the parser state to what it was before the matching #if, so that things get lined up with the code before the #if. However, we do not want to pop the stack; we just want to copy the second to top elt of the stack because when we encounter the #endif, it will pop the stack. */ else_or_endif = true; if (parser_state_tos->next) { /* First save the addresses of the arrays for the top of stack. */ enum codes *tos_p_stack = parser_state_tos->p_stack; int *tos_il = parser_state_tos->il; int *tos_cstk = parser_state_tos->cstk; short *tos_paren_indents = parser_state_tos->paren_indents; struct parser_state *second = parser_state_tos->next; memcpy (parser_state_tos, second, sizeof (struct parser_state)); parser_state_tos->next = second; /* Now copy the arrays from the second to top of stack to the top of stack. */ /* Since the p_stack, etc. arrays only grow, never shrink, we know that they will be big enough to fit the array from the second to top of stack. */ parser_state_tos->p_stack = tos_p_stack; memcpy (parser_state_tos->p_stack, parser_state_tos->next->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); parser_state_tos->il = tos_il; memcpy (parser_state_tos->il, parser_state_tos->next->il, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->cstk = tos_cstk; memcpy (parser_state_tos->cstk, parser_state_tos->next->cstk, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->paren_indents = tos_paren_indents; memcpy (parser_state_tos->paren_indents, parser_state_tos->next->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } else diag (1, "Unmatched #else"); } else if (strncmp (s_lab + 1, "endif", 5) == 0) { else_or_endif = true; /* We want to remove the second to top elt on the stack, which was put there by #if and was used to restore the stack at the #else (if there was one). We want to leave the top of stack unmolested so that the state which we have been using is unchanged. */ if (parser_state_tos->next) { struct parser_state *second = parser_state_tos->next; parser_state_tos->next = second->next; free (second->p_stack); free (second->il); free (second->cstk); free (second->paren_indents); free (second); } else diag (1, "Unmatched #endif"); if (blanklines_around_conditional_compilation) { postfix_blankline_requested++; n_real_blanklines = 0; } } /* Normally, subsequent processing of the newline character causes the line to be printed. The following clause handles a special case (comma-separated declarations separated by the preprocessor lines) where this doesn't happen. */ if (parser_state_tos->last_token == comma && parser_state_tos->p_l_follow <= 0 && leave_comma && !parser_state_tos->block_init && break_comma && s_com == e_com) { dump_line (); parser_state_tos->want_blank = false; } break; case comment: /* we have gotten a /* this is a biggie */ if (flushed_nl) { /* we should force a broken line here */ flushed_nl = false; dump_line (); parser_state_tos->want_blank = false; /* dont insert blank at line start */ force_nl = false; } pr_comment (); break; } /* end of big switch stmt */ *e_code = '\0'; /* make sure code section is null terminated */ if (type_code != comment && type_code != newline && type_code != preesc && type_code != form_feed) parser_state_tos->last_token = type_code; } /* end of main while (1) loop */ } char *set_profile (); void set_defaults (); int set_option (); /* Points to current input file */ char *in_name = 0; /* Points to the name of the output file */ char *out_name = 0; /* How many input files were specified */ int input_files; /* Names of all input files */ char **in_file_names; /* Initial number of input filenames to allocate. */ int max_input_files = 128; #ifdef DEBUG int debug; #endif main (argc, argv) int argc; char **argv; { register int i; struct file_buffer *current_input; char *profile_pathname = 0; int using_stdin = false; #ifdef DEBUG if (debug) debug_init (); #endif init_parser (); initialize_backups (); output = 0; input_files = 0; in_file_names = (char **) xmalloc (max_input_files * sizeof (char *)); set_defaults (); for (i = 1; i < argc; ++i) if (strcmp (argv[i], "-npro") == 0 || strcmp (argv[i], "--ignore-profile") == 0 || strcmp (argv[i], "+ignore-profile") == 0) break; if (i >= argc) profile_pathname = set_profile (); for (i = 1; i < argc; ++i) { if (argv[i][0] != '-' && argv[i][0] != '+') /* Filename */ { if (expect_output_file == true) /* Last arg was "-o" */ { if (out_name != 0) { fprintf (stderr, "indent: only one output file (2nd was %s)\n", argv[i]); exit (1); } if (input_files > 1) { fprintf (stderr, "indent: only one input file when output file is specified\n"); exit (1); } out_name = argv[i]; expect_output_file = false; continue; } else { if (using_stdin) { fprintf (stderr, "indent: can't have filenames when specifying standard input\n"); exit (1); } input_files++; if (input_files > 1) { if (out_name != 0) { fprintf (stderr, "indent: only one input file when output file is specified\n"); exit (1); } if (use_stdout != 0) { fprintf (stderr, "indent: only one input file when stdout is used\n"); exit (1); } if (input_files > max_input_files) { max_input_files = 2 * max_input_files; in_file_names = (char **) xrealloc (in_file_names, (max_input_files * sizeof (char *))); } } in_file_names[input_files - 1] = argv[i]; } } else { /* '-' as filename means stdin. */ if (argv[i][0] == '-' && argv[i][1] == '\0') { if (input_files > 0) { fprintf (stderr, "indent: can't have filenames when specifying standard input\n"); exit (1); } using_stdin = true; } else i += set_option (argv[i], (i < argc ? argv[i + 1] : 0), 1); } } if (verbose && profile_pathname) fprintf (stderr, "Read profile %s\n", profile_pathname); if (input_files > 1) { /* When multiple input files are specified, make a backup copy and then output the indented code into the same filename. */ for (i = 0; input_files; i++, input_files--) { current_input = read_file (in_file_names[i]); in_name = out_name = in_file_names[i]; output = fopen (out_name, "w"); if (output == 0) { fprintf (stderr, "indent: can't create %s\n", out_name); exit (1); } make_backup (current_input); reset_parser (); indent (current_input); if (fclose (output) != 0) sys_error (out_name); } } else { /* One input stream -- specified file, or stdin */ if (input_files == 0 || using_stdin) { input_files = 1; in_file_names[0] = "Standard input"; current_input = read_stdin (); } else /* 1 input file */ { current_input = read_file (in_file_names[0]); if (!out_name && !use_stdout) { out_name = in_file_names[0]; make_backup (current_input); } } in_name = in_file_names[0]; /* Uset stdout if it was specified ("-st"), or neither input nor output file was specified, or we're doing troff. */ if (use_stdout || !out_name || troff) output = stdout; else { output = fopen (out_name, "w"); if (output == 0) { fprintf (stderr, "indent: can't create %s\n", out_name); exit (1); } } reset_parser (); indent (current_input); } exit (0); } indent-2.2.11/regression/standard/lexi.c.~1~0000644000177400010010000004570611145773614015637 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here we have the token scanner for indent. It scans off one token and puts it in the global variable "token". It returns a code, indicating the type of token scanned. */ #include "sys.h" #include "indent.h" #include /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *token; char *token_end; #define alphanum 1 #define opchar 3 struct templ { char *rwd; enum rwcodes rwcode; }; /* Pointer to a vector of keywords specified by the user. */ static struct templ *user_specials = 0; /* Allocated size of user_specials. */ static unsigned int user_specials_max; /* Index in user_specials of the first unused entry. */ static unsigned int user_specials_idx; char chartype[128] = { /* this is used to facilitate the decision of what type (alphanumeric, operator) each character is */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 3, 3, 0, 0, 0, 3, 3, 0, 3, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 3, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 3, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 0, 3, 0 }; /* C code produced by gperf version 2.0 (K&R C version) Command-line: gperf -c -p -t -T -g -j1 -o -K rwd -N is_reserved indent.gperf */ #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 8 #define MIN_HASH_VALUE 4 #define MAX_HASH_VALUE 42 /* 31 keywords, 39 is the maximum key range */ INLINE static int hash (str, len) register char *str; register unsigned int len; { static unsigned char hash_table[] = { 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 6, 9, 10, 0, 16, 5, 4, 24, 42, 0, 20, 4, 20, 0, 42, 42, 6, 0, 0, 10, 10, 2, 42, 42, 42, 42, 42, 42, 42, 42, }; return len + hash_table[str[len - 1]] + hash_table[str[0]]; } INLINE struct templ * is_reserved (str, len) register char *str; register unsigned int len; { static struct templ wordlist[] = { {"",}, {"",}, {"",}, {"",}, {"else", rw_sp_nparen,}, {"short", rw_decl,}, {"struct", rw_struct_like,}, {"while", rw_sp_paren,}, {"enum", rw_struct_like,}, {"goto", rw_break,}, {"switch", rw_switch,}, {"break", rw_break,}, {"do", rw_sp_nparen,}, {"case", rw_case,}, {"const", rw_decl,}, {"static", rw_decl,}, {"double", rw_decl,}, {"default", rw_case,}, {"volatile", rw_decl,}, {"char", rw_decl,}, {"register", rw_decl,}, {"float", rw_decl,}, {"sizeof", rw_sizeof,}, {"typedef", rw_decl,}, {"void", rw_decl,}, {"for", rw_sp_paren,}, {"extern", rw_decl,}, {"int", rw_decl,}, {"unsigned", rw_decl,}, {"long", rw_decl,}, {"",}, {"global", rw_decl,}, {"return", rw_break,}, {"",}, {"",}, {"union", rw_struct_like,}, {"va_dcl", rw_decl,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"if", rw_sp_paren,}, }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) { register char *s = wordlist[key].rwd; if (*s == *str && !strncmp (str + 1, s + 1, len - 1)) return &wordlist[key]; } } return 0; } enum codes lexi () { int unary_delim; /* this is set to 1 if the current token forces a following operator to be unary */ static enum codes last_code; /* the last token type returned */ static int l_struct; /* set to 1 if the last token was 'struct' */ enum codes code; /* internal code to be returned */ char qchar; /* the delimiter character for a string */ unary_delim = false; /* tell world that this token started in column 1 iff the last thing scanned was nl */ parser_state_tos->col_1 = parser_state_tos->last_nl; parser_state_tos->last_nl = false; while (*buf_ptr == ' ' || *buf_ptr == '\t') { /* get rid of blanks */ parser_state_tos->col_1 = false; /* leading blanks imply token is not in column 1 */ if (++buf_ptr >= buf_end) fill_buffer (); } token = buf_ptr; /* Scan an alphanumeric token */ if (chartype[*buf_ptr] == alphanum || (buf_ptr[0] == '.' && isdigit (buf_ptr[1]))) { /* we have a character or number */ register struct templ *p; if (isdigit (*buf_ptr) || (buf_ptr[0] == '.' && isdigit (buf_ptr[1]))) { int seendot = 0, seenexp = 0; if (*buf_ptr == '0' && (buf_ptr[1] == 'x' || buf_ptr[1] == 'X')) { buf_ptr += 2; while (isxdigit (*buf_ptr)) buf_ptr++; } else while (1) { if (*buf_ptr == '.') if (seendot) break; else seendot++; buf_ptr++; if (!isdigit (*buf_ptr) && *buf_ptr != '.') if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp) break; else { seenexp++; seendot++; buf_ptr++; if (*buf_ptr == '+' || *buf_ptr == '-') buf_ptr++; } } /* Accept unsigned and unsigned long constants (U and UL suffixes). I'm not sure if LU is ansii. */ if (*buf_ptr == 'U' || *buf_ptr == 'u') buf_ptr++; if (*buf_ptr == 'L' || *buf_ptr == 'l') buf_ptr++; } else while (chartype[*buf_ptr] == alphanum) { /* copy it over */ buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } token_end = buf_ptr; while (*buf_ptr == ' ' || *buf_ptr == '\t') { if (++buf_ptr >= buf_end) fill_buffer (); } parser_state_tos->its_a_keyword = false; parser_state_tos->sizeof_keyword = false; /* if last token was 'struct', then this token should be treated as a declaration */ if (l_struct) { l_struct = false; last_code = ident; parser_state_tos->last_u_d = true; return (decl); } /* Operator after indentifier is binary */ parser_state_tos->last_u_d = false; last_code = ident; /* Check whether the token is a reserved word. Use perfect hashing... */ p = is_reserved (token, token_end - token); if (!p && user_specials != 0) { for (p = &user_specials[0]; p < &user_specials[0] + user_specials_idx; p++) { char *q = token; char *r = p->rwd; /* This string compare is a little nonstandard because token ends at the character before token_end and p->rwd is null-terminated. */ while (1) { /* If we have come to the end of both the keyword in user_specials and the keyword in token they are equal. */ if (q >= token_end && ! *r) goto found_keyword; /* If we have come to the end of just one, they are not equal. */ if (q >= token_end || ! *r) break; /* If the characters in corresponding characters are not equal, the strings are not equal. */ if (*q++ != *r++) break; } } /* Didn't find anything in user_specials. */ p = 0; } if (p) { /* we have a keyword */ found_keyword: parser_state_tos->its_a_keyword = true; parser_state_tos->last_u_d = true; parser_state_tos->last_rw = p->rwcode; switch (p->rwcode) { case rw_switch: /* it is a switch */ return (swstmt); case rw_case: /* a case or default */ return (casestmt); case rw_struct_like: /* a "struct" */ if (parser_state_tos->p_l_follow && !(parser_state_tos->noncast_mask & 1 << parser_state_tos->p_l_follow)) /* inside parens: cast */ { parser_state_tos->cast_mask |= 1 << parser_state_tos->p_l_follow; break; } l_struct = true; /* Next time around, we will want to know that we have had a 'struct' */ case rw_decl: /* one of the declaration keywords */ if (parser_state_tos->p_l_follow && !(parser_state_tos->noncast_mask & 1 << parser_state_tos->p_l_follow)) /* inside parens: cast */ { parser_state_tos->cast_mask |= 1 << parser_state_tos->p_l_follow; break; } last_code = decl; return (decl); case rw_sp_paren: /* if, while, for */ return (sp_paren); case rw_sp_nparen: /* do, else */ return (sp_nparen); case rw_sizeof: parser_state_tos->sizeof_keyword = true; return (ident); case rw_return: case rw_break: default: /* all others are treated like any other identifier */ return (ident); } /* end of switch */ } /* end of if (found_it) */ if (*buf_ptr == '(' && parser_state_tos->tos <= 1 && parser_state_tos->ind_level == 0 && parser_state_tos->paren_depth == 0) { /* We have found something which might be the name in a function definition. */ register char *tp; int paren_count = 1; /* Skip to the matching ')'. */ for (tp = buf_ptr + 1; paren_count > 0 && tp < in_prog + in_prog_size; tp++) { if (*tp == '(') paren_count++; if (*tp == ')') paren_count--; /* Can't occur in parameter list; this way we don't search the whole file in the case of unbalanced parens. */ if (*tp == ';') goto not_proc; } if (paren_count == 0) { while (isspace (*tp)) tp++; /* If the next char is ';' or ',' or '(' we have a function declaration, not a definition. I've added '=' to this list to keep from breaking a non-valid C macro from libc. -jla */ if (*tp != ';' && *tp != ',' && *tp != '(' && *tp != '=') { parser_state_tos->procname = token; parser_state_tos->procname_end = token_end; parser_state_tos->in_parameter_declaration = 1; } } not_proc:; } /* The following hack attempts to guess whether or not the current token is in fact a declaration keyword -- one that has been typedef'd */ if (((*buf_ptr == '*' && buf_ptr[1] != '=') || isalpha (*buf_ptr) || *buf_ptr == '_') && !parser_state_tos->p_l_follow && !parser_state_tos->block_init && (parser_state_tos->last_token == rparen || parser_state_tos->last_token == semicolon || parser_state_tos->last_token == decl || parser_state_tos->last_token == lbrace || parser_state_tos->last_token == rbrace)) { parser_state_tos->its_a_keyword = true; parser_state_tos->last_u_d = true; last_code = decl; return decl; } if (last_code == decl) /* if this is a declared variable, then following sign is unary */ parser_state_tos->last_u_d = true; /* will make "int a -1" work */ last_code = ident; return (ident); /* the ident is not in the list */ } /* end of procesing for alpanum character */ /* Scan a non-alphanumeric token */ /* If it is not a one character token, token_end will get changed later. */ token_end = buf_ptr + 1; if (++buf_ptr >= buf_end) fill_buffer (); switch (*token) { case '\0': code = code_eof; break; case '\n': unary_delim = parser_state_tos->last_u_d; parser_state_tos->last_nl = true; code = newline; break; case '\'': /* start of quoted character */ case '"': /* start of string */ qchar = *token; /* Find out how big the literal is so we can set token_end. */ /* Invariant: before loop test buf_ptr points to the next */ /* character that we have not yet checked. */ while (*buf_ptr != qchar && *buf_ptr != 0 && *buf_ptr != '\n') { if (*buf_ptr == '\\') { buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '\n') ++line_no; if (*buf_ptr == 0) break; } buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } if (*buf_ptr == '\n' || *buf_ptr == 0) { diag (1, qchar == '\'' ? "Unterminated character constant" : "Unterminated string constant"); } else { /* Advance over end quote char. */ buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } code = ident; break; case ('('): case ('['): unary_delim = true; code = lparen; break; case (')'): case (']'): code = rparen; break; case '#': unary_delim = parser_state_tos->last_u_d; code = preesc; break; case '?': unary_delim = true; code = question; break; case (':'): code = colon; unary_delim = true; break; case (';'): unary_delim = true; code = semicolon; break; case ('{'): unary_delim = true; /* This check is made in the code for '='. No one who writes initializers without '=' these days deserves to have indent work on their code (besides which, uncommenting this would screw up anything which assumes that parser_state_tos->block_init really means you are in an initializer. */ /* if (parser_state_tos->in_or_st) parser_state_tos->block_init = 1; */ /* The following neat hack causes the braces in structure initializations to be treated as parentheses, thus causing initializations to line up correctly, e.g. struct foo bar = {{a, b, c}, {1, 2}}; If lparen is returned, token can be used to distinguish between '{' and '(' where necessary. */ code = parser_state_tos->block_init ? lparen : lbrace; break; case ('}'): unary_delim = true; /* The following neat hack is explained under '{' above. */ code = parser_state_tos->block_init ? rparen : rbrace; break; case 014: /* a form feed */ unary_delim = parser_state_tos->last_u_d; parser_state_tos->last_nl = true; /* remember this so we can set 'parser_state_tos->col_1' right */ code = form_feed; break; case (','): unary_delim = true; code = comma; break; case '.': unary_delim = false; code = period; break; case '-': case '+': /* check for -, +, --, ++ */ code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; if (*buf_ptr == token[0]) { /* check for doubled character */ buf_ptr++; /* buffer overflow will be checked at end of loop */ if (last_code == ident || last_code == rparen) { code = (parser_state_tos->last_u_d ? unary_op : postop); /* check for following ++ or -- */ unary_delim = false; } } else if (*buf_ptr == '=') /* check for operator += */ buf_ptr++; else if (*buf_ptr == '>') { /* check for operator -> */ buf_ptr++; if (!pointer_as_binop) { unary_delim = false; code = unary_op; parser_state_tos->want_blank = false; } } break; /* buffer overflow will be checked at end of switch */ case '=': if (parser_state_tos->in_or_st) parser_state_tos->block_init = 1; if (*buf_ptr == '=') /* == */ buf_ptr++; else if (*buf_ptr == '-' || *buf_ptr == '+' || *buf_ptr == '*' || *buf_ptr == '&') { /* Something like x=-1, which can mean x -= 1 ("old style" in K&R1) or x = -1 (ANSI). Note that this is only an ambiguity if the character can also be a unary operator. If not, just produce output code that produces a syntax error (the theory being that people want to detect and eliminate old style assignments but they don't want indent to silently change the meaning of their code). */ diag (0, "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n", *buf_ptr, *buf_ptr); } code = binary_op; unary_delim = true; break; /* can drop thru!!! */ case '>': case '<': case '!': /* ops like <, <<, <=, !=, <<=, etc */ /* This will of course scan sequences like "<=>", "!=>", "<<>", etc. as one token, but I don't think that will cause any harm. */ while (*buf_ptr == '>' || *buf_ptr == '<' || *buf_ptr == '=') { if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '=') { if (++buf_ptr >= buf_end) fill_buffer (); } } code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; break; default: if (token[0] == '/' && *buf_ptr == '*') { /* it is start of comment */ if (++buf_ptr >= buf_end) fill_buffer (); code = comment; unary_delim = parser_state_tos->last_u_d; break; } while (*(buf_ptr - 1) == *buf_ptr || *buf_ptr == '=') { /* handle ||, &&, etc, and also things as in int *****i */ if (++buf_ptr >= buf_end) fill_buffer (); } code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; } /* end of switch */ if (code != newline) { l_struct = false; last_code = code; } token_end = buf_ptr; if (buf_ptr >= buf_end) /* check for input buffer empty */ fill_buffer (); parser_state_tos->last_u_d = unary_delim; return (code); } /* Add the given keyword to the keyword table, using val as the keyword type */ addkey (key, val) char *key; enum rwcodes val; { register struct templ *p; /* Check to see whether key is a reserved word or not. */ if (is_reserved (key, strlen (key)) != 0) return; if (user_specials == 0) { user_specials = (struct templ *) xmalloc (5 * sizeof (struct templ)); user_specials_max = 5; user_specials_idx = 0; } else if (user_specials_idx == user_specials_max) { user_specials_max += 5; user_specials = (struct templ *) xrealloc ((char *) user_specials, user_specials_max * sizeof (struct templ)); } p = &user_specials[user_specials_idx++]; p->rwd = key; p->rwcode = val; return; } indent-2.2.11/regression/standard/goto.c0000644000177400010010000000025010775646104015075 00000000000000int f (void) { for (i = 0; i < 10; i++) { if (i > 5) goto two; i++; two: } } int main (void) { if (f ()) goto out; out: return 0; } indent-2.2.11/regression/standard/one-line-4.c0000644000177400010010000000014210775646104015774 00000000000000main () { if (foo) { bar (33); grop (); } else foo (); return -1; } indent-2.2.11/regression/standard/wide.c0000644000177400010010000000025410775646104015061 00000000000000extern char *s = L"long string"; void main (int argc, char *argv[]) { char *s1, *s2; char c; s1 = "foobar"; if (x) foo (); s2 = L"barfoo"; c = L'\0'; } indent-2.2.11/regression/standard/unknown-type-npsl.c0000644000177400010010000000012510775646104017556 00000000000000#include Error_t g (void) { return 0; } Error_t g (void) { return 0; } indent-2.2.11/regression/standard/bad-break.c0000644000177400010010000000015710775646104015743 00000000000000int foo (void) { p = qsort (*aasdfagddsdf, *afasdfsdafasd, sizeof (struct foo), comparisonFunction); } indent-2.2.11/regression/standard/globs.c0000644000177400010010000000343110775646104015237 00000000000000/* Copyright (C) 1986, 1989, 1992 Free Software Foundation, Inc. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" /* Like malloc but get error if no storage available. size really should be size_t, but not all systems have size_t, so I hope "unsigned" will work. It works for GNU style machines, where it is 32 bits, and works on MS-DOS. */ char * xmalloc (size) unsigned size; { register char *val = (char *) malloc (size); if (!val) { fprintf (stderr, "indent: Virtual memory exhausted.\n"); exit (1); } #if defined (DEBUG) /* Fill it with garbage to detect code which depends on stuff being zero-filled. */ memset (val, 'x', size); #endif return val; } /* Like realloc but get error if no storage available. */ char * xrealloc (ptr, size) char *ptr; unsigned size; { register char *val = (char *) realloc (ptr, size); if (!val) { fprintf (stderr, "indent: Virtual memory exhausted.\n"); exit (1); } return val; } indent-2.2.11/regression/standard/boxed.c-70000644000177400010010000000450610775646104015402 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/cplus.c-20000644000177400010010000000174210775646104015421 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here is a very long C plus plus comment very long C plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very long C plus plus comment Here is a very long C plus plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/decl_block.c0000644000177400010010000000007611331315632016200 00000000000000int main (int a, char **b) { int a; int b; return 0; } indent-2.2.11/regression/standard/emacs-compatible.h0000644000177400010010000000076310775646104017350 00000000000000struct token_data { enum token_data_type type; union { struct { char *text; } u_t; struct { builtin_func *func; boolean traced; } u_f; } u; }; foo () { while (1) { foobar (); } do { ralph (); } while (nigel ()); switch (x) { case 33: break; case 49: printf ("foobar"); { int i; i = 23; f (i); } default: { int x; abort (); } ; } } indent-2.2.11/regression/standard/struct-decl.c0000644000177400010010000000030310775646104016355 00000000000000enum { t1, t2 } barfoo; struct foobar { int ch; char f; } xyz; main () { enum { None, Indent_on, Indent_off } com; struct foobar { int ch; char f; } xyz; } indent-2.2.11/regression/standard/goto-2.c0000644000177400010010000000024610775646104015241 00000000000000int f (void) { for (i = 0; i < 10; i++) { if (i > 5) goto two; i++; two: } } int main (void) { if (f ()) goto out; out: return 0; } indent-2.2.11/regression/standard/do.c0000644000177400010010000000033410775646104014532 00000000000000foo (a) int a; { int b; if (a == 1) do b = getchar (); while (b != 0x1a); else do b = getchar (); while (b != 0xff); do { b = getchar (); } while (b != 0xff); } indent-2.2.11/regression/standard/tabs.c-00000644000177400010010000000044010775646104015214 00000000000000 /* Here is a column 1 comment with tab tab and tab In the columns: ^ ^ ^ those */ main () { int i = 33; /* Here there everywhere here.. and that's it tab ^--------^------------^-----------^------------- */ foo (i); } indent-2.2.11/regression/standard/cplus.c-90000644000177400010010000000205410775646104015425 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration // comment 1 int var1; // Delcaration // comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to // right of code. foob (); turds (); } /* * A single line comment. */ exit (); } // Here is a very long C plus plus comment Here // is a very long C plus plus comment very long C // plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very // long C plus // plus comment // Here is a very // long C plus // plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/brackets38.c0000644000177400010010000000050710775646104016103 00000000000000void foo () { if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) mask = NULL; if ((acptr = FindUser (nick)) && ((!(bitsel & WHOSELECT_OPER)) || IsAnOper (acptr)) && Process (acptr) && SHOW_MORE (sptr, counter)) mask = NULL; } indent-2.2.11/regression/standard/no-newline.c0000644000177400010010000000136310775646104016206 00000000000000 /* RADIX!!(N) */ int * function_2 (var_0_0) int var_0_0; { int _local_iters0_, _size0_; int *var_1_0, *map1_1; struct shape_1d _shape0_, *var_2_0; var_2_0 = make_shape_1d (var_0_0); _shape0_ = var_2_0; _size0_ = shape_size (_shape0_); _local_iters0_ = shape_local_iters (_shape0_); { int _i_ = 0; int _self_address_ = _size0_ * SELF_PE_INT; int *_dest0_; int map1_2 = 65535; map1_1 = get_pvar (_shape0_); _dest0_ = pvar_values (map1_1); for (; _i_ < _local_iters0_; _i_++, _self_address_++) { _dest0_[_i_] = ((((_self_address_ * _self_address_) * 57) + (_self_address_ * 17)) % map1_2); } } dec_count_shape (var_2_0); var_1_0 = function_1 (map1_1, 65536); return (var_1_0); } indent-2.2.11/regression/standard/brackets33.c0000644000177400010010000000054710775646104016102 00000000000000void foo () { if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) mask = NULL; if ((acptr = FindUser (nick)) && ((!(bitsel & WHOSELECT_OPER)) || IsAnOper (acptr)) && Process (acptr) && SHOW_MORE (sptr, counter)) mask = NULL; } indent-2.2.11/regression/standard/struct-decl-kr.c0000644000177400010010000000030110775646104016765 00000000000000enum { t1, t2 } barfoo; struct foobar { int ch; char f; } xyz; main() { enum { None, Indent_on, Indent_off } com; struct foobar { int ch; char f; } xyz; } indent-2.2.11/regression/standard/else-if.c0000644000177400010010000000111310775646104015450 00000000000000void foo () { if (1) if (1) if (else_chptr->creationtime && chanTS > chptr->creationtime && chptr->creationtime != MAGIC_REMOTE_JOIN_TS) { int i; } else if (chptr->creationtime && chanTS > chptr->creationtime && chptr->creationtime != MAGIC_REMOTE_JOIN_TS) ; else if (chptr->creationtime && chanTS > chptr->creationtime && chptr->creationtime != MAGIC_REMOTE_JOIN_TS) { j = 1; i = 2; } if (0) i = 0; else /* Seperate banmasks with a space because they can contain commas themselfs: */ { j = 0; } } indent-2.2.11/regression/standard/first-in-block.c0000644000177400010010000000033710775646104016756 00000000000000main () { int i = 0; switch (i) { // // First line comment // case 1: return 1; } switch (i) { // // First line comment, but not col 1. // case 1: return 1; } } indent-2.2.11/regression/standard/else.c0000644000177400010010000000115410775646104015061 00000000000000 cmd_tab (n) int n; { int i, pos, col; if (tabch) { i = 0; ch = tabch; while (tabstop[i] <= vcol) i++; do { pos = tabstop[i++]; col = vcol; if (overwrite) do { FWD; } while (pos > vcol && vcol > col); else do { ch = tabch; ch1 = tabch2; inst_ch (0); } while (pos > vcol && vcol > col); } while (--n > 0); return (kcol = 0); } if (overwrite) { do { do { FWD; } while (vcol & TABCNT); } while (--n > 0); return (0); } return (inst_ch (n)); } indent-2.2.11/regression/standard/for.c0000644000177400010010000000010610775646104014713 00000000000000main () { int size_; for (size_ = 32; size_ < n; size_ <<= 1); } indent-2.2.11/regression/standard/newlines.c-50000644000177400010010000000206110775646104016115 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR Now here are some blank lines: IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/lexi.c0000644000177400010010000004570411145774471015104 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here we have the token scanner for indent. It scans off one token and puts it in the global variable "token". It returns a code, indicating the type of token scanned. */ #include "sys.h" #include "indent.h" #include /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *token; char *token_end; #define alphanum 1 #define opchar 3 struct templ { char *rwd; enum rwcodes rwcode; }; /* Pointer to a vector of keywords specified by the user. */ static struct templ *user_specials = 0; /* Allocated size of user_specials. */ static unsigned int user_specials_max; /* Index in user_specials of the first unused entry. */ static unsigned int user_specials_idx; char chartype[128] = { /* this is used to facilitate the decision of what type (alphanumeric, operator) each character is */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 3, 3, 0, 0, 0, 3, 3, 0, 3, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 3, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 3, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 0, 3, 0 }; /* C code produced by gperf version 2.0 (K&R C version) Command-line: gperf -c -p -t -T -g -j1 -o -K rwd -N is_reserved indent.gperf */ #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 8 #define MIN_HASH_VALUE 4 #define MAX_HASH_VALUE 42 /* 31 keywords, 39 is the maximum key range */ INLINE static int hash (str, len) register char *str; register unsigned int len; { static unsigned char hash_table[] = { 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 6, 9, 10, 0, 16, 5, 4, 24, 42, 0, 20, 4, 20, 0, 42, 42, 6, 0, 0, 10, 10, 2, 42, 42, 42, 42, 42, 42, 42, 42, }; return len + hash_table[str[len - 1]] + hash_table[str[0]]; } INLINE struct templ * is_reserved (str, len) register char *str; register unsigned int len; { static struct templ wordlist[] = { {"",}, {"",}, {"",}, {"",}, {"else", rw_sp_nparen,}, {"short", rw_decl,}, {"struct", rw_struct_like,}, {"while", rw_sp_paren,}, {"enum", rw_struct_like,}, {"goto", rw_break,}, {"switch", rw_switch,}, {"break", rw_break,}, {"do", rw_sp_nparen,}, {"case", rw_case,}, {"const", rw_decl,}, {"static", rw_decl,}, {"double", rw_decl,}, {"default", rw_case,}, {"volatile", rw_decl,}, {"char", rw_decl,}, {"register", rw_decl,}, {"float", rw_decl,}, {"sizeof", rw_sizeof,}, {"typedef", rw_decl,}, {"void", rw_decl,}, {"for", rw_sp_paren,}, {"extern", rw_decl,}, {"int", rw_decl,}, {"unsigned", rw_decl,}, {"long", rw_decl,}, {"",}, {"global", rw_decl,}, {"return", rw_break,}, {"",}, {"",}, {"union", rw_struct_like,}, {"va_dcl", rw_decl,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"if", rw_sp_paren,}, }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) { register char *s = wordlist[key].rwd; if (*s == *str && !strncmp (str + 1, s + 1, len - 1)) return &wordlist[key]; } } return 0; } enum codes lexi () { int unary_delim; /* this is set to 1 if the current token forces a following operator to be unary */ static enum codes last_code; /* the last token type returned */ static int l_struct; /* set to 1 if the last token was 'struct' */ enum codes code; /* internal code to be returned */ char qchar; /* the delimiter character for a string */ unary_delim = false; /* tell world that this token started in column 1 iff the last thing scanned was nl */ parser_state_tos->col_1 = parser_state_tos->last_nl; parser_state_tos->last_nl = false; while (*buf_ptr == ' ' || *buf_ptr == '\t') { /* get rid of blanks */ parser_state_tos->col_1 = false; /* leading blanks imply token is not in column 1 */ if (++buf_ptr >= buf_end) fill_buffer (); } token = buf_ptr; /* Scan an alphanumeric token */ if (chartype[*buf_ptr] == alphanum || (buf_ptr[0] == '.' && isdigit (buf_ptr[1]))) { /* we have a character or number */ register struct templ *p; if (isdigit (*buf_ptr) || (buf_ptr[0] == '.' && isdigit (buf_ptr[1]))) { int seendot = 0, seenexp = 0; if (*buf_ptr == '0' && (buf_ptr[1] == 'x' || buf_ptr[1] == 'X')) { buf_ptr += 2; while (isxdigit (*buf_ptr)) buf_ptr++; } else while (1) { if (*buf_ptr == '.') if (seendot) break; else seendot++; buf_ptr++; if (!isdigit (*buf_ptr) && *buf_ptr != '.') if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp) break; else { seenexp++; seendot++; buf_ptr++; if (*buf_ptr == '+' || *buf_ptr == '-') buf_ptr++; } } /* Accept unsigned and unsigned long constants (U and UL suffixes). I'm not sure if LU is ansii. */ if (*buf_ptr == 'U' || *buf_ptr == 'u') buf_ptr++; if (*buf_ptr == 'L' || *buf_ptr == 'l') buf_ptr++; } else while (chartype[*buf_ptr] == alphanum) { /* copy it over */ buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } token_end = buf_ptr; while (*buf_ptr == ' ' || *buf_ptr == '\t') { if (++buf_ptr >= buf_end) fill_buffer (); } parser_state_tos->its_a_keyword = false; parser_state_tos->sizeof_keyword = false; /* if last token was 'struct', then this token should be treated as a declaration */ if (l_struct) { l_struct = false; last_code = ident; parser_state_tos->last_u_d = true; return (decl); } /* Operator after indentifier is binary */ parser_state_tos->last_u_d = false; last_code = ident; /* Check whether the token is a reserved word. Use perfect hashing... */ p = is_reserved (token, token_end - token); if (!p && user_specials != 0) { for (p = &user_specials[0]; p < &user_specials[0] + user_specials_idx; p++) { char *q = token; char *r = p->rwd; /* This string compare is a little nonstandard because token ends at the character before token_end and p->rwd is null-terminated. */ while (1) { /* If we have come to the end of both the keyword in user_specials and the keyword in token they are equal. */ if (q >= token_end && !*r) goto found_keyword; /* If we have come to the end of just one, they are not equal. */ if (q >= token_end || !*r) break; /* If the characters in corresponding characters are not equal, the strings are not equal. */ if (*q++ != *r++) break; } } /* Didn't find anything in user_specials. */ p = 0; } if (p) { /* we have a keyword */ found_keyword: parser_state_tos->its_a_keyword = true; parser_state_tos->last_u_d = true; parser_state_tos->last_rw = p->rwcode; switch (p->rwcode) { case rw_switch: /* it is a switch */ return (swstmt); case rw_case: /* a case or default */ return (casestmt); case rw_struct_like: /* a "struct" */ if (parser_state_tos->p_l_follow && !(parser_state_tos->noncast_mask & 1 << parser_state_tos->p_l_follow)) /* inside parens: cast */ { parser_state_tos->cast_mask |= 1 << parser_state_tos->p_l_follow; break; } l_struct = true; /* Next time around, we will want to know that we have had a 'struct' */ case rw_decl: /* one of the declaration keywords */ if (parser_state_tos->p_l_follow && !(parser_state_tos->noncast_mask & 1 << parser_state_tos->p_l_follow)) /* inside parens: cast */ { parser_state_tos->cast_mask |= 1 << parser_state_tos->p_l_follow; break; } last_code = decl; return (decl); case rw_sp_paren: /* if, while, for */ return (sp_paren); case rw_sp_nparen: /* do, else */ return (sp_nparen); case rw_sizeof: parser_state_tos->sizeof_keyword = true; return (ident); case rw_return: case rw_break: default: /* all others are treated like any other identifier */ return (ident); } /* end of switch */ } /* end of if (found_it) */ if (*buf_ptr == '(' && parser_state_tos->tos <= 1 && parser_state_tos->ind_level == 0 && parser_state_tos->paren_depth == 0) { /* We have found something which might be the name in a function definition. */ register char *tp; int paren_count = 1; /* Skip to the matching ')'. */ for (tp = buf_ptr + 1; paren_count > 0 && tp < in_prog + in_prog_size; tp++) { if (*tp == '(') paren_count++; if (*tp == ')') paren_count--; /* Can't occur in parameter list; this way we don't search the whole file in the case of unbalanced parens. */ if (*tp == ';') goto not_proc; } if (paren_count == 0) { while (isspace (*tp)) tp++; /* If the next char is ';' or ',' or '(' we have a function declaration, not a definition. I've added '=' to this list to keep from breaking a non-valid C macro from libc. -jla */ if (*tp != ';' && *tp != ',' && *tp != '(' && *tp != '=') { parser_state_tos->procname = token; parser_state_tos->procname_end = token_end; parser_state_tos->in_parameter_declaration = 1; } } not_proc:; } /* The following hack attempts to guess whether or not the current token is in fact a declaration keyword -- one that has been typedef'd */ if (((*buf_ptr == '*' && buf_ptr[1] != '=') || isalpha (*buf_ptr) || *buf_ptr == '_') && !parser_state_tos->p_l_follow && !parser_state_tos->block_init && (parser_state_tos->last_token == rparen || parser_state_tos->last_token == semicolon || parser_state_tos->last_token == decl || parser_state_tos->last_token == lbrace || parser_state_tos->last_token == rbrace)) { parser_state_tos->its_a_keyword = true; parser_state_tos->last_u_d = true; last_code = decl; return decl; } if (last_code == decl) /* if this is a declared variable, then following sign is unary */ parser_state_tos->last_u_d = true; /* will make "int a -1" work */ last_code = ident; return (ident); /* the ident is not in the list */ } /* end of procesing for alpanum character */ /* Scan a non-alphanumeric token */ /* If it is not a one character token, token_end will get changed later. */ token_end = buf_ptr + 1; if (++buf_ptr >= buf_end) fill_buffer (); switch (*token) { case '\0': code = code_eof; break; case '\n': unary_delim = parser_state_tos->last_u_d; parser_state_tos->last_nl = true; code = newline; break; case '\'': /* start of quoted character */ case '"': /* start of string */ qchar = *token; /* Find out how big the literal is so we can set token_end. */ /* Invariant: before loop test buf_ptr points to the next */ /* character that we have not yet checked. */ while (*buf_ptr != qchar && *buf_ptr != 0 && *buf_ptr != '\n') { if (*buf_ptr == '\\') { buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '\n') ++line_no; if (*buf_ptr == 0) break; } buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } if (*buf_ptr == '\n' || *buf_ptr == 0) { diag (1, qchar == '\'' ? "Unterminated character constant" : "Unterminated string constant"); } else { /* Advance over end quote char. */ buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } code = ident; break; case ('('): case ('['): unary_delim = true; code = lparen; break; case (')'): case (']'): code = rparen; break; case '#': unary_delim = parser_state_tos->last_u_d; code = preesc; break; case '?': unary_delim = true; code = question; break; case (':'): code = colon; unary_delim = true; break; case (';'): unary_delim = true; code = semicolon; break; case ('{'): unary_delim = true; /* This check is made in the code for '='. No one who writes initializers without '=' these days deserves to have indent work on their code (besides which, uncommenting this would screw up anything which assumes that parser_state_tos->block_init really means you are in an initializer. */ /* if (parser_state_tos->in_or_st) parser_state_tos->block_init = 1; */ /* The following neat hack causes the braces in structure initializations to be treated as parentheses, thus causing initializations to line up correctly, e.g. struct foo bar = {{a, b, c}, {1, 2}}; If lparen is returned, token can be used to distinguish between '{' and '(' where necessary. */ code = parser_state_tos->block_init ? lparen : lbrace; break; case ('}'): unary_delim = true; /* The following neat hack is explained under '{' above. */ code = parser_state_tos->block_init ? rparen : rbrace; break; case 014: /* a form feed */ unary_delim = parser_state_tos->last_u_d; parser_state_tos->last_nl = true; /* remember this so we can set 'parser_state_tos->col_1' right */ code = form_feed; break; case (','): unary_delim = true; code = comma; break; case '.': unary_delim = false; code = period; break; case '-': case '+': /* check for -, +, --, ++ */ code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; if (*buf_ptr == token[0]) { /* check for doubled character */ buf_ptr++; /* buffer overflow will be checked at end of loop */ if (last_code == ident || last_code == rparen) { code = (parser_state_tos->last_u_d ? unary_op : postop); /* check for following ++ or -- */ unary_delim = false; } } else if (*buf_ptr == '=') /* check for operator += */ buf_ptr++; else if (*buf_ptr == '>') { /* check for operator -> */ buf_ptr++; if (!pointer_as_binop) { unary_delim = false; code = unary_op; parser_state_tos->want_blank = false; } } break; /* buffer overflow will be checked at end of switch */ case '=': if (parser_state_tos->in_or_st) parser_state_tos->block_init = 1; if (*buf_ptr == '=') /* == */ buf_ptr++; else if (*buf_ptr == '-' || *buf_ptr == '+' || *buf_ptr == '*' || *buf_ptr == '&') { /* Something like x=-1, which can mean x -= 1 ("old style" in K&R1) or x = -1 (ANSI). Note that this is only an ambiguity if the character can also be a unary operator. If not, just produce output code that produces a syntax error (the theory being that people want to detect and eliminate old style assignments but they don't want indent to silently change the meaning of their code). */ diag (0, "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n", *buf_ptr, *buf_ptr); } code = binary_op; unary_delim = true; break; /* can drop thru!!! */ case '>': case '<': case '!': /* ops like <, <<, <=, !=, <<=, etc */ /* This will of course scan sequences like "<=>", "!=>", "<<>", etc. as one token, but I don't think that will cause any harm. */ while (*buf_ptr == '>' || *buf_ptr == '<' || *buf_ptr == '=') { if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '=') { if (++buf_ptr >= buf_end) fill_buffer (); } } code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; break; default: if (token[0] == '/' && *buf_ptr == '*') { /* it is start of comment */ if (++buf_ptr >= buf_end) fill_buffer (); code = comment; unary_delim = parser_state_tos->last_u_d; break; } while (*(buf_ptr - 1) == *buf_ptr || *buf_ptr == '=') { /* handle ||, &&, etc, and also things as in int *****i */ if (++buf_ptr >= buf_end) fill_buffer (); } code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; } /* end of switch */ if (code != newline) { l_struct = false; last_code = code; } token_end = buf_ptr; if (buf_ptr >= buf_end) /* check for input buffer empty */ fill_buffer (); parser_state_tos->last_u_d = unary_delim; return (code); } /* Add the given keyword to the keyword table, using val as the keyword type */ addkey (key, val) char *key; enum rwcodes val; { register struct templ *p; /* Check to see whether key is a reserved word or not. */ if (is_reserved (key, strlen (key)) != 0) return; if (user_specials == 0) { user_specials = (struct templ *) xmalloc (5 * sizeof (struct templ)); user_specials_max = 5; user_specials_idx = 0; } else if (user_specials_idx == user_specials_max) { user_specials_max += 5; user_specials = (struct templ *) xrealloc ((char *) user_specials, user_specials_max * sizeof (struct templ)); } p = &user_specials[user_specials_idx++]; p->rwd = key; p->rwcode = val; return; } indent-2.2.11/regression/standard/ind-star.c0000644000177400010010000000007510775646104015653 00000000000000main () { int code; /* * Thang. */ code = 1; } indent-2.2.11/regression/standard/struct_param.c0000644000177400010010000000002410775646104016630 00000000000000b (struct z *a) { } indent-2.2.11/regression/standard/boxed.c-20000644000177400010010000000450610775646104015375 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/brackets.c0000644000177400010010000000045710775646104015734 00000000000000void foo () { if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) mask = NULL; if ((acptr = FindUser (nick)) && ((!(bitsel & WHOSELECT_OPER)) || IsAnOper (acptr)) && Process (acptr) && SHOW_MORE (sptr, counter)) mask = NULL; } indent-2.2.11/regression/standard/bug206785.err0000644000177400010010000000017611212733322015735 00000000000000indent: input/bug206785.c:22: Warning:Unterminated string constant indent: input/bug206785.c:22: Error:Unexpected end of file indent-2.2.11/regression/standard/cplus.c-00000644000177400010010000000174010775646104015415 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here is a very long C plus plus comment very long C plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very long C plus plus comment Here is a very long C plus plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/indent.c0000644000177400010010000014140111145774471015413 00000000000000 /* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" #include void usage () { fprintf (stderr, "usage: indent file [-o outfile ] [ options ]\n"); fprintf (stderr, " indent file1 file2 ... fileN [ options ]\n"); exit (1); } /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *labbuf; char *s_lab; char *e_lab; char *l_lab; char *codebuf; char *s_code; char *e_code; char *l_code; char *combuf; char *s_com; char *e_com; char *l_com; struct buf save_com; char *bp_save; char *be_save; int code_lines; int line_no; struct fstate keywordf; struct fstate stringf; struct fstate boxcomf; struct fstate blkcomf; struct fstate scomf; struct fstate bodyf; int break_comma; /* Insure that BUFSTRUC has at least REQ more chars left, if not extend it. Note: This may change bufstruc.ptr. */ #define need_chars(bufstruc, req) \ if ((bufstruc.end - bufstruc.ptr + (req)) >= bufstruc.size) \ {\ int cur_chars = bufstruc.end - bufstruc.ptr;\ bufstruc.size *= 2;\ bufstruc.ptr = xrealloc(bufstruc.ptr,bufstruc.size);\ bufstruc.end = bufstruc.ptr + cur_chars;\ } int else_or_endif; /* true iff last keyword was an else */ int last_else; /* True if we have just encountered the end of an if (...), etc. (i.e. the ')' of the if (...) was the last token). The variable is set to 2 in the middle of the main token reading loop and is decremented at the beginning of the loop, so it will reach zero when the second token after the ')' is read. */ int last_token_ends_sp; /* current indentation for declarations */ int dec_ind; /* structure indentation levels */ int *di_stack; /* Currently allocated size of di_stack. */ int di_stack_alloc; /* used when buffering up comments to remember that a newline was passed over */ int flushed_nl; int force_nl; /* set to true when we see a case, so we will know what to do with the following colon */ int scase; /* when true, we are in the expressin of if(...), while(...), etc. */ int sp_sw; /* when this is positive, we have seen a ? without the matching : in a ?: construct */ int squest; static void indent (this_file) struct file_buffer *this_file; { register int i; enum codes hd_type; register char *t_ptr; enum codes type_code; int dec_ind; /* current indentation for declarations */ int flushed_nl; int force_nl; int scase; /* true when we've just see a case */ int sp_sw; /* when true, we are in the expressin of if(...), while(...), etc. */ /* True if we have just encountered the end of an if (...), etc. (i.e. the ')' of the if (...) was the last token). The variable is set to 2 in the middle of the main token reading loop and is decremented at the beginning of the loop, so it will reach zero when the second token after the ')' is read. */ int last_token_ends_sp; int squest; /* when this is positive, we have seen a ? without the matching : in a ?: construct */ int last_else; /* true iff last keyword was an else */ in_prog = in_prog_pos = this_file->data; in_prog_size = this_file->size; hd_type = code_eof; dec_ind = 0; last_token_ends_sp = false; last_else = false; sp_sw = force_nl = false; scase = false; if (com_ind <= 1) com_ind = 2; /* dont put normal comments before column 2 */ if (troff) { if (bodyf.font[0] == 0) parsefont (&bodyf, "R"); if (scomf.font[0] == 0) parsefont (&scomf, "I"); if (blkcomf.font[0] == 0) blkcomf = scomf, blkcomf.size += 2; if (boxcomf.font[0] == 0) boxcomf = blkcomf; if (stringf.font[0] == 0) parsefont (&stringf, "L"); if (keywordf.font[0] == 0) parsefont (&keywordf, "B"); writefdef (&bodyf, 'B'); writefdef (&scomf, 'C'); writefdef (&blkcomf, 'L'); writefdef (&boxcomf, 'X'); writefdef (&stringf, 'S'); writefdef (&keywordf, 'K'); } if (block_comment_max_col <= 0) block_comment_max_col = max_col; if (decl_com_ind <= 0) /* if not specified by user, set this */ decl_com_ind = ljust_decl ? (com_ind <= 10 ? 2 : com_ind - 8) : com_ind; if (continuation_indent == 0) continuation_indent = ind_size; fill_buffer (); /* get first batch of stuff into input buffer */ parse (semicolon); { register char *p = buf_ptr; register col = 1; while (1) { if (*p == ' ') col++; else if (*p == '\t') col = ((col - 1) & ~7) + 9; else break; p++; } if (col > ind_size) parser_state_tos->ind_level = parser_state_tos->i_l_follow = col; } if (troff) { register char *p = in_name, *beg = in_name; while (*p) if (*p++ == '/') beg = p; fprintf (output, ".Fn \"%s\"\n", beg); } /* START OF MAIN LOOP */ while (1) { /* this is the main loop. it will go until we reach eof */ int is_procname; type_code = lexi (); /* lexi reads one token. "token" points to the actual characters. lexi returns a code indicating the type of token */ if (last_token_ends_sp > 0) last_token_ends_sp--; is_procname = parser_state_tos->procname[0]; /* The following code moves everything following an if (), while (), else, etc. up to the start of the following stmt to a buffer. This allows proper handling of both kinds of brace placement. */ flushed_nl = false; while (parser_state_tos->search_brace) { /* After scanning an if(), while (), etc., it might be necessary to keep track of the text between the if() and the start of the statement which follows. Use save_com to do so. */ switch (type_code) { case newline: ++line_no; flushed_nl = true; case form_feed: break; /* form feeds and newlines found here will be ignored */ case lbrace: /* this is a brace that starts the compound stmt */ if (save_com.end == save_com.ptr) { /* ignore buffering if a comment wasnt stored up */ parser_state_tos->search_brace = false; goto check_type; } /* We need to put the '{' back into save_com somewhere. */ if (btype_2) /* Put it at the beginning, e.g. if (foo) { / * comment here * / */ save_com.ptr[0] = '{'; else { /* Put it at the end, e.g. if (foo) / * comment here * / { */ /* Putting in this newline causes a dump_line to occur right after the comment, thus insuring that it will be put in the correct column. */ *save_com.end++ = '\n'; *save_com.end++ = '{'; } /* Go to common code to get out of this loop. */ goto sw_buffer; case comment: /* we have a comment, so we must copy it into the buffer */ if (!flushed_nl || save_com.end != save_com.ptr) { need_chars (save_com, 10); if (save_com.end == save_com.ptr) { /* if this is the first comment, we must set up the buffer */ save_com.ptr[0] = save_com.ptr[1] = ' '; save_com.end = save_com.ptr + 2; } else { *save_com.end++ = '\n'; /* add newline between comments */ *save_com.end++ = ' '; --line_no; } *save_com.end++ = '/'; /* copy in start of comment */ *save_com.end++ = '*'; for (;;) { /* loop until we get to the end of the comment */ /* make sure there is room for this character and (while we're at it) the '/' we might add at the end of the loop. */ need_chars (save_com, 2); *save_com.end = *buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer (); if (had_eof) { diag (1, "Unclosed comment"); exit (1); } } if (*save_com.end++ == '*' && *buf_ptr == '/') break; /* we are at end of comment */ } *save_com.end++ = '/'; /* add ending slash */ if (++buf_ptr >= buf_end) /* get past / in buffer */ fill_buffer (); break; } default: /* it is the start of a normal statment */ if (flushed_nl) /* if we flushed a newline, make sure it is put back */ force_nl = true; if ((type_code == sp_paren && *token == 'i' && last_else && else_if) || (type_code == sp_nparen && *token == 'e' && e_code != s_code && e_code[-1] == '}')) force_nl = false; if (save_com.end == save_com.ptr) { /* ignore buffering if comment wasnt saved up */ parser_state_tos->search_brace = false; goto check_type; } if (force_nl) { /* if we should insert a nl here, put it into the buffer */ force_nl = false; --line_no; /* this will be re-increased when the nl is read from the buffer */ need_chars (save_com, 2); *save_com.end++ = '\n'; *save_com.end++ = ' '; if (verbose && !flushed_nl) /* print error msg if the line was not already broken */ diag (0, "Line broken"); flushed_nl = false; } for (t_ptr = token; t_ptr < token_end; ++t_ptr) { need_chars (save_com, 1); *save_com.end++ = *t_ptr; /* copy token into temp buffer */ } parser_state_tos->procname = "\0"; sw_buffer: parser_state_tos->search_brace = false; /* stop looking for start of stmt */ bp_save = buf_ptr; /* save current input buffer */ be_save = buf_end; buf_ptr = save_com.ptr; /* fix so that subsequent calls to lexi will take tokens out of save_com */ need_chars (save_com, 1); *save_com.end++ = ' '; /* add trailing blank, just in case */ buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ break; } /* end of switch */ /* we must make this check, just in case there was an unexpected EOF */ if (type_code != code_eof) type_code = lexi (); /* read another token */ /* if (parser_state_tos->search_brace) parser_state_tos->procname[0] = 0; */ if ((is_procname = parser_state_tos->procname[0]) && flushed_nl && !procnames_start_line && parser_state_tos->in_decl && type_code == ident) flushed_nl = 0; } /* end of while (search_brace) */ last_else = 0; check_type: if (type_code == code_eof) { /* we got eof */ if (s_lab != e_lab || s_code != e_code || s_com != e_com) /* must dump end of line */ dump_line (); if (parser_state_tos->tos > 1) /* check for balanced braces */ diag (1, "Stuff missing from end of file."); if (verbose) { printf ("There were %d output lines and %d comments\n", out_lines, out_coms); printf ("(Lines with comments)/(Lines with code): %6.3f\n", (1.0 * com_lines) / code_lines); } fflush (output); if (found_err) exit (found_err); return; } if ((type_code != comment) && (type_code != newline) && (type_code != preesc) && (type_code != form_feed)) { if (force_nl && (type_code != semicolon) && (type_code != lbrace || !btype_2)) { /* we should force a broken line here */ if (verbose && !flushed_nl) diag (0, "Line broken"); flushed_nl = false; dump_line (); parser_state_tos->want_blank = false; /* dont insert blank at line start */ force_nl = false; } parser_state_tos->in_stmt = true; /* turn on flag which causes an extra level of indentation. this is turned off by a ; or } */ if (s_com != e_com) { /* the turkey has embedded a comment in a line. Move it from the com buffer to the code buffer. */ /* Do not add a space before the comment if it is the first thing on the line. */ if (e_code != s_code) { *e_code++ = ' '; } for (t_ptr = s_com; *t_ptr; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } *e_code++ = ' '; *e_code = '\0'; /* null terminate code sect */ parser_state_tos->want_blank = false; e_com = s_com; } } else if (type_code != comment) /* preserve force_nl thru a comment */ force_nl = false; /* cancel forced newline after newline, form feed, etc */ /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ check_code_size; switch (type_code) { /* now, decide what to do with the token */ case form_feed: /* found a form feed in line */ parser_state_tos->use_ff = true; /* a form feed is treated much like a newline */ dump_line (); parser_state_tos->want_blank = false; break; case newline: if (parser_state_tos->last_token != comma || parser_state_tos->p_l_follow > 0 || !leave_comma || parser_state_tos->block_init || !break_comma || s_com != e_com) { dump_line (); parser_state_tos->want_blank = false; } /* If we were on the line with a #else or a #endif, we aren't anymore. */ else_or_endif = false; ++line_no; /* keep track of input line number */ break; case lparen: /* Braces in initializer lists should be put on new lines. This is necessary so that -gnu does not cause things like char *this_is_a_string_array[] = { "foo", "this_string_does_not_fit", "nor_does_this_rather_long_string" } which is what happens because we are trying to line the strings up with the parentheses, and those that are too long are moved to the right an ugly amount. However, if the current line is empty, the left brace is already on a new line, so don't molest it. */ if (token[0] == '{' && (s_code != e_code || s_com != e_com || s_lab != e_lab)) { dump_line (); /* Do not put a space before the '{'. */ parser_state_tos->want_blank = false; } /* Count parens so we know how deep we are. */ if (++parser_state_tos->p_l_follow >= parser_state_tos->paren_indents_size) { parser_state_tos->paren_indents_size *= 2; parser_state_tos->paren_indents = (short *) xrealloc (parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } parser_state_tos->paren_depth++; if (parser_state_tos->want_blank && *token != '[' && (parser_state_tos->last_token != ident || proc_calls_space || (parser_state_tos->its_a_keyword && (!parser_state_tos->sizeof_keyword || blank_after_sizeof)))) *e_code++ = ' '; if (parser_state_tos->in_decl && !parser_state_tos->block_init) if (troff && !parser_state_tos->dumped_decl_indent && !is_procname && parser_state_tos->last_token == decl) { parser_state_tos->dumped_decl_indent = 1; sprintf (e_code, "\n.Du %dp+\200p \"%.*s\"\n", dec_ind * 7, token_end - token, token); e_code += strlen (e_code); } else { while ((e_code - s_code) < dec_ind) { check_code_size; *e_code++ = ' '; } *e_code++ = token[0]; } else *e_code++ = token[0]; parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] = e_code - s_code; if (sp_sw && parser_state_tos->p_l_follow == 1 && extra_expression_indent && parser_state_tos->paren_indents[0] < 2 * ind_size) parser_state_tos->paren_indents[0] = 2 * ind_size; parser_state_tos->want_blank = false; if (parser_state_tos->in_or_st && *token == '(' && parser_state_tos->tos <= 2) { /* this is a kluge to make sure that declarations will be aligned right if proc decl has an explicit type on it, i.e. "int a(x) {..." */ parse_lparen_in_decl (); /* Turn off flag for structure decl or initialization. */ parser_state_tos->in_or_st = false; } if (parser_state_tos->sizeof_keyword) parser_state_tos->sizeof_mask |= 1 << parser_state_tos->p_l_follow; /* The '(' that starts a cast can never be preceeded by an indentifier or decl. */ if (parser_state_tos->last_token == decl || (parser_state_tos->last_token == ident && parser_state_tos->last_rw != rw_return)) parser_state_tos->noncast_mask |= 1 << parser_state_tos->p_l_follow; else parser_state_tos->noncast_mask &= ~(1 << parser_state_tos->p_l_follow); break; case rparen: if (parser_state_tos->cast_mask & (1 << parser_state_tos->p_l_follow) & ~parser_state_tos->sizeof_mask) { parser_state_tos->last_u_d = true; parser_state_tos->cast_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (!parser_state_tos->cast_mask && cast_space) parser_state_tos->want_blank = true; else parser_state_tos->want_blank = false; } parser_state_tos->sizeof_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (--parser_state_tos->p_l_follow < 0) { parser_state_tos->p_l_follow = 0; diag (0, "Extra %c", *token); } parser_state_tos->paren_depth--; /* if the paren starts the line, then indent it */ if (e_code == s_code) { int level = parser_state_tos->p_l_follow; parser_state_tos->paren_level = level; if (level > 0) paren_target = -parser_state_tos->paren_indents[level - 1]; else paren_target = 0; } else if (parser_state_tos->in_decl && parser_state_tos->paren_depth == 0) parser_state_tos->want_blank = true; *e_code++ = token[0]; #if 0 if (!parser_state_tos->cast_mask || cast_space) parser_state_tos->want_blank = true; #endif /* check for end of if (...), or some such */ if (sp_sw && (parser_state_tos->p_l_follow == 0)) { /* Indicate that we have just left the parenthesized expression of a while, if, or for, unless we are getting out of the parenthesized expression of the while of a do-while loop. (do-while is different because a semicolon immediately following this will not indicate a null loop body). */ if (parser_state_tos->p_stack[parser_state_tos->tos] != dohead) last_token_ends_sp = 2; sp_sw = false; force_nl = true; /* must force newline after if */ parser_state_tos->last_u_d = true; /* inform lexi that a following operator is unary */ parser_state_tos->in_stmt = false; /* dont use stmt continuation indentation */ parse (hd_type); /* let parser worry about if, or whatever */ } parser_state_tos->search_brace = btype_2; /* this should insure that constructs such as main(){...} and int[]{...} have their braces put in the right place */ break; case unary_op: /* this could be any unary operation */ if (parser_state_tos->want_blank) *e_code++ = ' '; if (troff && !parser_state_tos->dumped_decl_indent && parser_state_tos->in_decl && !is_procname) { sprintf (e_code, "\n.Du %dp+\200p \"%.*s\"\n", dec_ind * 7, token_end - token, token); parser_state_tos->dumped_decl_indent = 1; e_code += strlen (e_code); } else { char *res = token; char *res_end = token_end; /* if this is a unary op in a declaration, we should indent this token */ if (parser_state_tos->paren_depth == 0 && parser_state_tos->in_decl && !parser_state_tos->block_init) { while ((e_code - s_code) < (dec_ind - (token_end - token))) { check_code_size; *e_code++ = ' '; } } if (troff && token[0] == '-' && token[1] == '>') { static char resval[] = "\\(->"; res = resval; res_end = res + sizeof (resval); } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } } parser_state_tos->want_blank = false; break; case binary_op: /* any binary operation */ if (parser_state_tos->want_blank || (e_code > s_code && *e_code != ' ')) *e_code++ = ' '; { char *res = token; char *res_end = token_end; #define set_res(str) \ {\ static char resval[] = str;\ res = resval;\ res_end = res + sizeof(resval);\ } if (troff) switch (token[0]) { case '<': if (token[1] == '=') set_res ("\\(<="); break; case '>': if (token[1] == '=') set_res ("\\(>="); break; case '!': if (token[1] == '=') set_res ("\\(!="); break; case '|': if (token[1] == '|') { set_res ("\\(br\\(br"); } else if (token[1] == 0) set_res ("\\(br"); break; } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; /* move the operator */ } } parser_state_tos->want_blank = true; break; case postop: /* got a trailing ++ or -- */ *e_code++ = token[0]; *e_code++ = token[1]; parser_state_tos->want_blank = true; break; case question: /* got a ? */ squest++; /* this will be used when a later colon appears so we can distinguish the ?: construct */ if (parser_state_tos->want_blank) *e_code++ = ' '; *e_code++ = '?'; parser_state_tos->want_blank = true; break; case casestmt: /* got word 'case' or 'default' */ scase = true; /* so we can process the later colon properly */ goto copy_id; case colon: /* got a ':' */ if (squest > 0) { /* it is part of the ?: construct */ --squest; if (parser_state_tos->want_blank) *e_code++ = ' '; *e_code++ = ':'; parser_state_tos->want_blank = true; break; } if (parser_state_tos->in_decl) { *e_code++ = ':'; parser_state_tos->want_blank = false; break; } parser_state_tos->in_stmt = false; /* seeing a label does not imply we are in a stmt */ for (t_ptr = s_code; *t_ptr; ++t_ptr) *e_lab++ = *t_ptr; /* turn everything so far into a label */ e_code = s_code; *e_lab++ = ':'; *e_lab++ = ' '; *e_lab = '\0'; /* parser_state_tos->pcas e will be used by dump_line to decide how to indent the label. force_nl will force a case n: to be on a line by itself */ force_nl = parser_state_tos->pcase = scase; scase = false; parser_state_tos->want_blank = false; break; case semicolon: /* we are not in an initialization or structure declaration */ parser_state_tos->in_or_st = false; scase = false; squest = 0; /* The following code doesn't seem to do much good. Just because we've found something like extern int foo(); or int (*foo)(); doesn't mean we are out of a declaration. Now if it was serving some purpose we'll have to address that.... if (parser_state_tos->last_token == rparen) parser_state_tos->in_parameter_declaration = 0; */ parser_state_tos->cast_mask = 0; parser_state_tos->sizeof_mask = 0; parser_state_tos->block_init = 0; parser_state_tos->block_init_level = 0; parser_state_tos->just_saw_decl--; if (parser_state_tos->in_decl && s_code == e_code && !parser_state_tos->block_init) while ((e_code - s_code) < (dec_ind - 1)) { check_code_size; *e_code++ = ' '; } /* if we were in a first level structure declaration, we aren't any more */ parser_state_tos->in_decl = (parser_state_tos->dec_nest > 0); if ((!sp_sw || hd_type != forstmt) && parser_state_tos->p_l_follow > 0) { /* This should be true iff there were unbalanced parens in the stmt. It is a bit complicated, because the semicolon might be in a for stmt */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; if (sp_sw) { /* this is a check for a if, while, etc. with unbalanced parens */ sp_sw = false; parse (hd_type); /* dont lose the if, or whatever */ } } /* If we have a semicolon following an if, while, or for, and the user wants us to, we should insert a space (to show that there is a null statement there). */ if (last_token_ends_sp && space_sp_semicolon) { *e_code++ = ' '; } *e_code++ = ';'; parser_state_tos->want_blank = true; /* we are no longer in the middle of a stmt */ parser_state_tos->in_stmt = (parser_state_tos->p_l_follow > 0); if (!sp_sw) { /* if not if for (;;) */ parse (semicolon); /* let parser know about end of stmt */ force_nl = true; /* force newline after a end of stmt */ } break; case lbrace: /* got a '{' */ parser_state_tos->in_stmt = false; /* dont indent the {} */ if (!parser_state_tos->block_init) force_nl = true; /* force other stuff on same line as '{' onto new line */ else if (parser_state_tos->block_init_level <= 0) parser_state_tos->block_init_level = 1; else parser_state_tos->block_init_level++; if (s_code != e_code && !parser_state_tos->block_init) { if (!btype_2) { dump_line (); parser_state_tos->want_blank = false; } else { if (parser_state_tos->in_parameter_declaration && !parser_state_tos->in_or_st) { parser_state_tos->i_l_follow = 0; dump_line (); parser_state_tos->want_blank = false; } else parser_state_tos->want_blank = true; } } if (parser_state_tos->in_parameter_declaration) prefix_blankline_requested = 0; if (parser_state_tos->p_l_follow > 0) { /* check for preceeding unbalanced parens */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; if (sp_sw) { /* check for unclosed if, for, etc. */ sp_sw = false; parse (hd_type); parser_state_tos->ind_level = parser_state_tos->i_l_follow; } } if (s_code == e_code) parser_state_tos->ind_stmt = false; /* dont put extra indentation on line with '{' */ if (parser_state_tos->in_decl && parser_state_tos->in_or_st) { /* This is a structure declaration. */ if (parser_state_tos->dec_nest >= di_stack_alloc) { di_stack_alloc *= 2; di_stack = (int *) xrealloc (di_stack, di_stack_alloc * sizeof (*di_stack)); } di_stack[parser_state_tos->dec_nest++] = dec_ind; /* ? dec_ind = 0; */ } else { parser_state_tos->decl_on_line = false; /* we cant be in the middle of a declaration, so dont do special indentation of comments */ #if 0 /* Doesn't work currently. */ if (blanklines_after_declarations_at_proctop && parser_state_tos->in_parameter_declaration) postfix_blankline_requested = 1; #endif parser_state_tos->in_parameter_declaration = 0; } dec_ind = 0; /* We are no longer looking for an initializer or structure. Needed so that the '=' in "enum bar {a = 1" does not get interpreted as the start of an initializer. */ parser_state_tos->in_or_st = false; parse (lbrace); /* let parser know about this */ if (parser_state_tos->want_blank) /* put a blank before '{' if '{' is not at start of line */ *e_code++ = ' '; parser_state_tos->want_blank = false; *e_code++ = '{'; parser_state_tos->just_saw_decl = 0; break; case rbrace: /* got a '}' */ /* semicolons can be omitted in declarations */ if (parser_state_tos->p_stack[parser_state_tos->tos] == decl && !parser_state_tos->block_init) parse (semicolon); if (parser_state_tos->p_l_follow) { /* check for unclosed if, for, else. */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; sp_sw = false; } parser_state_tos->just_saw_decl = 0; parser_state_tos->block_init_level--; if (s_code != e_code && !parser_state_tos->block_init) { /* '}' must be first on line */ if (verbose) diag (0, "Line broken"); dump_line (); } *e_code++ = '}'; parser_state_tos->want_blank = true; parser_state_tos->in_stmt = parser_state_tos->ind_stmt = false; if (parser_state_tos->dec_nest > 0) { /* we are in multi-level structure declaration */ dec_ind = di_stack[--parser_state_tos->dec_nest]; if (parser_state_tos->dec_nest == 0 && !parser_state_tos->in_parameter_declaration) parser_state_tos->just_saw_decl = 2; parser_state_tos->in_decl = true; } prefix_blankline_requested = 0; parse (rbrace); /* let parser know about this */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dohead && !btype_2) force_nl = true; parser_state_tos->search_brace = (cuddle_else && parser_state_tos->p_stack[parser_state_tos->tos] == ifhead); #if 0 parser_state_tos->search_brace = (cuddle_else && parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && (parser_state_tos->il[parser_state_tos->tos] >= parser_state_tos->ind_level)); #endif if (parser_state_tos->tos <= 1 && blanklines_after_procs && parser_state_tos->dec_nest <= 0) postfix_blankline_requested = 1; break; case swstmt: /* got keyword "switch" */ sp_sw = true; hd_type = swstmt; /* keep this for when we have seen the expression */ goto copy_id; /* go move the token into buffer */ case sp_paren: /* token is if, while, for */ sp_sw = true; /* the interesting stuff is done after the expression is scanned */ hd_type = (*token == 'i' ? ifstmt : (*token == 'w' ? whilestmt : forstmt)); /* remember the type of header for later use by parser */ goto copy_id; /* copy the token into line */ case sp_nparen: /* got else, do */ parser_state_tos->in_stmt = false; if (*token == 'e') { if (e_code != s_code && (!cuddle_else || e_code[-1] != '}')) { if (verbose) diag (0, "Line broken"); dump_line (); /* make sure this starts a line */ parser_state_tos->want_blank = false; } force_nl = true; /* also, following stuff must go onto new line */ last_else = 1; parse (elselit); } else { if (e_code != s_code) { /* make sure this starts a line */ if (verbose) diag (0, "Line broken"); dump_line (); parser_state_tos->want_blank = false; } force_nl = true; /* also, following stuff must go onto new line */ last_else = 0; parse (dolit); } goto copy_id; /* move the token into line */ case decl: /* we have a declaration type (int, register, etc.) */ parse (decl); /* let parser worry about indentation */ if (parser_state_tos->last_token == rparen && parser_state_tos->tos <= 1) { parser_state_tos->in_parameter_declaration = 1; if (s_code != e_code) { dump_line (); parser_state_tos->want_blank = false; } } if (parser_state_tos->in_parameter_declaration && indent_parameters && parser_state_tos->dec_nest == 0 && parser_state_tos->p_l_follow == 0) { parser_state_tos->ind_level = parser_state_tos->i_l_follow = indent_parameters; parser_state_tos->ind_stmt = 0; } /* in_or_st set for struct or initialization decl. Don't set it if we're in ansi prototype */ if (!parser_state_tos->paren_depth) parser_state_tos->in_or_st = true; parser_state_tos->in_decl = parser_state_tos->decl_on_line = true; #if 0 if (!parser_state_tos->in_or_st && parser_state_tos->dec_nest <= 0) #endif if (parser_state_tos->dec_nest <= 0) parser_state_tos->just_saw_decl = 2; if (prefix_blankline_requested && (parser_state_tos->block_init != 0 || parser_state_tos->block_init_level != -1 || parser_state_tos->last_token != rbrace || e_code != s_code || e_lab != s_lab || e_com != s_com)) prefix_blankline_requested = 0; i = token_end - token + 1; /* get length of token plus 1 */ /* dec_ind = e_code - s_code + (parser_state_tos->decl_indent>i ? parser_state_tos->decl_indent : i); */ dec_ind = decl_indent > 0 ? decl_indent : i; goto copy_id; case ident: /* got an identifier or constant */ /* If we are in a declaration, we must indent identifier. But not inside the parentheses of an ANSI function declaration. */ if (parser_state_tos->in_decl && parser_state_tos->p_l_follow == 0 && parser_state_tos->last_token != rbrace) { if (parser_state_tos->want_blank) *e_code++ = ' '; parser_state_tos->want_blank = false; if (is_procname == 0 || !procnames_start_line) { if (!parser_state_tos->block_init) if (troff && !parser_state_tos->dumped_decl_indent) { sprintf (e_code, "\n.De %dp+\200p\n", dec_ind * 7); parser_state_tos->dumped_decl_indent = 1; e_code += strlen (e_code); } else while ((e_code - s_code) < dec_ind) { check_code_size; *e_code++ = ' '; } } else { if (dec_ind && s_code != e_code) dump_line (); dec_ind = 0; parser_state_tos->want_blank = false; } } else if (sp_sw && parser_state_tos->p_l_follow == 0) { sp_sw = false; force_nl = true; parser_state_tos->last_u_d = true; parser_state_tos->in_stmt = false; parse (hd_type); } copy_id: if (parser_state_tos->want_blank) *e_code++ = ' '; if (troff && parser_state_tos->its_a_keyword) { e_code = chfont (&bodyf, &keywordf, e_code); for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size; *e_code++ = keywordf.allcaps && islower (*t_ptr) ? toupper (*t_ptr) : *t_ptr; } e_code = chfont (&keywordf, &bodyf, e_code); } else { /* Troff mode requires that strings be processed specially. */ if (troff && (*token == '"' || *token == '\'')) { char qchar; qchar = *token; *e_code++ = '`'; if (qchar == '"') *e_code++ = '`'; e_code = chfont (&bodyf, &stringf, e_code); t_ptr = token + 1; while (t_ptr < token_end) { *e_code = *t_ptr++; if (*e_code == '\\') { *++e_code = '\\'; if (*t_ptr == '\\') *++e_code = '\\'; /* Copy char after backslash. */ *++e_code = *t_ptr++; /* Point after the last char we copied. */ e_code++; } } e_code = chfont (&stringf, &bodyf, e_code - 1); if (qchar == '"') *e_code++ = '\''; } else for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } } parser_state_tos->want_blank = true; /* If the token is va_dcl, it appears without a semicolon, so we need to pretend that one was there. */ if ((token_end - token) == 6 && strncmp (token, "va_dcl", 6) == 0) { parser_state_tos->in_or_st = false; parser_state_tos->just_saw_decl--; parser_state_tos->in_decl = 0; parse (semicolon); force_nl = true; } break; case period: /* treat a period kind of like a binary operation */ *e_code++ = '.'; /* move the period into line */ parser_state_tos->want_blank = false; /* dont put a blank after a period */ break; case comma: /* only put blank after comma if comma does not start the line */ parser_state_tos->want_blank = (s_code != e_code); if (parser_state_tos->paren_depth == 0 && parser_state_tos->in_decl && is_procname == 0 && !parser_state_tos->block_init) while ((e_code - s_code) < (dec_ind - 1)) { check_code_size; *e_code++ = ' '; } *e_code++ = ','; if (parser_state_tos->p_l_follow == 0) { if (parser_state_tos->block_init_level <= 0) parser_state_tos->block_init = 0; /* If we are in a declaration, and either the user wants all comma'd declarations broken, or the line is getting too long, break the line. */ if (break_comma && (!leave_comma || (compute_code_target () + (e_code - s_code) > max_col - 8))) force_nl = true; } break; case preesc: /* got the character '#' */ if ((s_com != e_com) || (s_lab != e_lab) || (s_code != e_code)) dump_line (); *e_lab++ = '#'; /* move whole line to 'label' buffer */ { int in_comment = 0; int com_start = 0; char quote = 0; int com_end = 0; /* ANSI allows spaces between '#' and preprocessor directives. Remove such spaces unless user has specified "-lpb". */ while (*buf_ptr == ' ' || *buf_ptr == '\t') { if (leave_preproc_space) *e_lab++ = *buf_ptr; buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } while (*buf_ptr != '\n' || (in_comment && !had_eof)) { check_lab_size; *e_lab = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); switch (*e_lab++) { case BACKSLASH: if (troff) *e_lab++ = BACKSLASH; if (!in_comment) { *e_lab++ = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } break; case '/': if (*buf_ptr == '*' && !in_comment && !quote) { in_comment = 1; *e_lab++ = *buf_ptr++; com_start = e_lab - s_lab - 2; } break; case '"': if (quote == '"') quote = 0; break; case '\'': if (quote == '\'') quote = 0; break; case '*': if (*buf_ptr == '/' && in_comment) { in_comment = 0; *e_lab++ = *buf_ptr++; com_end = e_lab - s_lab; } break; } } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on preprocessor line */ if (save_com.end != save_com.ptr) { need_chars (save_com, 2); *save_com.end++ = '\n'; /* add newline between comments */ *save_com.end++ = ' '; --line_no; } need_chars (save_com, com_end - com_start); strncpy (save_com.end, s_lab + com_start, com_end - com_start); save_com.end += com_end - com_start; e_lab = s_lab + com_start; while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; bp_save = buf_ptr; /* save current input buffer */ be_save = buf_end; buf_ptr = save_com.ptr; /* fix so that subsequent calls to lexi will take tokens out of save_com */ need_chars (save_com, 1); *save_com.end++ = ' '; /* add trailing blank, just in case */ buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ } *e_lab = '\0'; /* null terminate line */ parser_state_tos->pcase = false; } if (strncmp (s_lab + 1, "if", 2) == 0) { if (blanklines_around_conditional_compilation) { register c; prefix_blankline_requested++; while ((c = *in_prog_pos++) == '\n'); in_prog_pos--; } { /* Push a copy of the parser_state onto the stack. All manipulations will use the copy at the top of stack, and then we can return to the previous state by popping the stack. */ struct parser_state *new; new = (struct parser_state *) xmalloc (sizeof (struct parser_state)); memcpy (new, parser_state_tos, sizeof (struct parser_state)); /* We need to copy the dynamically allocated arrays in the struct parser_state too. */ new->p_stack = (enum codes *) xmalloc (parser_state_tos->p_stack_size * sizeof (enum codes)); memcpy (new->p_stack, parser_state_tos->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); new->il = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); memcpy (new->il, parser_state_tos->il, parser_state_tos->p_stack_size * sizeof (int)); new->cstk = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); memcpy (new->cstk, parser_state_tos->cstk, parser_state_tos->p_stack_size * sizeof (int)); new->paren_indents = (short *) xmalloc (parser_state_tos->paren_indents_size * sizeof (short)); memcpy (new->paren_indents, parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); new->next = parser_state_tos; parser_state_tos = new; } } else if (strncmp (s_lab + 1, "else", 4) == 0) { /* When we get #else, we want to restore the parser state to what it was before the matching #if, so that things get lined up with the code before the #if. However, we do not want to pop the stack; we just want to copy the second to top elt of the stack because when we encounter the #endif, it will pop the stack. */ else_or_endif = true; if (parser_state_tos->next) { /* First save the addresses of the arrays for the top of stack. */ enum codes *tos_p_stack = parser_state_tos->p_stack; int *tos_il = parser_state_tos->il; int *tos_cstk = parser_state_tos->cstk; short *tos_paren_indents = parser_state_tos->paren_indents; struct parser_state *second = parser_state_tos->next; memcpy (parser_state_tos, second, sizeof (struct parser_state)); parser_state_tos->next = second; /* Now copy the arrays from the second to top of stack to the top of stack. */ /* Since the p_stack, etc. arrays only grow, never shrink, we know that they will be big enough to fit the array from the second to top of stack. */ parser_state_tos->p_stack = tos_p_stack; memcpy (parser_state_tos->p_stack, parser_state_tos->next->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); parser_state_tos->il = tos_il; memcpy (parser_state_tos->il, parser_state_tos->next->il, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->cstk = tos_cstk; memcpy (parser_state_tos->cstk, parser_state_tos->next->cstk, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->paren_indents = tos_paren_indents; memcpy (parser_state_tos->paren_indents, parser_state_tos->next->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } else diag (1, "Unmatched #else"); } else if (strncmp (s_lab + 1, "endif", 5) == 0) { else_or_endif = true; /* We want to remove the second to top elt on the stack, which was put there by #if and was used to restore the stack at the #else (if there was one). We want to leave the top of stack unmolested so that the state which we have been using is unchanged. */ if (parser_state_tos->next) { struct parser_state *second = parser_state_tos->next; parser_state_tos->next = second->next; free (second->p_stack); free (second->il); free (second->cstk); free (second->paren_indents); free (second); } else diag (1, "Unmatched #endif"); if (blanklines_around_conditional_compilation) { postfix_blankline_requested++; n_real_blanklines = 0; } } /* Normally, subsequent processing of the newline character causes the line to be printed. The following clause handles a special case (comma-separated declarations separated by the preprocessor lines) where this doesn't happen. */ if (parser_state_tos->last_token == comma && parser_state_tos->p_l_follow <= 0 && leave_comma && !parser_state_tos->block_init && break_comma && s_com == e_com) { dump_line (); parser_state_tos->want_blank = false; } break; case comment: /* we have gotten a /* this is a biggie */ if (flushed_nl) { /* we should force a broken line here */ flushed_nl = false; dump_line (); parser_state_tos->want_blank = false; /* dont insert blank at line start */ force_nl = false; } pr_comment (); break; } /* end of big switch stmt */ *e_code = '\0'; /* make sure code section is null terminated */ if (type_code != comment && type_code != newline && type_code != preesc && type_code != form_feed) parser_state_tos->last_token = type_code; } /* end of main while (1) loop */ } char *set_profile (); void set_defaults (); int set_option (); /* Points to current input file */ char *in_name = 0; /* Points to the name of the output file */ char *out_name = 0; /* How many input files were specified */ int input_files; /* Names of all input files */ char **in_file_names; /* Initial number of input filenames to allocate. */ int max_input_files = 128; #ifdef DEBUG int debug; #endif main (argc, argv) int argc; char **argv; { register int i; struct file_buffer *current_input; char *profile_pathname = 0; int using_stdin = false; #ifdef DEBUG if (debug) debug_init (); #endif init_parser (); initialize_backups (); output = 0; input_files = 0; in_file_names = (char **) xmalloc (max_input_files * sizeof (char *)); set_defaults (); for (i = 1; i < argc; ++i) if (strcmp (argv[i], "-npro") == 0 || strcmp (argv[i], "--ignore-profile") == 0 || strcmp (argv[i], "+ignore-profile") == 0) break; if (i >= argc) profile_pathname = set_profile (); for (i = 1; i < argc; ++i) { if (argv[i][0] != '-' && argv[i][0] != '+') /* Filename */ { if (expect_output_file == true) /* Last arg was "-o" */ { if (out_name != 0) { fprintf (stderr, "indent: only one output file (2nd was %s)\n", argv[i]); exit (1); } if (input_files > 1) { fprintf (stderr, "indent: only one input file when output file is specified\n"); exit (1); } out_name = argv[i]; expect_output_file = false; continue; } else { if (using_stdin) { fprintf (stderr, "indent: can't have filenames when specifying standard input\n"); exit (1); } input_files++; if (input_files > 1) { if (out_name != 0) { fprintf (stderr, "indent: only one input file when output file is specified\n"); exit (1); } if (use_stdout != 0) { fprintf (stderr, "indent: only one input file when stdout is used\n"); exit (1); } if (input_files > max_input_files) { max_input_files = 2 * max_input_files; in_file_names = (char **) xrealloc (in_file_names, (max_input_files * sizeof (char *))); } } in_file_names[input_files - 1] = argv[i]; } } else { /* '-' as filename means stdin. */ if (argv[i][0] == '-' && argv[i][1] == '\0') { if (input_files > 0) { fprintf (stderr, "indent: can't have filenames when specifying standard input\n"); exit (1); } using_stdin = true; } else i += set_option (argv[i], (i < argc ? argv[i + 1] : 0), 1); } } if (verbose && profile_pathname) fprintf (stderr, "Read profile %s\n", profile_pathname); if (input_files > 1) { /* When multiple input files are specified, make a backup copy and then output the indented code into the same filename. */ for (i = 0; input_files; i++, input_files--) { current_input = read_file (in_file_names[i]); in_name = out_name = in_file_names[i]; output = fopen (out_name, "w"); if (output == 0) { fprintf (stderr, "indent: can't create %s\n", out_name); exit (1); } make_backup (current_input); reset_parser (); indent (current_input); if (fclose (output) != 0) sys_error (out_name); } } else { /* One input stream -- specified file, or stdin */ if (input_files == 0 || using_stdin) { input_files = 1; in_file_names[0] = "Standard input"; current_input = read_stdin (); } else /* 1 input file */ { current_input = read_file (in_file_names[0]); if (!out_name && !use_stdout) { out_name = in_file_names[0]; make_backup (current_input); } } in_name = in_file_names[0]; /* Uset stdout if it was specified ("-st"), or neither input nor output file was specified, or we're doing troff. */ if (use_stdout || !out_name || troff) output = stdout; else { output = fopen (out_name, "w"); if (output == 0) { fprintf (stderr, "indent: can't create %s\n", out_name); exit (1); } } reset_parser (); indent (current_input); } exit (0); } indent-2.2.11/regression/standard/embedded-cuddle1.c0000644000177400010010000000012210775646104017173 00000000000000void foo() { #ifdef foo if (1) { } /* if */ { a++; } #endif } indent-2.2.11/regression/standard/newlines.c-10000644000177400010010000000201410775646104016107 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR Now here are some blank lines: IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/box-comm.c0000644000177400010010000000051410775646104015651 00000000000000/*********************************************************************\ This is a test of my style of block comment Sometimes I like to do something like this. \*********************************************************************/ void Hello (void) { printf ("Hello world.\n"); } indent-2.2.11/regression/standard/wrapped-string.c0000644000177400010010000000155710775646104017106 00000000000000#include int main () { char *format = "\ %c %c %c %c %c %c %c %c %c\n"; printf (format, '1', '2', '3', '4', '5', '6', '7', '8', '9'); } static inline void __generic_memcpy_fromfs (void *to, const void *from, unsigned long n) { __asm__ volatile (" cld cmpl $3,%0 jbe 1f movl %%edi,%%ecx negl %%ecx andl $3,%%ecx subl %%ecx,%0 fs; rep; movsb movl %0,%%ecx shrl $2,%%ecx fs; rep; movsl andl $3,%0 1: movl %0,%%ecx fs; rep; movsb"); } static inline void __generic_memcpy_fromfs (void *to, const void *from, unsigned long n) { __asm__ volatile (" cld cmpl $3,%0 jbe 1f movl %%edi,%%ecx negl %%ecx andl $3,%%ecx subl %%ecx,%0 fs; rep; movsb movl %0,%%ecx shrl $2,%%ecx fs; rep; movsl andl $3,%0 1: movl %0,%%ecx fs; rep; movsb":"=abd" (n):"0" (n), "D" ((long) to), "S" ((long) from):"cx", "di", "si", "memory"); } indent-2.2.11/regression/standard/cplus.c-10000644000177400010010000000174010775646104015416 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here is a very long C plus plus comment very long C plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very long C plus plus comment Here is a very long C plus plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/one-line-3.c0000644000177400010010000000012610775646104015775 00000000000000main () { do { bar (33); grop (); } while (1); return -1; } indent-2.2.11/regression/standard/typedef-bug.c0000644000177400010010000000012310775646104016337 00000000000000/* Try indent -st -ncs -TUNCH on this file */ void foo () { char c = (UNCH)1; } indent-2.2.11/regression/standard/newlined-parms.c0000644000177400010010000000004310775646104017052 00000000000000int foo(int a, int *b, char c) { } indent-2.2.11/regression/standard/unknown-type.c0000644000177400010010000000012510775646104016604 00000000000000#include Error_t g (void) { return 0; } Error_t g (void) { return 0; } indent-2.2.11/regression/standard/on-off-1.c0000644000177400010010000000050310775646104015450 00000000000000/* Testing *INDENT-ON* and *INDENT-OFF* controls comments */ // *INDENT-OFF* // *INDENT-ON* main (int argc, char **argv) { char *foo; puts (foo); } /* *INDENT-OFF* */ grunt(int argc, char **argv) { char *foo; puts(foo); } /* *INDENT-ON* */ frobp (int argc, char **argv) { char *foo; puts (foo); } indent-2.2.11/regression/standard/bug-hp.c0000644000177400010010000000007610775646104015315 00000000000000void dblptr_main(void) { double (*valfnc) (const char *); } indent-2.2.11/regression/standard/outer.c-00000644000177400010010000000207610775646104015430 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/indent.h0000644000177400010010000003667710775646104015441 00000000000000 /* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #define BACKSLASH '\\' enum codes { code_eof = 0, /* end of file */ newline, lparen, /* '(' or '['. Also '{' in an initialization. */ rparen, /* ')' or ']'. Also '}' in an initialization. */ unary_op, binary_op, postop, question, casestmt, colon, semicolon, lbrace, rbrace, ident, /* string or char literal, identifier, number */ comma, comment, swstmt, preesc, /* '#'. */ form_feed, decl, sp_paren, /* if, for, or while token */ sp_nparen, ifstmt, whilestmt, forstmt, stmt, stmtl, elselit, dolit, dohead, dostmt, ifhead, elsehead, period }; enum rwcodes { rw_none, rw_break, rw_switch, rw_case, rw_struct_like, /* struct, enum, union */ rw_decl, rw_sp_paren, /* if, while, for */ rw_sp_nparen, /* do, else */ rw_sizeof, rw_return }; #define false 0 #define true 1 /* Name of input file. */ extern char *in_name; extern char *in_prog; /* pointer to the null-terminated input program */ /* Point to the position in the input program which we are currently looking at. */ extern char *in_prog_pos; /* Point to the start of the current line. */ extern char *cur_line; /* Size of the input program, not including the ' \n\0' we add at the end */ extern unsigned int in_prog_size; extern FILE *output; /* the output file */ #define check_code_size \ if (e_code >= l_code) { \ register nsize = l_code-s_code+400; \ codebuf = (char *) realloc(codebuf, nsize); \ e_code = codebuf + (e_code-s_code) + 1; \ l_code = codebuf + nsize - 5; \ s_code = codebuf + 1; \ } #define check_com_size \ if (e_com >= l_com) { \ register nsize = l_com-s_com+400; \ combuf = (char *) realloc(combuf, nsize); \ e_com = combuf + (e_com-s_com) + 1; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ } #define check_lab_size \ if (e_lab >= l_lab) { \ register nsize = l_lab-s_lab+400; \ labbuf = (char *) realloc(labbuf, nsize); \ e_lab = labbuf + (e_lab-s_lab) + 1; \ l_lab = labbuf + nsize - 5; \ s_lab = labbuf + 1; \ } extern char *labbuf; /* buffer for label */ extern char *s_lab; /* start ... */ extern char *e_lab; /* .. and end of stored label */ extern char *l_lab; /* limit of label buffer */ extern char *codebuf; /* buffer for code section */ extern char *s_code; /* start ... */ extern char *e_code; /* .. and end of stored code */ extern char *l_code; /* limit of code section */ extern char *combuf; /* buffer for comments */ extern char *s_com; /* start ... */ extern char *e_com; /* ... and end of stored comments */ extern char *l_com; /* limit of comment buffer */ extern char *buf_ptr; /* ptr to next character to be taken from in_buffer */ extern char *buf_end; /* ptr to first after last char in in_buffer */ /* pointer to the token that lexi() has just found */ extern char *token; /* points to the first char after the end of token */ extern char *token_end; /* Functions from lexi.c */ enum codes lexi (); /* Used to keep track of buffers. */ struct buf { char *ptr; /* points to the start of the buffer */ char *end; /* points to the character beyond the last one (e.g. is equal to ptr if the buffer is empty). */ int size; /* how many chars are currently allocated. */ }; /* Buffer in which to save a comment which occurs between an if(), while(), etc., and the statement following it. Note: the fact that we point into this buffer, and that we might realloc() it (via the need_chars macro) is a bad thing (since when the buffer is realloc'd its address might change, making any pointers into it point to garbage), but since the filling of the buffer (hence the need_chars) and the using of the buffer (where buf_ptr points into it) occur at different times, we can get away with it (it would not be trivial to fix). */ extern struct buf save_com; extern char *bp_save; /* saved value of buf_ptr when taking input from save_com */ extern char *be_save; /* similarly saved value of buf_end */ extern int use_stdout; extern int pointer_as_binop; extern int blanklines_after_declarations; extern int blanklines_before_blockcomments; extern int blanklines_after_procs; extern int blanklines_around_conditional_compilation; extern int swallow_optional_blanklines; extern int n_real_blanklines; extern int prefix_blankline_requested; extern int postfix_blankline_requested; extern int break_comma; /* when true and not in parens, break after a comma */ extern int found_err; /* flag set in diag() on error */ extern int else_or_endif; extern int di_stack_alloc; extern int *di_stack; /* number of spaces to indent braces from the suround if, while, etc. in -bl (bype_2 == 0) code */ extern int brace_indent; extern int btype_2; /* when true, brace should be on same line as if, while, etc */ /* If true, a space is inserted between if, while, or for, and a semicolon for example while (*p++ == ' ') ; */ extern int space_sp_semicolon; /* True if a #else or #endif has been encountered. */ extern int else_or_endif; extern int case_ind; /* indentation level to be used for a "case n:" in spaces */ extern int code_lines; /* count of lines with code */ /* the number of comments processed, set by pr_comment. */ extern int out_coms; extern int out_lines; /* the number of lines written, set by dump_line */ extern int com_lines; /* the number of lines with comments, set by dump_line */ extern int had_eof; /* set to true when input is exhausted */ extern int line_no; /* the current line number. */ extern int max_col; /* the maximum allowable line length */ extern int verbose; /* when true, non-essential error messages are printed */ extern int cuddle_else; /* true if else should cuddle up to '}' */ extern int star_comment_cont; /* true iff comment continuation lines should have stars at the beginning of each line. */ extern int comment_delimiter_on_blankline; extern int troff; /* true iff were generating troff input */ extern int procnames_start_line; /* if true, the names of procedures being defined get placed in column 1 (ie. a newline is placed between the type of the procedure and its name) */ extern int expect_output_file; /* Means "-o" was specified. */ extern int proc_calls_space; /* If true, procedure calls look like: foo (bar) rather than foo(bar) */ extern int cast_space; /* If true, casts look like: r * (char *) bar rather than (char *)bar */ /* If comments which start in column 1 are to be magically reformatted */ extern int format_col1_comments; /* If any comments are to be reformatted */ extern int format_comments; extern int suppress_blanklines; /* set iff following blanklines should be suppressed */ extern int continuation_indent; /* set to the indentation between the edge of code and continuation lines in spaces */ extern int lineup_to_parens; /* if true, continued code within parens will be lined up to the open paren */ extern int leave_preproc_space; /* if true, leave the spaces between '#' and preprocessor commands. */ /* The position that we will line the current line up with when it comes time to print it (if we are lining up to parentheses). */ extern int paren_target; /* true iff a blank should always be inserted after sizeof */ extern int blank_after_sizeof; extern int blanklines_after_declarations_at_proctop; /* This is vaguely similar to blanklines_after_decla rations except that it only applies to the first set of declarations in a procedure (just after the first '{') and it causes a blank line to be generated even if there are no declarations */ extern int block_comment_max_col; extern int extra_expression_indent; /* True if continuation lines from the expression part of "if(e)", "while(e)", "for(e;e;e)" should be indented an extra tab stop so that they don't conflict with the code that follows */ /* The following are all controlled by command line switches (as are some of the things above). */ extern int leave_comma; /* if true, never break declarations after commas */ extern int decl_com_ind; /* the column in which comments after declarations should be put */ extern int case_indent; /* The distance to indent case labels from the switch statement */ extern int com_ind; /* the column in which comments to the right of code should start */ extern int decl_indent; /* column to indent declared identifiers to */ extern int ljust_decl; /* true if declarations should be left justified */ extern int unindent_displace; /* comments not to the right of code will be placed this many indentation levels to the left of code */ extern int else_if; /* True iff else if pairs should be handled specially */ /* Number of spaces to indent parameters. */ extern int indent_parameters; /* The size of one indentation level in spaces. */ extern int ind_size; /* The number of columns a tab character generates. */ extern int tabsize; /* Nonzero if we should use standard input/output when files are not explicitly specified. */ extern int use_stdinout; /* -troff font state information */ struct fstate { char font[4]; char size; int allcaps:1; }; char *chfont (); extern struct fstate keywordf, /* keyword font */ stringf, /* string font */ boxcomf, /* Box comment font */ blkcomf, /* Block comment font */ scomf, /* Same line comment font */ bodyf; /* major body font */ /* This structure contains information relating to the state of parsing the code. The difference is that the state is saved on #if and restored on #else. */ struct parser_state { struct parser_state *next; enum codes last_token; struct fstate cfont; /* Current font */ /* This is the parsers stack, and the current allocated size. */ enum codes *p_stack; int p_stack_size; /* This stack stores indentation levels */ /* Currently allocated size is stored in p_stack_size. */ int *il; /* If the last token was an ident and is a reserved word, remember the type. */ enum rwcodes last_rw; /* Used to store case stmt indentation levels. */ /* Currently allocated size is stored in p_stack_size. */ int *cstk; /* Pointer to the top of stack of the p_stack, il and cstk arrays. */ int tos; int box_com; /* set to true when we are in a "boxed" comment. In that case, the first non-blank char should be lined up with the / in /* */ /* Shift comments by this many columns. */ int comment_delta; /* Value of comment_delta for the following line. */ int n_comment_delta; int cast_mask; /* indicates which close parens close off casts */ /* A bit for each paren level, set if the open paren was in a context which indicates that this pair of parentheses is not a cast. */ int noncast_mask; int sizeof_mask; /* indicates which close parens close off sizeof''s */ int block_init; /* true iff inside a block initialization */ int block_init_level; /* The level of brace nesting in an initialization */ int last_nl; /* this is true if the last thing scanned was a newline */ int in_or_st; /* Will be true iff there has been a declarator (e.g. int or char) and no left paren since the last semicolon. When true, a '{' is starting a structure definition or an initialization list */ int bl_line; /* set to 1 by dump_line if the line is blank */ int col_1; /* set to true if the last token started in column 1 */ int com_col; /* this is the column in which the current coment should start */ int dec_nest; /* current nesting level for structure or init */ int decl_on_line; /* set to true if this line of code has part of a declaration on it */ int i_l_follow; /* the level in spaces to which ind_level should be set after the current line is printed */ int in_decl; /* set to true when we are in a declaration stmt. The processing of braces is then slightly different */ int in_stmt; /* set to 1 while in a stmt */ int ind_level; /* the current indentation level in spaces */ int ind_stmt; /* set to 1 if next line should have an extra indentation level because we are in the middle of a stmt */ int last_u_d; /* set to true after scanning a token which forces a following operator to be unary */ int p_l_follow; /* used to remember how to indent following statement */ int paren_level; /* parenthesization level. used to indent within stmts */ int paren_depth; /* Depth of paren nesting anywhere. */ /* Column positions of paren at each level. If positive, it contains just the number of characters of code on the line up to and including the right parenthesis character. If negative, it contains the opposite of the actual level of indentation in characters (that is, the indentation of the line has been added to the number of characters and the sign has been reversed to indicate that this has been done). */ short *paren_indents; /* column positions of each paren */ int paren_indents_size; /* Currently allocated size. */ int pcase; /* set to 1 if the current line label is a case. It is printed differently from a regular label */ int search_brace; /* set to true by parse when it is necessary to buffer up all info up to the start of a stmt after an if, while, etc */ int use_ff; /* set to one if the current line should be terminated with a form feed */ int want_blank; /* set to true when the following token should be prefixed by a blank. (Said prefixing is ignored in some cases.) */ int its_a_keyword; int sizeof_keyword; int dumped_decl_indent; int in_parameter_declaration; char *procname; /* The name of the current procedure */ char *procname_end; /* One char past the last one in procname */ int just_saw_decl; }; /* All manipulations of the parser state occur at the top of stack (tos). A stack is kept for conditional compilation (unrelated to the p_stack, il, & cstk stacks)--it is implemented as a linked list via the next field. */ extern struct parser_state *parser_state_tos; /* The column in which comments to the right of #else and #endif should start. */ extern int else_endif_col; indent-2.2.11/regression/standard/bug-npsl.c0000644000177400010010000000311010775646104015652 00000000000000void foo () /* */ /* This */ /* is in */ /* the same */ /* column */ /* */ /* */ { } void bar () /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ { } indent-2.2.11/regression/standard/comments3.c0000644000177400010010000000075510775646104016047 00000000000000void foo() { if (( #if 1 /* * REMOVE THIS after all servers upgraded to 2.10.01 and * Uworld uses a numeric too */ (strlen(parv[1]) != 1 && !(acptr = FindClient(parv[1])))) || (strlen(parv[1]) == 1 && #endif 1)) { } if ((!IsServer(cptr)) && isNickJuped(nick)) { sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* parv[0] is empty when connecting */ BadPtr(parv[0]) ? "*" : parv[0], nick); return 0; /* NICK message ignored */ } } indent-2.2.11/regression/standard/cplus.c-40000644000177400010010000000175210775646104015424 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here is a very long C plus plus comment very long C plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very long C plus plus comment Here is a very long C plus plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/func-def.c0000644000177400010010000000007410775646104015620 00000000000000void a (int x, int y, int z); void b (int x, int y, int z); indent-2.2.11/regression/standard/brackets37.c0000644000177400010010000000050710775646104016102 00000000000000void foo () { if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) mask = NULL; if ((acptr = FindUser (nick)) && ((!(bitsel & WHOSELECT_OPER)) || IsAnOper (acptr)) && Process (acptr) && SHOW_MORE (sptr, counter)) mask = NULL; } indent-2.2.11/regression/standard/boxed.c-10000644000177400010010000000450610775646104015374 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/backup.c0000644000177400010010000002072010775646104015376 00000000000000 /* backup.c -- make Emacs style backup file names Copyright (C) 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it without restriction. 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. GNU/Emacs style backups -- This behaviour is controlled by two environment variables, VERSION_CONTROL and SIMPLE_BACKUP_SUFFIX. VERSION_CONTROL determines what kinds of backups are made. If it's value is "numbered", then the first modification of some file "eraserhead.c" will yield a backup file "eraserhead.c.~1~", the second modification will yield "eraserhead.c.~2~", and so on. It does not matter if the version numbers are not a sequence; the next version will be one greater than the highest in that directory. If the value of VERSION_CONTROL is "numbered_existing", then such numbered backups will be made if there are already numbered backup versions of the file. Otherwise, the backup name will be that of the original file with "~" (tilde) appended. E.g., "eraserhead.c~". If the value of VERSION_CONTROL is "simple", then the backup name will be that of the original file with "~" appended, regardless of whether or not there exist numbered versions in the directory. For simple backups, the value of SIMPLE_BACKUP_SUFFIX will be used rather than "~" if it is set. If VERSION_CONTROL is unset, "numbered_existing" is assumed. For Emacs lovers, "nil" is equivalent to "numbered_existing" and "t" is equivalent to "numbered". Finally, if VERSION_CONTROL is "none" or "never", backups are not made. I suggest you avoid this behaviour. */ /* Written by jla, based on code from djm (see `patch') */ #include "backup.h" #include "sys.h" #include #ifndef isascii #define ISDIGIT(c) (isdigit ((unsigned char) (c))) #else #define ISDIGIT(c) (isascii (c) && isdigit (c)) #endif #ifndef NODIR #include #ifdef DIRENT #include #ifdef direct #undef direct #endif #define direct dirent #define NLENGTH(direct) (strlen((direct)->d_name)) #else /* !DIRENT */ #define NLENGTH(direct) ((direct)->d_namlen) #ifdef USG #ifdef SYSNDIR #include #else /* !SYSNDIR */ #include #endif /* !SYSNDIR */ #else /* !USG */ #include #endif /* !USG */ #endif /* !DIRENT */ #if defined (HAVE_UNISTD_H) #include #endif #if defined (_POSIX_VERSION) /* Might be defined in unistd.h. */ /* POSIX does not require that the d_ino field be present, and some systems do not provide it. */ #define REAL_DIR_ENTRY(dp) 1 #else #define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0) #endif #else /* NODIR */ #define generate_backup_filename(v,f) simple_backup_name((f)) #endif /* NODIR */ /* Default backup file suffix to use */ char *simple_backup_suffix = "~"; /* What kinds of backup files to make -- see table `version_control_values' below. */ enum backup_mode version_control = unknown; /* Construct a simple backup name for PATHNAME by appending the value of `simple_backup_suffix'. */ static char * simple_backup_name (pathname) char *pathname; { char *backup_name; backup_name = xmalloc (strlen (pathname) + strlen (simple_backup_suffix) + 2); sprintf (backup_name, "%s%s", pathname, simple_backup_suffix); return backup_name; } #ifndef NODIR /* If DIRENTRY is a numbered backup version of file BASE, return that number. BASE_LENGTH is the string length of BASE. */ static int version_number (base, direntry, base_length) char *base; char *direntry; int base_length; { int version; char *p; version = 0; if (!strncmp (base, direntry, base_length) && ISDIGIT (direntry[base_length + 2])) { for (p = &direntry[base_length + 2]; ISDIGIT (*p); ++p) version = version * 10 + *p - '0'; if (p[0] != '~' || p[1]) version = 0; } return version; } /* Return the highest version of file FILENAME in directory DIRNAME. Return 0 if there are no numbered versions. */ static int highest_version (filename, dirname) char *filename, *dirname; { DIR *dirp; struct direct *dp; int highest_version; int this_version; int file_name_length; dirp = opendir (dirname); if (!dirp) return 0; highest_version = 0; file_name_length = strlen (filename); while ((dp = readdir (dirp)) != 0) { if (!REAL_DIR_ENTRY (dp) || NLENGTH (dp) <= file_name_length + 2) continue; this_version = version_number (filename, dp->d_name, file_name_length); if (this_version > highest_version) highest_version = this_version; } closedir (dirp); return highest_version; } /* Return the highest version number for file PATHNAME. If there are no backups, or only a simple backup, return 0. */ static int max_version (pathname) char *pathname; { register char *p; register char *filename; int pathlen = strlen (pathname); int version; p = pathname + pathlen - 1; while (p > pathname && *p != '/') p--; if (*p == '/') { int dirlen = p - pathname; register char *dirname; filename = p + 1; dirname = xmalloc (dirlen + 1); strncpy (dirname, pathname, (dirlen)); dirname[dirlen] = '\0'; version = highest_version (filename, dirname); free (dirname); return version; } filename = pathname; version = highest_version (filename, "."); return version; } /* Generate a backup filename for PATHNAME, dependent on the value of VERSION_CONTROL. */ static char * generate_backup_filename (version_control, pathname) enum backup_mode version_control; char *pathname; { int last_numbered_version; char *backup_name; if (version_control == none) return 0; if (version_control == simple) return simple_backup_name (pathname); last_numbered_version = max_version (pathname); if (version_control == numbered_existing && last_numbered_version == 0) return simple_backup_name (pathname); last_numbered_version++; backup_name = xmalloc (strlen (pathname) + 16); if (!backup_name) return 0; sprintf (backup_name, "%s.~%d~", pathname, last_numbered_version); return backup_name; } #endif /* !NODIR */ static struct version_control_values values[] = { {none, "never"}, /* Don't make backups. */ {simple, "simple"}, /* Only simple backups */ {numbered_existing, "existing"}, /* Numbered if they already exist */ {numbered_existing, "nil"}, /* Ditto */ {numbered, "numbered"}, /* Numbered backups */ {numbered, "t"}, /* Ditto */ {unknown, 0} /* Initial, undefined value. */ }; extern char *getenv (); /* Determine the value of `version_control' by looking in the environment variable "VERSION_CONTROL". Defaults to numbered_existing. */ enum backup_mode version_control_value () { char *version; struct version_control_values *v; version = getenv ("VERSION_CONTROL"); if (version == 0 || *version == 0) return numbered_existing; v = &values[0]; while (v->name) { if (strcmp (version, v->name) == 0) return v->value; v++; } return unknown; } /* Initialize information used in determining backup filenames. */ void initialize_backups () { char *v = getenv ("SIMPLE_BACKUP_SUFFIX"); if (v && *v) simple_backup_suffix = v; #ifdef NODIR version_control = simple; #else /* !NODIR */ version_control = version_control_value (); if (version_control == unknown) { fprintf (stderr, "indent: Strange version-control value\n"); fprintf (stderr, "indent: Using numbered-existing\n"); version_control = numbered_existing; } #endif /* !NODIR */ } /* Prints an error message using `perror' */ extern void sys_error (); /* Make a backup copy of FILE, taking into account version-control. See the description at the beginning of the file for details. */ void make_backup (file) struct file_buffer *file; { int fd; register char *p = file->name + strlen (file->name) - 1; char *backup_filename; char *new_backup_name; backup_filename = generate_backup_filename (version_control, file->name); if (!backup_filename) { fprintf (stderr, "indent: Can't make backup filename of %s", file->name); exit (1); } fd = creat (backup_filename, 0666); if (fd < 0) sys_error (backup_filename); if (write (fd, file->data, file->size) != file->size) sys_error (backup_filename); close (fd); free (backup_filename); } indent-2.2.11/regression/standard/kr.c0000644000177400010010000000020410775646104014540 00000000000000#include struct { int x; int y; } z; main() { struct { int x; int y; } z; z.x = 1; z.y = 2; } indent-2.2.11/regression/standard/do-cdw.c0000644000177400010010000000015610775646104015307 00000000000000foo () { do { b = getchar (); } while (b != 0xff); do b = getchar (); while (b != 0xff); } indent-2.2.11/regression/standard/right-margin-comment.c0000644000177400010010000000010110775646104020150 00000000000000int i; /* this comment is just too long for one line */ indent-2.2.11/regression/standard/outer.c-30000644000177400010010000000207110775646104015426 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/fp.c0000644000177400010010000000042510775646104014536 00000000000000int (*fp ()) (); register void (*GCForward) () asm ("r16"); /* GC Forwarding code */ main () { switch (fork ()) { default: break; } } int * function_2 (var) int var; { int *var_1_0; var_1_0 = (int *) make_shape_1d (var); return (var_1_0); } indent-2.2.11/regression/standard/args.c0000644000177400010010000006135411145774471015076 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Argument scanning and profile reading code. Default parameters are set here as well. */ #include "sys.h" #include "indent.h" #include #include "version.h" int else_endif_col; extern char *in_name; char *getenv (); /* profile types */ enum profile { PRO_BOOL, /* boolean */ PRO_INT, /* integer */ PRO_FONT, /* troff font */ PRO_IGN, /* ignore it */ PRO_KEY, /* -T switch */ PRO_SETTINGS, /* bundled set of settings */ PRO_PRSTRING /* Print string and exit */ }; /* profile specials for booleans */ enum on_or_off { ONOFF_NA, /* Not applicable. Used in table for non-booleans. */ OFF, /* This option turns on the boolean variable in question. */ ON /* it turns it off */ }; /* Explicit flags for each option. */ static int exp_T = 0; static int exp_bacc = 0; static int exp_badp = 0; static int exp_bad = 0; static int exp_bap = 0; static int exp_bbb = 0; static int exp_bc = 0; static int exp_bli = 0; static int exp_bl = 0; static int exp_bs = 0; static int exp_cdb = 0; static int exp_cd = 0; static int exp_ce = 0; static int exp_ci = 0; static int exp_cli = 0; static int exp_cp = 0; static int exp_cs = 0; static int exp_c = 0; static int exp_di = 0; static int exp_dj = 0; static int exp_d = 0; static int exp_eei = 0; static int exp_ei = 0; static int exp_fbc = 0; static int exp_fbx = 0; static int exp_fb = 0; static int exp_fc1 = 0; static int exp_fca = 0; static int exp_fc = 0; static int exp_fk = 0; static int exp_fs = 0; static int exp_gnu = 0; static int exp_orig = 0; static int exp_ip = 0; static int exp_nip = 0; static int exp_i = 0; static int exp_lc = 0; static int exp_lp = 0; static int exp_l = 0; static int exp_lps = 0; static int exp_pcs = 0; static int exp_psl = 0; static int exp_pro = 0; static int exp_ps = 0; static int exp_kr = 0; static int exp_sc = 0; static int exp_sob = 0; static int exp_ss = 0; static int exp_st = 0; static int exp_troff = 0; static int exp_ts = 0; static int exp_v = 0; static int exp_version = 0; /* The following variables are controlled by command line parameters and their meaning is explained in indent.h. */ int leave_comma; int decl_com_ind; int case_indent; int com_ind; int decl_indent; int ljust_decl; int unindent_displace; int else_if; int indent_parameters; int ind_size; int tabsize; int blanklines_after_procs; int use_stdout; int pointer_as_binop; int blanklines_after_declarations; int blanklines_before_blockcomments; int blanklines_around_conditional_compilation; int swallow_optional_blanklines; int n_real_blanklines; int prefix_blankline_requested; int postfix_blankline_requested; int brace_indent; int btype_2; int space_sp_semicolon; int case_ind; int max_col; int verbose; int cuddle_else; int star_comment_cont; int comment_delimiter_on_blankline; int troff; int procnames_start_line; int proc_calls_space; int cast_space; int format_col1_comments; int format_comments; int continuation_indent; int lineup_to_parens; int leave_preproc_space; int blank_after_sizeof; int blanklines_after_declarations_at_proctop; int block_comment_max_col; int extra_expression_indent; int expect_output_file; /* N.B.: because of the way the table here is scanned, options whose names are substrings of other options must occur later; that is, with -lp vs -l, -lp must be first. Also, while (most) booleans occur more than once, the last default value is the one actually assigned. */ struct pro { char *p_name; /* name, eg -bl, -cli */ enum profile p_type; int p_default; /* the default value (if int) */ /* If p_type == PRO_BOOL, ON or OFF to tell how this switch affects the variable. Not used for other p_type's. */ enum on_or_off p_special; /* if p_type == PRO_SETTINGS, a (char *) pointing to a list of the switches to set, separated by NULs, terminated by 2 NULs. if p_type == PRO_BOOL, PRO_INT, or PRO_FONT, address of the variable that gets set by the option. if p_type == PRO_PRSTRING, a (char *) pointing to the string. */ int *p_obj; /* Points to a nonzero value (allocated statically for all options) if the option has been specified explicitly. This is necessary because for boolean options, the options to set and reset the variable must share the explicit flag. */ int *p_explicit; }; #ifdef BERKELEY_DEFAULTS /* Settings for original defaults */ struct pro pro[] = { {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation, &exp_bacc}, {"badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop, &exp_badp}, {"bad", PRO_BOOL, false, ON, &blanklines_after_declarations, &exp_bad}, {"bap", PRO_BOOL, false, ON, &blanklines_after_procs, &exp_bap}, {"bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments, &exp_bbb}, {"bc", PRO_BOOL, true, OFF, &leave_comma, &exp_bc}, {"bli", PRO_INT, 0, ONOFF_NA, &brace_indent, &exp_bli}, {"bl", PRO_BOOL, true, OFF, &btype_2, &exp_bl}, {"br", PRO_BOOL, true, ON, &btype_2, &exp_bl}, {"bs", PRO_BOOL, false, ON, &blank_after_sizeof, &exp_bs}, {"cdb", PRO_BOOL, true, ON, &comment_delimiter_on_blankline, &exp_cdb}, {"cd", PRO_INT, 33, ONOFF_NA, &decl_com_ind, &exp_cd}, {"ce", PRO_BOOL, true, ON, &cuddle_else, &exp_ce}, {"ci", PRO_INT, 4, ONOFF_NA, &continuation_indent, &exp_ci}, {"cli", PRO_INT, 0, ONOFF_NA, &case_indent, &exp_cli}, {"cp", PRO_INT, 33, ONOFF_NA, &else_endif_col, &exp_cp}, {"cs", PRO_BOOL, true, ON, &cast_space, &exp_cs}, {"c", PRO_INT, 33, ONOFF_NA, &com_ind, &exp_c}, {"di", PRO_INT, 16, ONOFF_NA, &decl_indent, &exp_di}, {"dj", PRO_BOOL, false, ON, &ljust_decl, &exp_dj}, {"d", PRO_INT, 0, ONOFF_NA, &unindent_displace, &exp_d}, {"eei", PRO_BOOL, false, ON, &extra_expression_indent, &exp_eei}, {"ei", PRO_BOOL, true, ON, &else_if, &exp_ei}, {"fbc", PRO_FONT, 0, ONOFF_NA, (int *) &blkcomf, &exp_fbc}, {"fbx", PRO_FONT, 0, ONOFF_NA, (int *) &boxcomf, &exp_fbx}, {"fb", PRO_FONT, 0, ONOFF_NA, (int *) &bodyf, &exp_fb}, {"fc1", PRO_BOOL, true, ON, &format_col1_comments, &exp_fc1}, {"fca", PRO_BOOL, true, ON, &format_comments, &exp_fca}, {"fc", PRO_FONT, 0, ONOFF_NA, (int *) &scomf, &exp_fc}, {"fk", PRO_FONT, 0, ONOFF_NA, (int *) &keywordf, &exp_fk}, {"fs", PRO_FONT, 0, ONOFF_NA, (int *) &stringf, &exp_fs}, {"gnu", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-bl\0-ncdb\0-cs\0-nce\0-di2\0-ndj\0\ -ei\0-nfc1\0-i2\0-ip5\0-lp\0-pcs\0-nps\0-psl\0-nsc\0-nsob\0-bli2\0\ -cp1\0-nfca\0", &exp_gnu}, {"ip", PRO_INT, 4, ON, &indent_parameters, &exp_ip}, {"i", PRO_INT, 4, ONOFF_NA, &ind_size, &exp_i}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-br\0-c33\0-cd33\0-ncdb\0-ce\0\ -ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i4\0-ip0\0-l75\0-lp\0-npcs\0-npsl\0-cs\0\ -nsc\0-nsc\0-nsob\0-nfca\0-cp33\0-nss\0", &exp_kr}, {"lc", PRO_INT, 0, ONOFF_NA, &block_comment_max_col, &exp_lc}, {"lps", PRO_BOOL, true, ON, &leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens, &exp_lp}, {"l", PRO_INT, 78, ONOFF_NA, &max_col, &exp_l}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation, &exp_bacc}, {"nbadp", PRO_BOOL, false, OFF, &blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations, &exp_bad}, {"nbap", PRO_BOOL, false, OFF, &blanklines_after_procs, &exp_bap}, {"nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments, &exp_bbb}, {"nbc", PRO_BOOL, true, ON, &leave_comma, &exp_bc}, {"nbs", PRO_BOOL, false, OFF, &blank_after_sizeof, &exp_bs}, {"ncdb", PRO_BOOL, true, OFF, &comment_delimiter_on_blankline, &exp_cdb}, {"nce", PRO_BOOL, true, OFF, &cuddle_else, &exp_ce}, {"ncs", PRO_BOOL, true, OFF, &cast_space, &exp_cs}, {"ndj", PRO_BOOL, false, OFF, &ljust_decl, &exp_dj}, {"neei", PRO_BOOL, false, OFF, &extra_expression_indent, &exp_eei}, {"nei", PRO_BOOL, true, OFF, &else_if, &exp_ei}, {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments, &exp_fc1}, {"nfca", PRO_BOOL, true, OFF, &format_comments, &exp_fca}, {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0", &exp_nip}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens, &exp_lp}, {"npcs", PRO_BOOL, false, OFF, &proc_calls_space, &exp_pcs}, {"npro", PRO_IGN, 0, ONOFF_NA, 0, &exp_pro}, {"npsl", PRO_BOOL, true, OFF, &procnames_start_line, &exp_psl}, {"nps", PRO_BOOL, false, OFF, &pointer_as_binop, &exp_ps}, {"nsc", PRO_BOOL, true, OFF, &star_comment_cont, &exp_sc}, {"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines, &exp_sob}, {"nss", PRO_BOOL, false, OFF, &space_sp_semicolon, &exp_ss}, {"nv", PRO_BOOL, false, OFF, &verbose, &exp_v}, {"o", PRO_BOOL, false, ON, &expect_output_file, &expect_output_file}, {"pcs", PRO_BOOL, false, ON, &proc_calls_space, &exp_pcs}, {"psl", PRO_BOOL, true, ON, &procnames_start_line, &exp_psl}, {"ps", PRO_BOOL, false, ON, &pointer_as_binop, &exp_ps}, {"sc", PRO_BOOL, true, ON, &star_comment_cont, &exp_sc}, {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines, &exp_sob}, {"ss", PRO_BOOL, false, ON, &space_sp_semicolon, &exp_ss}, {"st", PRO_BOOL, false, ON, &use_stdout, &exp_st}, {"troff", PRO_BOOL, false, ON, &troff, &exp_troff}, {"ts", PRO_INT, 8, ONOFF_NA, &tabsize, &exp_ts}, {"version", PRO_PRSTRING, 0, ONOFF_NA, (int *) VERSION_STRING, &exp_version}, {"v", PRO_BOOL, false, ON, &verbose, &exp_v}, /* Signify end of structure. */ {0, PRO_IGN, 0, ONOFF_NA, 0, 0} }; #else /* Default to GNU style */ /* Changed to make GNU style the default. */ struct pro pro[] = { {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation, &exp_bacc}, {"badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop, &exp_badp}, {"bad", PRO_BOOL, false, ON, &blanklines_after_declarations, &exp_bad}, {"bap", PRO_BOOL, true, ON, &blanklines_after_procs, &exp_bap}, {"bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments, &exp_bbb}, {"bc", PRO_BOOL, true, OFF, &leave_comma, &exp_bc}, {"bli", PRO_INT, 2, ONOFF_NA, &brace_indent, &exp_bli}, {"bl", PRO_BOOL, true, OFF, &btype_2, &exp_bl}, {"br", PRO_BOOL, false, ON, &btype_2, &exp_bl}, {"bs", PRO_BOOL, false, ON, &blank_after_sizeof, &exp_bs}, {"cdb", PRO_BOOL, false, ON, &comment_delimiter_on_blankline, &exp_cdb}, {"cd", PRO_INT, 33, ONOFF_NA, &decl_com_ind, &exp_cd}, {"ce", PRO_BOOL, false, ON, &cuddle_else, &exp_ce}, {"ci", PRO_INT, 0, ONOFF_NA, &continuation_indent, &exp_ci}, {"cli", PRO_INT, 0, ONOFF_NA, &case_indent, &exp_cli}, {"cp", PRO_INT, 1, ONOFF_NA, &else_endif_col, &exp_cp}, {"cs", PRO_BOOL, true, ON, &cast_space, &exp_cs}, {"c", PRO_INT, 33, ONOFF_NA, &com_ind, &exp_c}, {"di", PRO_INT, 2, ONOFF_NA, &decl_indent, &exp_di}, {"dj", PRO_BOOL, false, ON, &ljust_decl, &exp_dj}, {"d", PRO_INT, 0, ONOFF_NA, &unindent_displace, &exp_d}, {"eei", PRO_BOOL, false, ON, &extra_expression_indent, &exp_eei}, {"ei", PRO_BOOL, true, ON, &else_if, &exp_ei}, {"fbc", PRO_FONT, 0, ONOFF_NA, (int *) &blkcomf, &exp_fbc}, {"fbx", PRO_FONT, 0, ONOFF_NA, (int *) &boxcomf, &exp_fbx}, {"fb", PRO_FONT, 0, ONOFF_NA, (int *) &bodyf, &exp_fb}, {"fc1", PRO_BOOL, true, ON, &format_col1_comments, &exp_fc1}, {"fca", PRO_BOOL, false, ON, &format_comments, &exp_fca}, {"fc", PRO_FONT, 0, ONOFF_NA, (int *) &scomf, &exp_fc}, {"fk", PRO_FONT, 0, ONOFF_NA, (int *) &keywordf, &exp_fk}, {"fs", PRO_FONT, 0, ONOFF_NA, (int *) &stringf, &exp_fs}, /* This is now the default. */ {"gnu", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-bl\0-ncdb\0-cs\0-nce\0-di2\0-ndj\0\ -ei\0-nfc1\0-i2\0-ip5\0-lp\0-pcs\0-nps\0-psl\0-nsc\0-nsob\0-bli4\0\ -cp1\0-nfca\0", &exp_gnu}, {"ip", PRO_INT, 5, ON, &indent_parameters, &exp_ip}, {"i", PRO_INT, 2, ONOFF_NA, &ind_size, &exp_i}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-br\0-c33\0-cd33\0-ncdb\0-ce\0\ -ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i4\0-ip0\0-l75\0-lp\0-npcs\0-npsl\0-cs\0\ -nsc\0-nsc\0-nsob\0-nfca\0-cp33\0-nss\0", &exp_kr}, {"lc", PRO_INT, 0, ONOFF_NA, &block_comment_max_col, &exp_lc}, {"lps", PRO_BOOL, true, ON, &leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens, &exp_lp}, {"l", PRO_INT, 78, ONOFF_NA, &max_col, &exp_l}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation, &exp_bacc}, {"nbadp", PRO_BOOL, false, OFF, &blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations, &exp_bad}, {"nbap", PRO_BOOL, true, OFF, &blanklines_after_procs, &exp_bap}, {"nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments, &exp_bbb}, {"nbc", PRO_BOOL, true, ON, &leave_comma, &exp_bc}, {"nbs", PRO_BOOL, false, OFF, &blank_after_sizeof, &exp_bs}, {"ncdb", PRO_BOOL, false, OFF, &comment_delimiter_on_blankline, &exp_cdb}, {"nce", PRO_BOOL, false, OFF, &cuddle_else, &exp_ce}, {"ncs", PRO_BOOL, true, OFF, &cast_space, &exp_cs}, {"ndj", PRO_BOOL, false, OFF, &ljust_decl, &exp_dj}, {"neei", PRO_BOOL, false, OFF, &extra_expression_indent, &exp_eei}, {"nei", PRO_BOOL, true, OFF, &else_if, &exp_ei}, {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments, &exp_fc1}, {"nfca", PRO_BOOL, false, OFF, &format_comments, &exp_fca}, {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0\0", &exp_nip}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens, &exp_lp}, {"npcs", PRO_BOOL, true, OFF, &proc_calls_space, &exp_pcs}, {"npro", PRO_IGN, 0, ONOFF_NA, 0, &exp_pro}, {"npsl", PRO_BOOL, true, OFF, &procnames_start_line, &exp_psl}, {"nps", PRO_BOOL, false, OFF, &pointer_as_binop, &exp_ps}, {"nsc", PRO_BOOL, false, OFF, &star_comment_cont, &exp_sc}, {"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines, &exp_sob}, {"nss", PRO_BOOL, false, OFF, &space_sp_semicolon, &exp_ss}, {"nv", PRO_BOOL, false, OFF, &verbose, &exp_v}, {"orig", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbap\0-nbad\0-nbbb\0-bc\0-br\0-c33\0-cd33\0-cdb\0-ce\0-ci4\0\ -cli0\0-cp33\0-di16\0-fc1\0-fca\0-i4\0-ip4\0-l75\0-lp\0\ -npcs\0-psl\0-sc\0-nsob\0-nss\0-ts8\0", &exp_orig}, {"o", PRO_BOOL, false, ON, &expect_output_file, &expect_output_file}, {"pcs", PRO_BOOL, true, ON, &proc_calls_space, &exp_pcs}, {"psl", PRO_BOOL, true, ON, &procnames_start_line, &exp_psl}, {"ps", PRO_BOOL, false, ON, &pointer_as_binop, &exp_ps}, {"sc", PRO_BOOL, false, ON, &star_comment_cont, &exp_sc}, {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines, &exp_sob}, {"ss", PRO_BOOL, false, ON, &space_sp_semicolon, &exp_ss}, {"st", PRO_BOOL, false, ON, &use_stdout, &exp_st}, {"troff", PRO_BOOL, false, ON, &troff, &exp_troff}, {"ts", PRO_INT, 8, ONOFF_NA, &tabsize, &exp_ts}, {"version", PRO_PRSTRING, 0, ONOFF_NA, (int *) VERSION_STRING, &exp_version}, {"v", PRO_BOOL, false, ON, &verbose, &exp_v}, /* Signify end of structure. */ {0, PRO_IGN, 0, ONOFF_NA, 0, 0} }; #endif /* GNU defaults */ struct long_option_conversion { char *long_name; char *short_name; }; struct long_option_conversion option_conversions[] = { {"blank-lines-after-ifdefs", "bacc"}, {"blank-lines-after-procedure-declarations", "badp"}, {"blank-lines-after-declarations", "bad"}, {"blank-lines-after-procedures", "bap"}, {"blank-lines-after-block-comments", "bbb"}, {"blank-lines-after-commas", "bc"}, {"brace-indent", "bli"}, {"braces-after-if-line", "bl"}, {"braces-on-if-line", "br"}, {"Bill-Shannon", "bs"}, {"blank-before-sizeof", "bs"}, {"comment-delimiters-on-blank-lines", "cdb"}, {"declaration-comment-column", "cd"}, {"cuddle-else", "ce"}, {"continuation-indentation", "ci"}, {"case-indentation", "cli"}, {"else-endif-column", "cp"}, {"space-after-cast", "cs"}, {"comment-indentation", "c"}, {"declaration-indentation", "di"}, {"left-justify-declarations", "dj"}, {"line-comments-indentation", "d"}, {"extra-expression-indentation", "eei"}, {"else-if", "ei"}, {"*", "fbc"}, {"*", "fbx"}, {"*", "fb"}, {"format-first-column-comments", "fc1"}, {"format-all-comments", "fca"}, {"*", "fc"}, {"*", "fk"}, {"*", "fs"}, {"gnu-style", "gnu"}, {"parameter-indentation", "ip"}, {"indentation-level", "i"}, {"indent-level", "i"}, {"k-and-r-style", "kr"}, {"kernighan-and-ritchie-style", "kr"}, {"kernighan-and-ritchie", "kr"}, {"*", "lc"}, {"continue-at-parentheses", "lp"}, {"leave-preprocessor-space", "lps"}, {"line-length", "l"}, {"no-blank-lines-after-ifdefs", "nbacc"}, {"no-blank-lines-after-procedure-declarations", "nbadp"}, {"no-blank-lines-after-declarations", "nbad"}, {"no-blank-lines-after-procedures", "nbap"}, {"no-blank-lines-after-block-comments", "nbbb"}, {"no-blank-lines-after-commas", "nbc"}, {"no-Bill-Shannon", "nbs"}, {"no-blank-before-sizeof", "nbs"}, {"no-comment-delimiters-on-blank-lines", "ncdb"}, {"dont-cuddle-else", "nce"}, {"no-space-after-casts", "ncs"}, {"dont-left-justify-declarations", "ndj"}, {"no-extra-expression-indentation", "neei"}, {"no-else-if", "nei"}, {"dont-format-first-column-comments", "nfc1"}, {"dont-format-comments", "nfca"}, {"no-parameter-indentation", "nip"}, {"dont-indent-parameters", "nip"}, {"dont-line-up-parentheses", "nlp"}, {"no-space-after-function-call-names", "npcs"}, {"ignore-profile", "npro"}, {"dont-break-procedure-type", "npsl"}, {"*", "nps"}, {"dont-star-comments", "nsc"}, {"leave-optional-blank-lines", "nsob"}, {"dont-space-special-semicolon", "nss"}, {"no-verbosity", "nv"}, {"output", "o"}, {"output-file", "o"}, {"original", "orig"}, {"original-style", "orig"}, {"berkeley-style", "orig"}, {"berkeley", "orig"}, {"space-after-procedure-calls", "pcs"}, {"procnames-start-lines", "psl"}, {"pointer-as-binary-op", "ps"}, {"start-left-side-of-comments", "sc"}, {"swallow-optional-blank-lines", "sob"}, {"space-special-semicolon", "ss"}, {"standard-output", "st"}, {"troff-formatting", "troff"}, {"tab-size", "ts"}, {"version", "version"}, {"verbose", "v"}, {0, 0}, }; /* S1 should be a string. S2 should be a string, perhaps followed by an argument. Compare the two, returning true if they are equal, and if they are equal set *START_PARAM to point to the argument in S2. */ static int eqin (s1, s2, start_param) register char *s1; register char *s2; char **start_param; { while (*s1) { if (*s1++ != *s2++) return (false); } *start_param = s2; return (true); } /* Set the defaults. */ void set_defaults () { register struct pro *p; for (p = pro; p->p_name; p++) if (p->p_type == PRO_BOOL || p->p_type == PRO_INT) *p->p_obj = p->p_default; } /* Stings which can prefix an option, longest first. */ static char *option_prefixes[] = { "--", "-", "+", 0 }; static int option_prefix (arg) char *arg; { register char **prefixes = option_prefixes; register char *this_prefix, *argp; do { this_prefix = *prefixes; argp = arg; while (*this_prefix == *argp) { this_prefix++; argp++; } if (*this_prefix == '\0') return this_prefix - *prefixes; } while (*++prefixes); return 0; } /* Process an option ARG (e.g. "-l60"). EXPLICIT should be nonzero iff the argument is being explicitly specified (as opposed to being taken from a PRO_SETTINGS group of settings). */ int set_option (option, param, explicit) char *option, *param; int explicit; { struct pro *p = pro; char *param_start; register int option_length, val; val = 0; option_length = option_prefix (option); if (option_length > 0) { if (option_length == 1 && *option == '-') /* Short option prefix */ { option++; for (p = pro; p->p_name; p++) if (*p->p_name == *option && eqin (p->p_name, option, ¶m_start)) goto found; } else /* Long prefix */ { register struct long_option_conversion *o = option_conversions; option += option_length; while (o->short_name) { if (eqin (o->long_name, option, ¶m_start)) break; o++; } /* Searching twice means we don't have to keep the two tables in sync. */ if (o->short_name) for (p = pro; p->p_name; p++) if (!strcmp (p->p_name, o->short_name)) goto found; } } fprintf (stderr, "indent: unknown option \"%s\"\n", option - 1); exit (1); arg_missing: fprintf (stderr, "indent: missing argument to parameter %s\n", option); exit (1); found: /* If the parameter has been explicitly specified, we don't want a group of bundled settings to override the explicit setting. */ if (verbose) fprintf (stderr, "option: %s\n", p->p_name); if (explicit || !*(p->p_explicit)) { if (explicit) *(p->p_explicit) = 1; switch (p->p_type) { case PRO_PRSTRING: puts ((char *) p->p_obj); exit (0); case PRO_SETTINGS: { char *t; /* current position */ t = (char *) p->p_obj; do { set_option (t, 0); /* advance to character following next NUL */ while (*t++); } while (*t); } case PRO_IGN: break; case PRO_KEY: { register char *str; if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; str = (char *) xmalloc (strlen (param_start) + 1); strcpy (str, param_start); addkey (str, rw_decl); } break; case PRO_BOOL: if (p->p_special == OFF) *p->p_obj = false; else *p->p_obj = true; break; case PRO_INT: if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; if (!isdigit (*param_start)) { fprintf (stderr, "indent: option ``%s'' requires a numeric parameter\n", option - 1); exit (1); } *p->p_obj = atoi (param_start); break; case PRO_FONT: if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; parsefont ((struct fstate *) p->p_obj, param_start); break; default: fprintf (stderr, "indent: set_option: internal error: p_type %d\n", p->p_type); exit (1); } } return val; } /* Scan the options in the file F. */ static void scan_profile (f) register FILE *f; { register int i; register char *p, *this, *next, *temp; char b0[BUFSIZ]; char b1[BUFSIZ]; next = b0; this = 0; while (1) { for (p = next; (i = getc (f)) != EOF && (*p = i) > ' '; ++p); if (p != next) { *p++ = 0; if (!this) { this = b0; next = b1; continue; } if (set_option (this, next, 1)) { this = 0; next = b0; continue; } temp = this; this = next; next = temp; } else if (i == EOF) { if (this) set_option (this, 0, 1); return; } } } /* Some operating systems don't allow more than one dot in a filename. */ #if defined (ONE_DOT_PER_FILENAME) #define INDENT_PROFILE "indent.pro" #else #define INDENT_PROFILE ".indent.pro" #endif /* set_profile looks for ./.indent.pro or $HOME/.indent.pro, in that order, and reads the options given in that file. Return the path of the file read. Note that as of version 1.3, indent only reads one file. */ char * set_profile () { register FILE *f; char *fname; static char prof[] = INDENT_PROFILE; char *homedir; if ((f = fopen (INDENT_PROFILE, "r")) != NULL) { int len = strlen (INDENT_PROFILE) + 3; scan_profile (f); (void) fclose (f); fname = xmalloc (len); fname[0] = '.'; fname[1] = '/'; memcpy (&fname[2], INDENT_PROFILE, len - 3); fname[len - 1] = '\0'; return fname; } homedir = getenv ("HOME"); if (homedir) { fname = xmalloc (strlen (homedir) + 10 + sizeof prof); sprintf (fname, "%s/%s", homedir, prof); if ((f = fopen (fname, "r")) != NULL) { scan_profile (f); (void) fclose (f); return fname; } free (fname); } return 0; } indent-2.2.11/regression/standard/sys.h0000644000177400010010000000142210775646104014752 00000000000000/* Copyright (C) 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it without restriction. 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. */ #include #ifdef DEBUG extern int debug; #endif #ifdef __STDC__ #define INLINE inline #else #define INLINE #endif struct file_buffer { char *name; int size; char *data; }; extern struct file_buffer *read_file (), *read_stdin (); /* Standard memory allocation routines. */ char *malloc (); char *realloc (); /* Similar, but abort with an error if out of memory (see globs.c). */ char *xmalloc (); char *xrealloc (); indent-2.2.11/regression/standard/newlines.c-30000644000177400010010000000206610775646104016120 00000000000000/* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * Now here are some blank lines: * * * * * * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS * OR * * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/initializers.c0000644000177400010010000000060110775646104016633 00000000000000void foo () { char c[8] = { 0, 0, 0, 0, 1, 1, 1, 1 }; char c[8] = { /* comment */ 0, 0, 0, 0, 1, 1, 1, 1 }; char c[8] = { /* mult-line comment */ 0, 0, 0, 0, 1, 1, 1, 1 }; static unsigned int current_flags[4] = { 0, 0, 1, 2 }; static unsigned int current_flags[4] = { 0, CHFL_CHANOP | CHFL_VOICE, CHFL_VOICE, CHFL_CHANOP }; } indent-2.2.11/regression/standard/already-starred.c0000644000177400010010000000062610775646104017217 00000000000000 /* * Instance XV_KEY_DATA key. An instance is a set of related * user interface objects. A pointer to an object's instance * is stored under this key in every object. This must be a * global variable. */ /* * Another comment. */ main (int argc, char **argv) { /* * Initialize XView. */ xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); INSTANCE = xv_unique_key (); } indent-2.2.11/regression/standard/no-newline3.c0000644000177400010010000000011510775646104016263 00000000000000#if 0 main () { /* first comment */ } #endif /* Does this break indent? */ indent-2.2.11/regression/standard/unary.c0000644000177400010010000000003610775646104015265 00000000000000foo () { return (int) -1; } indent-2.2.11/regression/standard/long-comm.c0000644000177400010010000000024610775646104016022 00000000000000/** this is a test where the text goes over many lines, but where also there is some formatted ascii text, which should NOT b e indented at all. */ indent-2.2.11/regression/standard/goto-1.c0000644000177400010010000000024610775646104015240 00000000000000int f (void) { for (i = 0; i < 10; i++) { if (i > 5) goto two; i++; two: } } int main (void) { if (f ()) goto out; out: return 0; } indent-2.2.11/regression/standard/elipsis-attribute.c0000644000177400010010000000033410775646104017601 00000000000000extern void sendto_one (aClient *to, char *pattern, ...) __attribute__ ((format (printf, 2, 3))); int f (char *m, ...) __attribute__ ((format (printf, 1, 2))); void sendto_one (aClient *to, char *pattern, ...) { } indent-2.2.11/regression/standard/cp-indent.c0000644000177400010010000000023410775646104016010 00000000000000int foo () { if (long_function_name (a, #if FOO /* comment1 */ b)) #else /* comment2 */ c, d)) #endif /* comment3 */ ++ i; return 0; } indent-2.2.11/regression/standard/io.c.~1~0000644000177400010010000005020211145773474015274 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" #include /* POSIX says that should exist. Some systems might need to use or instead. */ #include #include #include /* number of levels a label is placed to left of code */ #define LABEL_OFFSET 2 /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *in_prog; char *in_prog_pos; char *cur_line; unsigned int in_prog_size; FILE *output; char *buf_ptr; char *buf_end; int had_eof; int out_lines; int com_lines; int suppress_blanklines = 0; int comment_open; int paren_target; /* Use `perror' to print the system error message caused by OFFENDER. */ static char *errbuf; void sys_error (offender) char *offender; { int size = strlen (offender); static int buffer_size; if (errbuf == 0) { buffer_size = size + 10; /* Extra for random unix lossage */ errbuf = (char *) xmalloc (buffer_size); } else if (size + 10 > buffer_size) { buffer_size = size + 10; errbuf = xrealloc (errbuf, buffer_size); } sprintf (errbuf, "indent: %s", offender); perror (errbuf); exit (1); } /* true if INDENT OFF is in effect */ static int inhibit_formatting; void dump_line () { /* dump_line is the routine that actually effects the printing of the new source. It prints the label section, followed by the code section with the appropriate nesting level, followed by any comments */ register int cur_col; register int target_col = 0; static not_first_line; if (parser_state_tos->procname[0]) { if (troff) { if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } fprintf (output, ".Pr \"%.*s\"\n", parser_state_tos->procname_end - parser_state_tos->procname, parser_state_tos->procname); } parser_state_tos->ind_level = 0; parser_state_tos->procname = "\0"; } /* A blank line */ if (s_code == e_code && s_lab == e_lab && s_com == e_com) { /* If we have a formfeed on a blank line, we should just output it, rather than treat it as a normal blank line. */ if (parser_state_tos->use_ff) { putc ('\014', output); parser_state_tos->use_ff = false; } else { if (suppress_blanklines > 0) suppress_blanklines--; else { parser_state_tos->bl_line = true; n_real_blanklines++; } } } else if (!inhibit_formatting) { suppress_blanklines = 0; parser_state_tos->bl_line = false; if (prefix_blankline_requested && not_first_line) { if (swallow_optional_blanklines && n_real_blanklines > 1) n_real_blanklines = 1; else if (n_real_blanklines == 0) n_real_blanklines = 1; } while (--n_real_blanklines >= 0) putc ('\n', output); n_real_blanklines = 0; if (parser_state_tos->ind_level == 0) parser_state_tos->ind_stmt = 0; /* this is a class A kludge. dont do additional statement indentation if we are at bracket level 0 */ if (e_lab != s_lab || e_code != s_code) ++code_lines; /* keep count of lines with code */ if (e_lab != s_lab) { /* print lab, if any */ if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; cur_col = pad_output (1, compute_label_target ()); if (s_lab[0] == '#' && (strncmp (s_lab, "#else", 5) == 0 || strncmp (s_lab, "#endif", 6) == 0)) { /* Treat #else and #endif as a special case because any text after #else or #endif should be converted to a comment. */ register char *s = s_lab; if (e_lab[-1] == '\n') e_lab--; do putc (*s++, output); while (s < e_lab && 'a' <= *s && *s <= 'z'); while ((*s == ' ' || *s == '\t') && s < e_lab) s++; if (s < e_lab) fprintf (output, s[0] == '/' && s[1] == '*' ? "\t%.*s" : "\t/* %.*s */", e_lab - s, s); } else fprintf (output, "%.*s", e_lab - s_lab, s_lab); cur_col = count_spaces (cur_col, s_lab); } else cur_col = 1; /* there is no label section */ parser_state_tos->pcase = false; if (s_code != e_code) { /* print code section, if any */ register char *p; if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } target_col = compute_code_target (); /* If a line ends in an lparen character, the following line should not line up with the parenthesis, but should be indented by the usual amount. */ if (parser_state_tos->last_token == lparen) { parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] += ind_size - 1; } { register i; for (i = 0; i < parser_state_tos->p_l_follow; i++) if (parser_state_tos->paren_indents[i] >= 0) parser_state_tos->paren_indents[i] = -(parser_state_tos->paren_indents[i] + target_col); } cur_col = pad_output (cur_col, target_col); for (p = s_code; p < e_code; p++) if (*p == (char) 0200) fprintf (output, "%d", target_col * 7); else putc (*p, output); cur_col = count_spaces (cur_col, s_code); } if (s_com != e_com) { if (troff) { int all_here = 0; register char *p; if (e_com[-1] == '/' && e_com[-2] == '*') e_com -= 2, all_here++; while (e_com > s_com && e_com[-1] == ' ') e_com--; *e_com = 0; p = s_com; while (*p == ' ') p++; if (p[0] == '/' && p[1] == '*') p += 2, all_here++; else if (p[0] == '*') p += p[1] == '/' ? 2 : 1; while (*p == ' ') p++; if (*p == 0) goto inhibit_newline; if (comment_open < 2 && parser_state_tos->box_com) { comment_open = 0; fprintf (output, ".*/\n"); } if (comment_open == 0) { if ('a' <= *p && *p <= 'z') *p = *p + 'A' - 'a'; if (e_com - p < 50 && all_here == 2) { register char *follow = p; fprintf (output, "\n.nr C! \\w\1"); while (follow < e_com) { switch (*follow) { case '\n': putc (' ', output); case 1: break; case '\\': putc ('\\', output); default: putc (*follow, output); } follow++; } putc (1, output); } fprintf (output, "\n./* %dp %d %dp\n", parser_state_tos->com_col * 7, (s_code != e_code || s_lab != e_lab) - parser_state_tos->box_com, target_col * 7); } comment_open = 1 + parser_state_tos->box_com; while (*p) { if (*p == BACKSLASH) putc (BACKSLASH, output); putc (*p++, output); } } else { /* print comment, if any */ register target = parser_state_tos->com_col; register char *com_st = s_com; target += parser_state_tos->comment_delta; while (*com_st == '\t') com_st++, target += tabsize; while (target <= 0) if (*com_st == ' ') target++, com_st++; else if (*com_st == '\t') { target = ((target - 1) & ~(tabsize - 1)) + (tabsize + 1); com_st++; } else target = 1; if (cur_col > target) { /* if comment cant fit on this line, put it on next line */ putc ('\n', output); cur_col = 1; ++out_lines; } while (e_com > com_st && isspace (e_com[-1])) e_com--; cur_col = pad_output (cur_col, target); if (!parser_state_tos->box_com) { if (star_comment_cont && (com_st[1] != '*' || e_com <= com_st + 1)) if (com_st[1] == ' ' && com_st[0] == ' ' && e_com > com_st + 1) com_st[1] = '*'; else fwrite (" * ", (com_st[0] == '\t' ? 2 : (com_st[0] == '*' ? 1 : 3)), 1, output); } fwrite (com_st, e_com - com_st, 1, output); parser_state_tos->comment_delta = parser_state_tos->n_comment_delta; cur_col = count_spaces (cur_col, com_st); ++com_lines; /* count lines with comments */ } } if (parser_state_tos->use_ff) { putc ('\014', output); parser_state_tos->use_ff = false; } else putc ('\n', output); inhibit_newline: ++out_lines; if (parser_state_tos->just_saw_decl == 1 && blanklines_after_declarations) { prefix_blankline_requested = 1; parser_state_tos->just_saw_decl = 0; } else prefix_blankline_requested = postfix_blankline_requested; postfix_blankline_requested = 0; } /* if we are in the middle of a declaration, remember that fact for proper comment indentation */ parser_state_tos->decl_on_line = parser_state_tos->in_decl; /* next line should be indented if we have not completed this stmt and if we are not in the middle of a declaration */ parser_state_tos->ind_stmt = (parser_state_tos->in_stmt & ~parser_state_tos->in_decl); parser_state_tos->dumped_decl_indent = 0; *(e_lab = s_lab) = '\0'; /* reset buffers */ *(e_code = s_code) = '\0'; *(e_com = s_com) = '\0'; parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->paren_level = parser_state_tos->p_l_follow; if (parser_state_tos->paren_level > 0) paren_target = -parser_state_tos->paren_indents[parser_state_tos->paren_level - 1]; else paren_target = 0; not_first_line = 1; return; } /* Figure out where we should put the code in codebuf. Return the column number in spaces. */ INLINE int compute_code_target () { register target_col = parser_state_tos->ind_level + 1; if (parser_state_tos->paren_level) if (!lineup_to_parens) target_col += continuation_indent * parser_state_tos->paren_level; else { register w; register t = paren_target; if ((w = count_spaces (t, s_code) - max_col) > 0 && count_spaces (target_col, s_code) <= max_col) { t -= w + 1; if (t > target_col) target_col = t; } else target_col = t; } else if (parser_state_tos->ind_stmt) target_col += continuation_indent; return target_col; } INLINE int compute_label_target () { return parser_state_tos->pcase ? case_ind + 1 : *s_lab == '#' ? 1 : parser_state_tos->ind_level - LABEL_OFFSET + 1; } /* Read file FILENAME into a `fileptr' structure, and return a pointer to that structure. */ static struct file_buffer fileptr; struct file_buffer * read_file (filename) char *filename; { int fd; struct stat file_stats; int namelen = strlen (filename); fd = open (filename, O_RDONLY, 0777); if (fd < 0) sys_error (filename); if (fstat (fd, &file_stats) < 0) sys_error (filename); if (fileptr.data != 0) free (fileptr.data); fileptr.size = file_stats.st_size; fileptr.data = (char *) xmalloc (file_stats.st_size + 1); if (read (fd, fileptr.data, fileptr.size) < 0) sys_error (filename); if (close (fd) < 0) sys_error (filename); fileptr.name = (char *) xmalloc (namelen + 1); memcpy (fileptr.name, filename, namelen); fileptr.name[namelen] = '\0'; fileptr.data[fileptr.size] = '\0'; return &fileptr; } /* This should come from stdio.h and be some system-optimal number */ #ifndef BUFSIZ #define BUFSIZ 1024 #endif /* Suck the standard input into a file_buffer structure, and return a pointer to that structure. */ struct file_buffer stdinptr; struct file_buffer * read_stdin () { unsigned int size = 15 * BUFSIZ; int ch; register char *p; if (stdinptr.data != 0) free (stdinptr.data); stdinptr.data = (char *) xmalloc (size + 1); stdinptr.size = 0; p = stdinptr.data; do { while (stdinptr.size < size) { ch = getc (stdin); if (ch == EOF) break; *p++ = ch; stdinptr.size++; } if (ch != EOF) { size += (2 * BUFSIZ); stdinptr.data = xrealloc (stdinptr.data, size); } } while (ch != EOF); stdinptr.name = "Standard Input"; stdinptr.data[stdinptr.size] = '\0'; return &stdinptr; } /* Advance buf_ptr so that it points to the next line of input. Skip over indent errors (comments beginning with *INDENT**), ignoring them. Process INDENT ON and INDENT OFF. (Note: the name of this function is a historical artifact from before the time that indent kept the whole source file in memory). */ INLINE void fill_buffer () { /* Point various places in the buffer. */ register char *p; /* Character P points to. */ register char c; /* Have we found INDENT ON or INDENT OFF ? */ enum { None, Indent_on, Indent_off } com; /* indent() may be saving the text between "if (...)" and the following statement. To do so, it uses another buffer (`save_com'). Switch back to the previous buffer here. */ if (bp_save != 0) { buf_ptr = bp_save; buf_end = be_save; bp_save = be_save = 0; /* only return if there is really something in this buffer */ if (buf_ptr < buf_end) return; } fill_it: cur_line = in_prog_pos; buf_ptr = in_prog_pos; if (*buf_ptr == '\0') { had_eof = true; return; } p = buf_ptr; do { c = *p; p++; } while (c != '\0' && c != '\n'); buf_end = p; p = buf_ptr; in_prog_pos = buf_end; while (*p == ' ' || *p == '\t') p++; if (*p == '/' && p[1] == '*') { p += 2; if (p[1] == 'I' && strncmp (p, "*INDENT**", 9) == 0) goto fill_it; while (*p == ' ' || *p == '\t') p++; com = None; if (p[0] == 'I' && p[1] == 'N' && p[2] == 'D' && p[3] == 'E' && p[4] == 'N' && p[5] == 'T') { p += 6; while (*p == ' ' || *p == '\t') p++; if (*p == '*') com = Indent_on; else if (*p == 'O') if (* ++p == 'N') p++, com = Indent_on; else if (*p == 'F' && * ++p == 'F') p++, com = Indent_off; while (*p == ' ' || *p == '\t') p++; if (p[0] == '*' && p[1] == '/' && p[2] == '\n' && com) { if (s_com != e_com || s_lab != e_lab || s_code != e_code) dump_line (); if (!(inhibit_formatting = (int) com - 1)) { n_real_blanklines = 0; postfix_blankline_requested = 0; prefix_blankline_requested = 0; suppress_blanklines = 1; } } } } if (inhibit_formatting) { p = buf_ptr; do putc (*p, output); while (*p++ != '\n'); } } /* Copyright (C) 1976 by the Board of Trustees of the University of Illinois All rights reserved NAME: pad_output FUNCTION: Writes tabs and spaces to move the current column up to the desired position. ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf. PARAMETERS: current integer The current column target nteger The desired column RETURNS: Integer value of the new column. (If current >= target, no action is taken, and current is returned. GLOBALS: None CALLS: write (sys) CALLED BY: dump_line HISTORY: initial coding November 1976 D A Willcox of CAC */ INLINE int pad_output (current, target) /* writes tabs and blanks (if necessary) to get the current output position up to the target column */ int current; /* the current column value */ int target; /* position we want it at */ { register int curr; /* internal column pointer */ register int tcur; if (troff) fprintf (output, "\\h'|%dp'", (target - 1) * 7); else { if (current >= target) return (current); /* line is already long enough */ curr = current; while ((tcur = curr + tabsize - (curr - 1) % tabsize) <= target) { putc ('\t', output); curr = tcur; } while (curr++ < target) putc (' ', output); /* pad with final blanks */ } return (target); } /* Copyright (C) 1976 by the Board of Trustees of the University of Illinois All rights reserved NAME: count_spaces FUNCTION: Find out where printing of a given string will leave the current character position on output. ALGORITHM: Run thru input string and add appropriate values to current position. RETURNS: Integer value of position after printing "buffer" starting in column "current". HISTORY: initial coding November 1976 D A Willcox of CAC */ INLINE int count_spaces (current, buffer) /* this routine figures out where the character position will be after printing the text in buffer starting at column "current" */ int current; char *buffer; { register char *buf; /* used to look thru buffer */ register int cur; /* current character counter */ cur = current; for (buf = buffer; *buf != '\0'; ++buf) { switch (*buf) { case '\n': case 014: /* form feed */ cur = 1; break; case '\t': cur = cur + tabsize - (cur - 1) % tabsize; break; case 010: /* backspace */ --cur; break; default: ++cur; break; } /* end of switch */ } /* end of for loop */ return (cur); } /* Nonzero if we have found an error (not a warning). */ int found_err; /* Signal an error. LEVEL is nonzero if it is an error (as opposed to a warning. MSG is a printf-style format string. Additional arguments are additional arguments for printf. */ /* VARARGS2 */ diag (level, msg, a, b) int level; unsigned int a, b; char *msg; { if (level) found_err = 1; if (output == stdout) { fprintf (stdout, "/**INDENT** %s@%d: ", level == 0 ? "Warning" : "Error", line_no); fprintf (stdout, msg, a, b); fprintf (stdout, " */\n"); } else { fprintf (stderr, "%s: %d: ", in_name, line_no); fprintf (stderr, msg, a, b); fprintf (stderr, "\n"); } } writefdef (f, nm) register struct fstate *f; unsigned int nm; { fprintf (output, ".ds f%c %s\n.nr s%c %d\n", nm, f->font, nm, f->size); } /* Write characters starting at S to change the font from OF to NF. Return a pointer to the character after the last character written. For troff mode only. */ char * chfont (of, nf, s) register struct fstate *of, *nf; char *s; { if (of->font[0] != nf->font[0] || of->font[1] != nf->font[1]) { *s++ = '\\'; *s++ = 'f'; if (nf->font[1]) { *s++ = '('; *s++ = nf->font[0]; *s++ = nf->font[1]; } else *s++ = nf->font[0]; } if (nf->size != of->size) { *s++ = '\\'; *s++ = 's'; if (nf->size < of->size) { *s++ = '-'; *s++ = '0' + of->size - nf->size; } else { *s++ = '+'; *s++ = '0' + nf->size - of->size; } } return s; } void parsefont (f, s0) register struct fstate *f; char *s0; { register char *s = s0; int sizedelta = 0; int i; f->size = 0; f->allcaps = 1; for (i = 0; i < 4; i++) f->font[i] = 0; while (*s) { if (isdigit (*s)) f->size = f->size * 10 + *s - '0'; else if (isupper (*s)) if (f->font[0]) f->font[1] = *s; else f->font[0] = *s; else if (*s == 'c') f->allcaps = 1; else if (*s == '+') sizedelta++; else if (*s == '-') sizedelta--; else { fprintf (stderr, "indent: bad font specification: %s\n", s0); exit (1); } s++; } if (f->font[0] == 0) f->font[0] = 'R'; if (bodyf.size == 0) bodyf.size = 11; if (f->size == 0) f->size = bodyf.size + sizedelta; else if (sizedelta > 0) f->size += bodyf.size; else f->size = bodyf.size - f->size; } #ifdef DEBUG void dump_debug_line () { fprintf (output, "\n*** Debug output marker line ***\n"); } #endif indent-2.2.11/regression/standard/backup.h0000644000177400010010000000256510775646104015412 00000000000000 /* backup.h -- declarations for making Emacs style backup file names Copyright (C) 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it without restriction. 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. */ /* When to make backup files. Analagous to 'version-control' in Emacs. */ enum backup_mode { /* Uninitialized or indeterminate value */ unknown, /* Never make backups. */ none, /* Make simple backups of every file. */ simple, /* Make numbered backups of files that already have numbered backups, and simple backups of the others. */ numbered_existing, /* Make numbered backups of every file. */ numbered }; struct version_control_values { enum backup_mode value; char *name; }; /* Determine the value of `version_control' by looking in the environment variable "VERSION_CONTROL". Defaults to numbered_existing. */ extern enum backup_mode version_control_value (); /* Initialize information used in determining backup filenames. */ extern void initialize_backups (); /* Make a backup copy of FILE, taking into account version-control. See the description at the beginning of the file for details. */ extern void make_backup (); indent-2.2.11/regression/standard/boxed.c-00000644000177400010010000000450610775646104015373 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/cplus-one.c0000644000177400010010000000004610775646104016035 00000000000000// One line cplus comment, no newline indent-2.2.11/regression/standard/ncs-on-return.c0000644000177400010010000000011211041665334016625 00000000000000unsigned char *cp = (unsigned char *)ptr; int foo () { return (int)n; } indent-2.2.11/regression/standard/elif.c0000644000177400010010000000056610775646104015056 00000000000000void Fnc () { int i, j, k; int Sum = 0; #ifdef t1 for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) for (k = 0; k < 10; k++) Sum += i * 100 + j * 10 + k; #elif defined(t2) for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) Sum += i * 10 + j; #else for (i = 0; i < 10; i++) { Sum += i; #endif } printf ("%d\n", Sum); } indent-2.2.11/regression/standard/boxed.c-80000644000177400010010000000453210775646104015402 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/method.c0000644000177400010010000000003110775646104015402 00000000000000int q::s () { int i; } indent-2.2.11/regression/standard/outer.c-10000644000177400010010000000207110775646104015424 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/pre_nlps.c0000644000177400010010000000012711264323266015745 00000000000000#if x #if y #if z #define www #else #define ggg #endif #else #define kkk #endif #endif indent-2.2.11/regression/standard/ncs.c0000644000177400010010000000002310775646104014706 00000000000000char c = (char) 1; indent-2.2.11/regression/standard/macro.c0000644000177400010010000000012210775646104015224 00000000000000int i = MACRO (int); struct X x = { MACRO (int) }; void foo () { MACRO (int); } indent-2.2.11/regression/standard/cdb.c0000644000177400010010000000022210775646104014654 00000000000000int foo; /* This is a single line comment */ /* this is a column zero real single line comment */ /* this is elgible for cdb. */ indent-2.2.11/regression/standard/indent_globs.h0000644000177400010010000004111010775646104016601 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. @(#)indent_globs.h 5.7 (Berkeley) 9/15/88 */ #ifdef DEBUG extern int debug; #endif #include #if 0 /* Some systems don't have string.h. If there are any places where indent depends on the return type of strcpy and friends, declare the return type (e.g. "char *strcpy();"). */ #include #endif /* 0 */ struct file_buffer { char *name; int size; char *data; }; extern struct file_buffer *read_file (), *read_stdin (); extern void make_backup (); /* Standard memory allocation routines. */ char *malloc (); char *realloc (); /* Do the same thing, but abort with an error if out of memory (see globs.c). */ char *xmalloc (); char *xrealloc (); char *memcpy (); #define BACKSLASH '\\' #define label_offset 2 /* number of levels a label is placed to left of code */ /* Initial size of internal buffers (they are extended as necessary). */ #define bufsize 1000 enum codes { code_eof = 0, /* end of file */ newline, lparen, /* '(' or '['. Also '{' in an initialization. */ rparen, /* ')' or ']'. Also '}' in an initialization. */ unary_op, binary_op, postop, question, casestmt, colon, semicolon, lbrace, rbrace, ident, /* string or char literal, identifier, number */ comma, comment, swstmt, preesc, /* '#'. */ form_feed, decl, sp_paren, /* if, for, or while token */ sp_nparen, ifstmt, whilestmt, forstmt, stmt, stmtl, elselit, dolit, dohead, dostmt, ifhead, elsehead, period }; enum rwcodes { rw_none, rw_break, rw_switch, rw_case, rw_struct_like, /* struct, enum, union */ rw_decl, rw_sp_paren, /* if, while, for */ rw_sp_nparen, /* do, else */ rw_sizeof, rw_return }; #define false 0 #define true 1 /* Name of input file. */ extern char *in_name; extern char *in_prog; /* pointer to the null-terminated input program */ /* Point to the position in the input program which we are currently looking at. */ extern char *in_prog_pos; /* Point to the start of the current line. */ extern char *cur_line; /* Size of the input program, not including the ' \n\0' we add at the end */ extern unsigned int in_prog_size; extern FILE *output; /* the output file */ #define check_code_size \ if (e_code >= l_code) { \ register nsize = l_code-s_code+400; \ codebuf = (char *) realloc(codebuf, nsize); \ e_code = codebuf + (e_code-s_code) + 1; \ l_code = codebuf + nsize - 5; \ s_code = codebuf + 1; \ } #define check_com_size \ if (e_com >= l_com) { \ register nsize = l_com-s_com+400; \ combuf = (char *) realloc(combuf, nsize); \ e_com = combuf + (e_com-s_com) + 1; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ } #define check_lab_size \ if (e_lab >= l_lab) { \ register nsize = l_lab-s_lab+400; \ labbuf = (char *) realloc(labbuf, nsize); \ e_lab = labbuf + (e_lab-s_lab) + 1; \ l_lab = labbuf + nsize - 5; \ s_lab = labbuf + 1; \ } extern char *labbuf; /* buffer for label */ extern char *s_lab; /* start ... */ extern char *e_lab; /* .. and end of stored label */ extern char *l_lab; /* limit of label buffer */ extern char *codebuf; /* buffer for code section */ extern char *s_code; /* start ... */ extern char *e_code; /* .. and end of stored code */ extern char *l_code; /* limit of code section */ extern char *combuf; /* buffer for comments */ extern char *s_com; /* start ... */ extern char *e_com; /* ... and end of stored comments */ extern char *l_com; /* limit of comment buffer */ extern char *buf_ptr; /* ptr to next character to be taken from in_buffer */ extern char *buf_end; /* ptr to first after last char in in_buffer */ /* pointer to the token that lexi() has just found */ extern char *token; /* points to the first char after the end of token */ extern char *token_end; /* Functions from lexi.c */ enum codes lexi (); /* Used to keep track of buffers. */ struct buf { char *ptr; /* points to the start of the buffer */ char *end; /* points to the character beyond the last one (e.g. is equal to ptr if the buffer is empty). */ int size; /* how many chars are currently allocated. */ }; /* Insure that BUFSTRUC has at least REQ more chars left, if not extend it. Note: This may change bufstruc.ptr. */ #define need_chars(bufstruc, req) \ if ((bufstruc.end - bufstruc.ptr + (req)) >= bufstruc.size) \ {\ int cur_chars = bufstruc.end - bufstruc.ptr;\ bufstruc.size *= 2;\ bufstruc.ptr = xrealloc(bufstruc.ptr,bufstruc.size);\ bufstruc.end = bufstruc.ptr + cur_chars;\ } /* Buffer in which to save a comment which occurs between an if(), while(), etc., and the statement following it. Note: the fact that we point into this buffer, and that we might realloc() it (via the need_chars macro) is a bad thing (since when the buffer is realloc'd its address might change, making any pointers into it point to garbage), but since the filling of the buffer (hence the need_chars) and the using of the buffer (where buf_ptr points into it) occur at different times, we can get away with it (it would not be trivial to fix). */ extern struct buf save_com; extern char *bp_save; /* saved value of buf_ptr when taking input from save_com */ extern char *be_save; /* similarly saved value of buf_end */ extern int pointer_as_binop; extern int blanklines_after_declarations; extern int blanklines_before_blockcomments; extern int blanklines_after_procs; extern int blanklines_around_conditional_compilation; extern int swallow_optional_blanklines; extern int n_real_blanklines; extern int prefix_blankline_requested; extern int postfix_blankline_requested; extern int break_comma; /* when true and not in parens, break after a comma */ extern int found_err; /* flag set in diag() on error */ extern int else_or_endif; extern int di_stack_alloc; extern int *di_stack; /* number of spaces to indent braces from the suround if, while, etc. in -bl (bype_2 == 0) code */ extern int brace_indent; extern int btype_2; /* when true, brace should be on same line as if, while, etc */ /* If true, a space is inserted between if, while, or for, and a semicolon for example while (*p++ == ' ') ; */ extern int space_sp_semicolon; /* True if a #else or #endif has been encountered. */ extern int else_or_endif; extern int case_ind; /* indentation level to be used for a "case n:" in spaces */ extern int code_lines; /* count of lines with code */ /* the number of comments processed, set by pr_comment. */ extern int out_coms; extern int out_lines; /* the number of lines written, set by dump_line */ extern int com_lines; /* the number of lines with comments, set by dump_line */ extern int had_eof; /* set to true when input is exhausted */ extern int line_no; /* the current line number. */ extern int max_col; /* the maximum allowable line length */ extern int verbose; /* when true, non-essential error messages are printed */ extern int cuddle_else; /* true if else should cuddle up to '}' */ extern int star_comment_cont; /* true iff comment continuation lines should have stars at the beginning of each line. */ extern int comment_delimiter_on_blankline; extern int troff; /* true iff were generating troff input */ extern int procnames_start_line; /* if true, the names of procedures being defined get placed in column 1 (ie. a newline is placed between the type of the procedure and its name) */ extern int expect_output_file; /* Means "-o" was specified. */ extern int proc_calls_space; /* If true, procedure calls look like: foo (bar) rather than foo(bar) */ extern int cast_space; /* If true, casts look like: r * (char *) bar rather than (char *)bar */ /* If comments which start in column 1 are to be magically reformatted */ extern int format_col1_comments; /* If any comments are to be reformatted */ extern int format_comments; extern int suppress_blanklines; /* set iff following blanklines should be suppressed */ extern int continuation_indent; /* set to the indentation between the edge of code and continuation lines in spaces */ extern int lineup_to_parens; /* if true, continued code within parens will be lined up to the open paren */ /* The position that we will line the current line up with when it comes time to print it (if we are lining up to parentheses). */ extern int paren_target; /* true iff a blank should always be inserted after sizeof */ extern int Bill_Shannon; extern int blanklines_after_declarations_at_proctop; /* This is vaguely similar to blanklines_after_decla rations except that it only applies to the first set of declarations in a procedure (just after the first '{') and it causes a blank line to be generated even if there are no declarations */ extern int block_comment_max_col; extern int extra_expression_indent; /* True if continuation lines from the expression part of "if(e)", "while(e)", "for(e;e;e)" should be indented an extra tab stop so that they don't conflict with the code that follows */ /* The following are all controlled by command line switches (as are some of the things above). */ extern int leave_comma; /* if true, never break declarations after commas */ extern int decl_com_ind; /* the column in which comments after declarations should be put */ extern int case_indent; /* The distance to indent case labels from the switch statement */ extern int com_ind; /* the column in which comments to the right of code should start */ extern int decl_indent; /* column to indent declared identifiers to */ extern int ljust_decl; /* true if declarations should be left justified */ extern int unindent_displace; /* comments not to the right of code will be placed this many indentation levels to the left of code */ extern int else_if; /* True iff else if pairs should be handled specially */ /* Number of spaces to indent parameters. */ extern int indent_parameters; /* The size of one indentation level in spaces. */ extern int ind_size; /* The number of columns a tab character generates. */ extern int tabsize; /* Nonzero if we should use standard input/output when files are not explicitly specified. */ extern int use_stdinout; /* -troff font state information */ struct fstate { char font[4]; char size; int allcaps:1; }; char *chfont (); extern struct fstate keywordf, /* keyword font */ stringf, /* string font */ boxcomf, /* Box comment font */ blkcomf, /* Block comment font */ scomf, /* Same line comment font */ bodyf; /* major body font */ /* This structure contains information relating to the state of parsing the code. The difference is that the state is saved on #if and restored on #else. */ struct parser_state { struct parser_state *next; enum codes last_token; struct fstate cfont; /* Current font */ /* This is the parsers stack, and the current allocated size. */ enum codes *p_stack; int p_stack_size; /* This stack stores indentation levels */ /* Currently allocated size is stored in p_stack_size. */ int *il; /* If the last token was an ident and is a reserved word, remember the type. */ enum rwcodes last_rw; /* Used to store case stmt indentation levels. */ /* Currently allocated size is stored in p_stack_size. */ int *cstk; /* Pointer to the top of stack of the p_stack, il and cstk arrays. */ int tos; int box_com; /* set to true when we are in a "boxed" comment. In that case, the first non-blank char should be lined up with the / in /* */ /* Shift comments by this many columns. */ int comment_delta; /* Value of comment_delta for the following line. */ int n_comment_delta; int cast_mask; /* indicates which close parens close off casts */ /* A bit for each paren level, set if the open paren was in a context which indicates that this pair of parentheses is not a cast. */ int noncast_mask; int sizeof_mask; /* indicates which close parens close off sizeof''s */ int block_init; /* true iff inside a block initialization */ int block_init_level; /* The level of brace nesting in an initialization */ int last_nl; /* this is true if the last thing scanned was a newline */ int in_or_st; /* Will be true iff there has been a declarator (e.g. int or char) and no left paren since the last semicolon. When true, a '{' is starting a structure definition or an initialization list */ int bl_line; /* set to 1 by dump_line if the line is blank */ int col_1; /* set to true if the last token started in column 1 */ int com_col; /* this is the column in which the current coment should start */ int dec_nest; /* current nesting level for structure or init */ int decl_on_line; /* set to true if this line of code has part of a declaration on it */ int i_l_follow; /* the level in spaces to which ind_level should be set after the current line is printed */ int in_decl; /* set to true when we are in a declaration stmt. The processing of braces is then slightly different */ int in_stmt; /* set to 1 while in a stmt */ int ind_level; /* the current indentation level in spaces */ int ind_stmt; /* set to 1 if next line should have an extra indentation level because we are in the middle of a stmt */ int last_u_d; /* set to true after scanning a token which forces a following operator to be unary */ int p_l_follow; /* used to remember how to indent following statement */ int paren_level; /* parenthesization level. used to indent within stmts */ int paren_depth; /* Depth of paren nesting anywhere. */ /* Column positions of paren at each level. If positive, it contains just the number of characters of code on the line up to and including the right parenthesis character. If negative, it contains the opposite of the actual level of indentation in characters (that is, the indentation of the line has been added to the number of characters and the sign has been reversed to indicate that this has been done). */ short *paren_indents; /* column positions of each paren */ int paren_indents_size; /* Currently allocated size. */ int pcase; /* set to 1 if the current line label is a case. It is printed differently from a regular label */ int search_brace; /* set to true by parse when it is necessary to buffer up all info up to the start of a stmt after an if, while, etc */ int use_ff; /* set to one if the current line should be terminated with a form feed */ int want_blank; /* set to true when the following token should be prefixed by a blank. (Said prefixing is ignored in some cases.) */ int its_a_keyword; int sizeof_keyword; int dumped_decl_indent; int in_parameter_declaration; char *procname; /* The name of the current procedure */ char *procname_end; /* One char past the last one in procname */ int just_saw_decl; }; /* All manipulations of the parser state occur at the top of stack (tos). A stack is kept for conditional compilation (unrelated to the p_stack, il, & cstk stacks)--it is implemented as a linked list via the next field. */ extern struct parser_state *parser_state_tos; /* The column in which comments to the right of #else and #endif should start. */ extern int else_endif_col; indent-2.2.11/regression/standard/newlines.c-80000644000177400010010000000213310775646104016120 00000000000000/* * Redistribution and use in source and binary * forms are permitted permission. THIS SOFTWARE * IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS * OR Now here are some blank lines: * * * * * * IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE. */ /* * Redistribution and use in source and binary * forms are permitted permission. THIS SOFTWARE * IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS * OR * * IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE. */ int some_global; /* * Redistribution and use in source and binary * forms are permitted permission. THIS * SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT * ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/no-newline2.c0000644000177400010010000000006710775646104016270 00000000000000#if 0 main () { } #endif /* Does this break indent? */ indent-2.2.11/regression/standard/if-decl-else-decl.c0000644000177400010010000000010210775646104017257 00000000000000#if 1 void f (some_t s, int b) #else void f (some_t s) #endif { } indent-2.2.11/regression/standard/outer.c-80000644000177400010010000000213010775646104015427 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/newlines.c-20000644000177400010010000000203710775646104016115 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR Now here are some blank lines: IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/tabs.c-10000644000177400010010000000045610775646104015224 00000000000000 /* * Here is a column 1 comment with tab tab and tab * In the columns: ^ ^ ^ those */ main () { int i = 33; /* * Here there everywhere here.. and that's it * tab ^--------^------------^-----------^------------- */ foo (i); } indent-2.2.11/regression/standard/version.h0000644000177400010010000000066410775646104015630 00000000000000/* Originally based on Berkeley indent 5.11 (9/15/88). */ /* kingdon merged in a bunch of changes from the BSD version of Sep 89, but it wouldn't really be correct to say that GNU indent is based on the new BSD stuff either. */ /* Despite the continued presence of the original copyright, I think this version is sufficiently different to simply call it GNU indent. jla 11/91 */ #define VERSION_STRING "GNU indent 1.5" indent-2.2.11/regression/standard/bbreak.c0000644000177400010010000000020710775646104015355 00000000000000void main (void) { if ((foofoofoo.barbarbar. bazbazbazbaz->foobar.foobaz. bazzbar->foobar.barbaz.bazfoo)) a = 1; } indent-2.2.11/regression/standard/comments4.c0000644000177400010010000000030710775646104016041 00000000000000void foo () { /* * first comment */ /* * second comment *//* * third comment */ /* * fourth comment */ /* ** fifth comment * */ /* * sixth comment * */ } indent-2.2.11/regression/standard/minus_predecrement.c0000644000177400010010000000004411145773667020025 00000000000000int foo (int a) { return - --a; } indent-2.2.11/regression/standard/one-line-1.c0000644000177400010010000000011710775646104015773 00000000000000main () { if (foo) { bar (33); grop (); } return -1; } indent-2.2.11/regression/standard/continue-lp.c0000644000177400010010000000104610775646104016366 00000000000000extern EXETOKEN savetkn; /* Last input token found. */ extern EXETOKEN NOTOKEN; /* Empty token */ word FilOpnTmp (uword maxr, word creat) /* i: 0 - copies existing mastfil to tmpfil, 1- creates tmpfil */ { here_is_an_incredibly_long_variable = my * but * this * (is + a) / lengthy * expression; for (mastfil_dta = 0; mastfil_dta < cnfils && (strcmp (mastfil->fname, dtafilarr [mastfil_dta]-> fname) != 0); mastfil_dta++); for (mastfil_dta = 0; mastfil_dta < cnfils; mastfil_dta++); } indent-2.2.11/regression/standard/meta-indent.c0000644000177400010010000000031411212745610016320 00000000000000lw5100_add_to_field_list(object, node, row) GCH_Object *object; CMM_NODE *node; int row; { Node_data *data; /* a000345 */ /* strcpy_fill(field_name_string, data->name, ' ', 43, NULL, TRUE); */ } indent-2.2.11/regression/standard/outer.c-90000644000177400010010000000213010775646104015430 00000000000000/* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* * Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * Here's a multi-line cooment where the * closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/kr-proc-decls.c0000644000177400010010000000015710775646104016600 00000000000000 int toome(); int metoo(); void *bar(); void *rab(); char *foo() { a++; } char eatme() { foo(); } indent-2.2.11/regression/standard/boxed.c-60000644000177400010010000000450310775646104015376 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/one-line-2.c0000644000177400010010000000012210775646104015770 00000000000000main () { while (foo) { bar (33); grop (); } return -1; } indent-2.2.11/regression/standard/case-label.c0000644000177400010010000000024510775646104016121 00000000000000 void bar (int foo) { switch (foo) { case 0: abort (); break; case 1: fuckme (); break; default: abort (); } } indent-2.2.11/regression/standard/bug-psl.c0000644000177400010010000000311010775646104015474 00000000000000void foo () /* */ /* This */ /* is in */ /* the same */ /* column */ /* */ /* */ { } void bar () /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ { } indent-2.2.11/regression/standard/on-off-2.c0000644000177400010010000000060710775646104015456 00000000000000/* Testing *INDENT-ON* and *INDENT-OFF* controls comments */ // *INDENT-ON* // *INDENT-OFF* main(int argc, char **argv) { char *foo; puts(foo); } grunt(int argc, char **argv { char *foo; puts(foo); } /* *INDENT-ON* */ /* shouldn *INDENT-ON* */ frobp (int argc, char **argv) { char *foo; while (barl) { printf ("marglefrosh"); } puts (foo); } indent-2.2.11/regression/standard/args.c.~1~0000644000177400010010000006135611145773304015625 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Argument scanning and profile reading code. Default parameters are set here as well. */ #include "sys.h" #include "indent.h" #include #include "version.h" int else_endif_col; extern char *in_name; char *getenv (); /* profile types */ enum profile { PRO_BOOL, /* boolean */ PRO_INT, /* integer */ PRO_FONT, /* troff font */ PRO_IGN, /* ignore it */ PRO_KEY, /* -T switch */ PRO_SETTINGS, /* bundled set of settings */ PRO_PRSTRING /* Print string and exit */ }; /* profile specials for booleans */ enum on_or_off { ONOFF_NA, /* Not applicable. Used in table for non-booleans. */ OFF, /* This option turns on the boolean variable in question. */ ON /* it turns it off */ }; /* Explicit flags for each option. */ static int exp_T = 0; static int exp_bacc = 0; static int exp_badp = 0; static int exp_bad = 0; static int exp_bap = 0; static int exp_bbb = 0; static int exp_bc = 0; static int exp_bli = 0; static int exp_bl = 0; static int exp_bs = 0; static int exp_cdb = 0; static int exp_cd = 0; static int exp_ce = 0; static int exp_ci = 0; static int exp_cli = 0; static int exp_cp = 0; static int exp_cs = 0; static int exp_c = 0; static int exp_di = 0; static int exp_dj = 0; static int exp_d = 0; static int exp_eei = 0; static int exp_ei = 0; static int exp_fbc = 0; static int exp_fbx = 0; static int exp_fb = 0; static int exp_fc1 = 0; static int exp_fca = 0; static int exp_fc = 0; static int exp_fk = 0; static int exp_fs = 0; static int exp_gnu = 0; static int exp_orig = 0; static int exp_ip = 0; static int exp_nip = 0; static int exp_i = 0; static int exp_lc = 0; static int exp_lp = 0; static int exp_l = 0; static int exp_lps = 0; static int exp_pcs = 0; static int exp_psl = 0; static int exp_pro = 0; static int exp_ps = 0; static int exp_kr = 0; static int exp_sc = 0; static int exp_sob = 0; static int exp_ss = 0; static int exp_st = 0; static int exp_troff = 0; static int exp_ts = 0; static int exp_v = 0; static int exp_version = 0; /* The following variables are controlled by command line parameters and their meaning is explained in indent.h. */ int leave_comma; int decl_com_ind; int case_indent; int com_ind; int decl_indent; int ljust_decl; int unindent_displace; int else_if; int indent_parameters; int ind_size; int tabsize; int blanklines_after_procs; int use_stdout; int pointer_as_binop; int blanklines_after_declarations; int blanklines_before_blockcomments; int blanklines_around_conditional_compilation; int swallow_optional_blanklines; int n_real_blanklines; int prefix_blankline_requested; int postfix_blankline_requested; int brace_indent; int btype_2; int space_sp_semicolon; int case_ind; int max_col; int verbose; int cuddle_else; int star_comment_cont; int comment_delimiter_on_blankline; int troff; int procnames_start_line; int proc_calls_space; int cast_space; int format_col1_comments; int format_comments; int continuation_indent; int lineup_to_parens; int leave_preproc_space; int blank_after_sizeof; int blanklines_after_declarations_at_proctop; int block_comment_max_col; int extra_expression_indent; int expect_output_file; /* N.B.: because of the way the table here is scanned, options whose names are substrings of other options must occur later; that is, with -lp vs -l, -lp must be first. Also, while (most) booleans occur more than once, the last default value is the one actually assigned. */ struct pro { char *p_name; /* name, eg -bl, -cli */ enum profile p_type; int p_default; /* the default value (if int) */ /* If p_type == PRO_BOOL, ON or OFF to tell how this switch affects the variable. Not used for other p_type's. */ enum on_or_off p_special; /* if p_type == PRO_SETTINGS, a (char *) pointing to a list of the switches to set, separated by NULs, terminated by 2 NULs. if p_type == PRO_BOOL, PRO_INT, or PRO_FONT, address of the variable that gets set by the option. if p_type == PRO_PRSTRING, a (char *) pointing to the string. */ int *p_obj; /* Points to a nonzero value (allocated statically for all options) if the option has been specified explicitly. This is necessary because for boolean options, the options to set and reset the variable must share the explicit flag. */ int *p_explicit; }; #ifdef BERKELEY_DEFAULTS /* Settings for original defaults */ struct pro pro[] = { {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation, &exp_bacc}, {"badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop, &exp_badp}, {"bad", PRO_BOOL, false, ON, &blanklines_after_declarations, &exp_bad}, {"bap", PRO_BOOL, false, ON, &blanklines_after_procs, &exp_bap}, {"bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments, &exp_bbb}, {"bc", PRO_BOOL, true, OFF, &leave_comma, &exp_bc}, {"bli", PRO_INT, 0, ONOFF_NA, &brace_indent, &exp_bli}, {"bl", PRO_BOOL, true, OFF, &btype_2, &exp_bl}, {"br", PRO_BOOL, true, ON, &btype_2, &exp_bl}, {"bs", PRO_BOOL, false, ON, &blank_after_sizeof, &exp_bs}, {"cdb", PRO_BOOL, true, ON, &comment_delimiter_on_blankline, &exp_cdb}, {"cd", PRO_INT, 33, ONOFF_NA, &decl_com_ind, &exp_cd}, {"ce", PRO_BOOL, true, ON, &cuddle_else, &exp_ce}, {"ci", PRO_INT, 4, ONOFF_NA, &continuation_indent, &exp_ci}, {"cli", PRO_INT, 0, ONOFF_NA, &case_indent, &exp_cli}, {"cp", PRO_INT, 33, ONOFF_NA, &else_endif_col, &exp_cp}, {"cs", PRO_BOOL, true, ON, &cast_space, &exp_cs}, {"c", PRO_INT, 33, ONOFF_NA, &com_ind, &exp_c}, {"di", PRO_INT, 16, ONOFF_NA, &decl_indent, &exp_di}, {"dj", PRO_BOOL, false, ON, &ljust_decl, &exp_dj}, {"d", PRO_INT, 0, ONOFF_NA, &unindent_displace, &exp_d}, {"eei", PRO_BOOL, false, ON, &extra_expression_indent, &exp_eei}, {"ei", PRO_BOOL, true, ON, &else_if, &exp_ei}, {"fbc", PRO_FONT, 0, ONOFF_NA, (int *) &blkcomf, &exp_fbc}, {"fbx", PRO_FONT, 0, ONOFF_NA, (int *) &boxcomf, &exp_fbx}, {"fb", PRO_FONT, 0, ONOFF_NA, (int *) &bodyf, &exp_fb}, {"fc1", PRO_BOOL, true, ON, &format_col1_comments, &exp_fc1}, {"fca", PRO_BOOL, true, ON, &format_comments, &exp_fca}, {"fc", PRO_FONT, 0, ONOFF_NA, (int *) &scomf, &exp_fc}, {"fk", PRO_FONT, 0, ONOFF_NA, (int *) &keywordf, &exp_fk}, {"fs", PRO_FONT, 0, ONOFF_NA, (int *) &stringf, &exp_fs}, {"gnu", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-bl\0-ncdb\0-cs\0-nce\0-di2\0-ndj\0\ -ei\0-nfc1\0-i2\0-ip5\0-lp\0-pcs\0-nps\0-psl\0-nsc\0-nsob\0-bli2\0\ -cp1\0-nfca\0", &exp_gnu}, {"ip", PRO_INT, 4, ON, &indent_parameters, &exp_ip}, {"i", PRO_INT, 4, ONOFF_NA, &ind_size, &exp_i}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-br\0-c33\0-cd33\0-ncdb\0-ce\0\ -ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i4\0-ip0\0-l75\0-lp\0-npcs\0-npsl\0-cs\0\ -nsc\0-nsc\0-nsob\0-nfca\0-cp33\0-nss\0", &exp_kr}, {"lc", PRO_INT, 0, ONOFF_NA, &block_comment_max_col, &exp_lc}, {"lps", PRO_BOOL, true, ON, &leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens, &exp_lp}, {"l", PRO_INT, 78, ONOFF_NA, &max_col, &exp_l}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation, &exp_bacc}, {"nbadp", PRO_BOOL, false, OFF, &blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations, &exp_bad}, {"nbap", PRO_BOOL, false, OFF, &blanklines_after_procs, &exp_bap}, {"nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments, &exp_bbb}, {"nbc", PRO_BOOL, true, ON, &leave_comma, &exp_bc}, {"nbs", PRO_BOOL, false, OFF, &blank_after_sizeof, &exp_bs}, {"ncdb", PRO_BOOL, true, OFF, &comment_delimiter_on_blankline, &exp_cdb}, {"nce", PRO_BOOL, true, OFF, &cuddle_else, &exp_ce}, {"ncs", PRO_BOOL, true, OFF, &cast_space, &exp_cs}, {"ndj", PRO_BOOL, false, OFF, &ljust_decl, &exp_dj}, {"neei", PRO_BOOL, false, OFF, &extra_expression_indent, &exp_eei}, {"nei", PRO_BOOL, true, OFF, &else_if, &exp_ei}, {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments, &exp_fc1}, {"nfca", PRO_BOOL, true, OFF, &format_comments, &exp_fca}, {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0", &exp_nip}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens, &exp_lp}, {"npcs", PRO_BOOL, false, OFF, &proc_calls_space, &exp_pcs}, {"npro", PRO_IGN, 0, ONOFF_NA, 0, &exp_pro}, {"npsl", PRO_BOOL, true, OFF, &procnames_start_line, &exp_psl}, {"nps", PRO_BOOL, false, OFF, &pointer_as_binop, &exp_ps}, {"nsc", PRO_BOOL, true, OFF, &star_comment_cont, &exp_sc}, {"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines, &exp_sob}, {"nss", PRO_BOOL, false, OFF, &space_sp_semicolon, &exp_ss}, {"nv", PRO_BOOL, false, OFF, &verbose, &exp_v}, {"o", PRO_BOOL, false, ON, &expect_output_file, &expect_output_file}, {"pcs", PRO_BOOL, false, ON, &proc_calls_space, &exp_pcs}, {"psl", PRO_BOOL, true, ON, &procnames_start_line, &exp_psl}, {"ps", PRO_BOOL, false, ON, &pointer_as_binop, &exp_ps}, {"sc", PRO_BOOL, true, ON, &star_comment_cont, &exp_sc}, {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines, &exp_sob}, {"ss", PRO_BOOL, false, ON, &space_sp_semicolon, &exp_ss}, {"st", PRO_BOOL, false, ON, &use_stdout, &exp_st}, {"troff", PRO_BOOL, false, ON, &troff, &exp_troff}, {"ts", PRO_INT, 8, ONOFF_NA, &tabsize, &exp_ts}, {"version", PRO_PRSTRING, 0, ONOFF_NA, (int *) VERSION_STRING, &exp_version}, {"v", PRO_BOOL, false, ON, &verbose, &exp_v}, /* Signify end of structure. */ {0, PRO_IGN, 0, ONOFF_NA, 0, 0} }; #else /* Default to GNU style */ /* Changed to make GNU style the default. */ struct pro pro[] = { {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation, &exp_bacc}, {"badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop, &exp_badp}, {"bad", PRO_BOOL, false, ON, &blanklines_after_declarations, &exp_bad}, {"bap", PRO_BOOL, true, ON, &blanklines_after_procs, &exp_bap}, {"bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments, &exp_bbb}, {"bc", PRO_BOOL, true, OFF, &leave_comma, &exp_bc}, {"bli", PRO_INT, 2, ONOFF_NA, &brace_indent, &exp_bli}, {"bl", PRO_BOOL, true, OFF, &btype_2, &exp_bl}, {"br", PRO_BOOL, false, ON, &btype_2, &exp_bl}, {"bs", PRO_BOOL, false, ON, &blank_after_sizeof, &exp_bs}, {"cdb", PRO_BOOL, false, ON, &comment_delimiter_on_blankline, &exp_cdb}, {"cd", PRO_INT, 33, ONOFF_NA, &decl_com_ind, &exp_cd}, {"ce", PRO_BOOL, false, ON, &cuddle_else, &exp_ce}, {"ci", PRO_INT, 0, ONOFF_NA, &continuation_indent, &exp_ci}, {"cli", PRO_INT, 0, ONOFF_NA, &case_indent, &exp_cli}, {"cp", PRO_INT, 1, ONOFF_NA, &else_endif_col, &exp_cp}, {"cs", PRO_BOOL, true, ON, &cast_space, &exp_cs}, {"c", PRO_INT, 33, ONOFF_NA, &com_ind, &exp_c}, {"di", PRO_INT, 2, ONOFF_NA, &decl_indent, &exp_di}, {"dj", PRO_BOOL, false, ON, &ljust_decl, &exp_dj}, {"d", PRO_INT, 0, ONOFF_NA, &unindent_displace, &exp_d}, {"eei", PRO_BOOL, false, ON, &extra_expression_indent, &exp_eei}, {"ei", PRO_BOOL, true, ON, &else_if, &exp_ei}, {"fbc", PRO_FONT, 0, ONOFF_NA, (int *) &blkcomf, &exp_fbc}, {"fbx", PRO_FONT, 0, ONOFF_NA, (int *) &boxcomf, &exp_fbx}, {"fb", PRO_FONT, 0, ONOFF_NA, (int *) &bodyf, &exp_fb}, {"fc1", PRO_BOOL, true, ON, &format_col1_comments, &exp_fc1}, {"fca", PRO_BOOL, false, ON, &format_comments, &exp_fca}, {"fc", PRO_FONT, 0, ONOFF_NA, (int *) &scomf, &exp_fc}, {"fk", PRO_FONT, 0, ONOFF_NA, (int *) &keywordf, &exp_fk}, {"fs", PRO_FONT, 0, ONOFF_NA, (int *) &stringf, &exp_fs}, /* This is now the default. */ {"gnu", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-bl\0-ncdb\0-cs\0-nce\0-di2\0-ndj\0\ -ei\0-nfc1\0-i2\0-ip5\0-lp\0-pcs\0-nps\0-psl\0-nsc\0-nsob\0-bli4\0\ -cp1\0-nfca\0", &exp_gnu}, {"ip", PRO_INT, 5, ON, &indent_parameters, &exp_ip}, {"i", PRO_INT, 2, ONOFF_NA, &ind_size, &exp_i}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-br\0-c33\0-cd33\0-ncdb\0-ce\0\ -ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i4\0-ip0\0-l75\0-lp\0-npcs\0-npsl\0-cs\0\ -nsc\0-nsc\0-nsob\0-nfca\0-cp33\0-nss\0", &exp_kr}, {"lc", PRO_INT, 0, ONOFF_NA, &block_comment_max_col, &exp_lc}, {"lps", PRO_BOOL, true, ON, &leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens, &exp_lp}, {"l", PRO_INT, 78, ONOFF_NA, &max_col, &exp_l}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation, &exp_bacc}, {"nbadp", PRO_BOOL, false, OFF, &blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations, &exp_bad}, {"nbap", PRO_BOOL, true, OFF, &blanklines_after_procs, &exp_bap}, {"nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments, &exp_bbb}, {"nbc", PRO_BOOL, true, ON, &leave_comma, &exp_bc}, {"nbs", PRO_BOOL, false, OFF, &blank_after_sizeof, &exp_bs}, {"ncdb", PRO_BOOL, false, OFF, &comment_delimiter_on_blankline, &exp_cdb}, {"nce", PRO_BOOL, false, OFF, &cuddle_else, &exp_ce}, {"ncs", PRO_BOOL, true, OFF, &cast_space, &exp_cs}, {"ndj", PRO_BOOL, false, OFF, &ljust_decl, &exp_dj}, {"neei", PRO_BOOL, false, OFF, &extra_expression_indent, &exp_eei}, {"nei", PRO_BOOL, true, OFF, &else_if, &exp_ei}, {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments, &exp_fc1}, {"nfca", PRO_BOOL, false, OFF, &format_comments, &exp_fca}, {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0\0", &exp_nip}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens, &exp_lp}, {"npcs", PRO_BOOL, true, OFF, &proc_calls_space, &exp_pcs}, {"npro", PRO_IGN, 0, ONOFF_NA, 0, &exp_pro}, {"npsl", PRO_BOOL, true, OFF, &procnames_start_line, &exp_psl}, {"nps", PRO_BOOL, false, OFF, &pointer_as_binop, &exp_ps}, {"nsc", PRO_BOOL, false, OFF, &star_comment_cont, &exp_sc}, {"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines, &exp_sob}, {"nss", PRO_BOOL, false, OFF, &space_sp_semicolon, &exp_ss}, {"nv", PRO_BOOL, false, OFF, &verbose, &exp_v}, {"orig", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbap\0-nbad\0-nbbb\0-bc\0-br\0-c33\0-cd33\0-cdb\0-ce\0-ci4\0\ -cli0\0-cp33\0-di16\0-fc1\0-fca\0-i4\0-ip4\0-l75\0-lp\0\ -npcs\0-psl\0-sc\0-nsob\0-nss\0-ts8\0", &exp_orig}, {"o", PRO_BOOL, false, ON, &expect_output_file, &expect_output_file}, {"pcs", PRO_BOOL, true, ON, &proc_calls_space, &exp_pcs}, {"psl", PRO_BOOL, true, ON, &procnames_start_line, &exp_psl}, {"ps", PRO_BOOL, false, ON, &pointer_as_binop, &exp_ps}, {"sc", PRO_BOOL, false, ON, &star_comment_cont, &exp_sc}, {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines, &exp_sob}, {"ss", PRO_BOOL, false, ON, &space_sp_semicolon, &exp_ss}, {"st", PRO_BOOL, false, ON, &use_stdout, &exp_st}, {"troff", PRO_BOOL, false, ON, &troff, &exp_troff}, {"ts", PRO_INT, 8, ONOFF_NA, &tabsize, &exp_ts}, {"version", PRO_PRSTRING, 0, ONOFF_NA, (int *) VERSION_STRING, &exp_version}, {"v", PRO_BOOL, false, ON, &verbose, &exp_v}, /* Signify end of structure. */ {0, PRO_IGN, 0, ONOFF_NA, 0, 0} }; #endif /* GNU defaults */ struct long_option_conversion { char *long_name; char *short_name; }; struct long_option_conversion option_conversions[] = { {"blank-lines-after-ifdefs", "bacc"}, {"blank-lines-after-procedure-declarations", "badp"}, {"blank-lines-after-declarations", "bad"}, {"blank-lines-after-procedures", "bap"}, {"blank-lines-after-block-comments", "bbb"}, {"blank-lines-after-commas", "bc"}, {"brace-indent", "bli"}, {"braces-after-if-line", "bl"}, {"braces-on-if-line", "br"}, {"Bill-Shannon", "bs"}, {"blank-before-sizeof", "bs"}, {"comment-delimiters-on-blank-lines", "cdb"}, {"declaration-comment-column", "cd"}, {"cuddle-else", "ce"}, {"continuation-indentation", "ci"}, {"case-indentation", "cli"}, {"else-endif-column", "cp"}, {"space-after-cast", "cs"}, {"comment-indentation", "c"}, {"declaration-indentation", "di"}, {"left-justify-declarations", "dj"}, {"line-comments-indentation", "d"}, {"extra-expression-indentation", "eei"}, {"else-if", "ei"}, {"*", "fbc"}, {"*", "fbx"}, {"*", "fb"}, {"format-first-column-comments", "fc1"}, {"format-all-comments", "fca"}, {"*", "fc"}, {"*", "fk"}, {"*", "fs"}, {"gnu-style", "gnu"}, {"parameter-indentation", "ip"}, {"indentation-level", "i"}, {"indent-level", "i"}, {"k-and-r-style", "kr"}, {"kernighan-and-ritchie-style", "kr"}, {"kernighan-and-ritchie", "kr"}, {"*", "lc"}, {"continue-at-parentheses", "lp"}, {"leave-preprocessor-space", "lps"}, {"line-length", "l"}, {"no-blank-lines-after-ifdefs", "nbacc"}, {"no-blank-lines-after-procedure-declarations", "nbadp"}, {"no-blank-lines-after-declarations", "nbad"}, {"no-blank-lines-after-procedures", "nbap"}, {"no-blank-lines-after-block-comments", "nbbb"}, {"no-blank-lines-after-commas", "nbc"}, {"no-Bill-Shannon", "nbs"}, {"no-blank-before-sizeof", "nbs"}, {"no-comment-delimiters-on-blank-lines", "ncdb"}, {"dont-cuddle-else", "nce"}, {"no-space-after-casts", "ncs"}, {"dont-left-justify-declarations", "ndj"}, {"no-extra-expression-indentation", "neei"}, {"no-else-if", "nei"}, {"dont-format-first-column-comments", "nfc1"}, {"dont-format-comments", "nfca"}, {"no-parameter-indentation", "nip"}, {"dont-indent-parameters", "nip"}, {"dont-line-up-parentheses", "nlp"}, {"no-space-after-function-call-names", "npcs"}, {"ignore-profile", "npro"}, {"dont-break-procedure-type", "npsl"}, {"*", "nps"}, {"dont-star-comments", "nsc"}, {"leave-optional-blank-lines", "nsob"}, {"dont-space-special-semicolon", "nss"}, {"no-verbosity", "nv"}, {"output", "o"}, {"output-file", "o"}, {"original", "orig"}, {"original-style", "orig"}, {"berkeley-style", "orig"}, {"berkeley", "orig"}, {"space-after-procedure-calls", "pcs"}, {"procnames-start-lines", "psl"}, {"pointer-as-binary-op", "ps"}, {"start-left-side-of-comments", "sc"}, {"swallow-optional-blank-lines", "sob"}, {"space-special-semicolon", "ss"}, {"standard-output", "st"}, {"troff-formatting", "troff"}, {"tab-size", "ts"}, {"version", "version"}, {"verbose", "v"}, {0, 0}, }; /* S1 should be a string. S2 should be a string, perhaps followed by an argument. Compare the two, returning true if they are equal, and if they are equal set *START_PARAM to point to the argument in S2. */ static int eqin (s1, s2, start_param) register char *s1; register char *s2; char **start_param; { while (*s1) { if (*s1++ != *s2++) return (false); } *start_param = s2; return (true); } /* Set the defaults. */ void set_defaults () { register struct pro *p; for (p = pro; p->p_name; p++) if (p->p_type == PRO_BOOL || p->p_type == PRO_INT) *p->p_obj = p->p_default; } /* Stings which can prefix an option, longest first. */ static char *option_prefixes[] = { "--", "-", "+", 0 }; static int option_prefix (arg) char *arg; { register char **prefixes = option_prefixes; register char *this_prefix, *argp; do { this_prefix = *prefixes; argp = arg; while (*this_prefix == *argp) { this_prefix++; argp++; } if (*this_prefix == '\0') return this_prefix - *prefixes; } while (* ++prefixes); return 0; } /* Process an option ARG (e.g. "-l60"). EXPLICIT should be nonzero iff the argument is being explicitly specified (as opposed to being taken from a PRO_SETTINGS group of settings). */ int set_option (option, param, explicit) char *option, *param; int explicit; { struct pro *p = pro; char *param_start; register int option_length, val; val = 0; option_length = option_prefix (option); if (option_length > 0) { if (option_length == 1 && *option == '-') /* Short option prefix */ { option++; for (p = pro; p->p_name; p++) if (*p->p_name == *option && eqin (p->p_name, option, ¶m_start)) goto found; } else /* Long prefix */ { register struct long_option_conversion *o = option_conversions; option += option_length; while (o->short_name) { if (eqin (o->long_name, option, ¶m_start)) break; o++; } /* Searching twice means we don't have to keep the two tables in sync. */ if (o->short_name) for (p = pro; p->p_name; p++) if (!strcmp (p->p_name, o->short_name)) goto found; } } fprintf (stderr, "indent: unknown option \"%s\"\n", option - 1); exit (1); arg_missing: fprintf (stderr, "indent: missing argument to parameter %s\n", option); exit (1); found: /* If the parameter has been explicitly specified, we don't want a group of bundled settings to override the explicit setting. */ if (verbose) fprintf (stderr, "option: %s\n", p->p_name); if (explicit || ! *(p->p_explicit)) { if (explicit) *(p->p_explicit) = 1; switch (p->p_type) { case PRO_PRSTRING: puts ((char *) p->p_obj); exit (0); case PRO_SETTINGS: { char *t; /* current position */ t = (char *) p->p_obj; do { set_option (t, 0); /* advance to character following next NUL */ while (*t++); } while (*t); } case PRO_IGN: break; case PRO_KEY: { register char *str; if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; str = (char *) xmalloc (strlen (param_start) + 1); strcpy (str, param_start); addkey (str, rw_decl); } break; case PRO_BOOL: if (p->p_special == OFF) *p->p_obj = false; else *p->p_obj = true; break; case PRO_INT: if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; if (!isdigit (*param_start)) { fprintf (stderr, "indent: option ``%s'' requires a numeric parameter\n", option - 1); exit (1); } *p->p_obj = atoi (param_start); break; case PRO_FONT: if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; parsefont ((struct fstate *) p->p_obj, param_start); break; default: fprintf (stderr, "indent: set_option: internal error: p_type %d\n", p->p_type); exit (1); } } return val; } /* Scan the options in the file F. */ static void scan_profile (f) register FILE *f; { register int i; register char *p, *this, *next, *temp; char b0[BUFSIZ]; char b1[BUFSIZ]; next = b0; this = 0; while (1) { for (p = next; (i = getc (f)) != EOF && (*p = i) > ' '; ++p); if (p != next) { *p++ = 0; if (!this) { this = b0; next = b1; continue; } if (set_option (this, next, 1)) { this = 0; next = b0; continue; } temp = this; this = next; next = temp; } else if (i == EOF) { if (this) set_option (this, 0, 1); return; } } } /* Some operating systems don't allow more than one dot in a filename. */ #if defined (ONE_DOT_PER_FILENAME) #define INDENT_PROFILE "indent.pro" #else #define INDENT_PROFILE ".indent.pro" #endif /* set_profile looks for ./.indent.pro or $HOME/.indent.pro, in that order, and reads the options given in that file. Return the path of the file read. Note that as of version 1.3, indent only reads one file. */ char * set_profile () { register FILE *f; char *fname; static char prof[] = INDENT_PROFILE; char *homedir; if ((f = fopen (INDENT_PROFILE, "r")) != NULL) { int len = strlen (INDENT_PROFILE) + 3; scan_profile (f); (void) fclose (f); fname = xmalloc (len); fname[0] = '.'; fname[1] = '/'; memcpy (&fname[2], INDENT_PROFILE, len - 3); fname[len - 1] = '\0'; return fname; } homedir = getenv ("HOME"); if (homedir) { fname = xmalloc (strlen (homedir) + 10 + sizeof prof); sprintf (fname, "%s/%s", homedir, prof); if ((f = fopen (fname, "r")) != NULL) { scan_profile (f); (void) fclose (f); return fname; } free (fname); } return 0; } indent-2.2.11/regression/standard/newlines.c-00000644000177400010010000000201410775646104016106 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR Now here are some blank lines: IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/cplus.c-50000644000177400010010000000175510775646104015430 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here is a very long C plus plus // comment very long C plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very long C plus plus comment // Here is a very long C plus plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/outer.c-60000644000177400010010000000207110775646104015431 00000000000000/* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted * permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the * closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/standard/parse.c0000644000177400010010000004327110775646104015251 00000000000000/* Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" struct parser_state *parser_state_tos; #define INITIAL_BUFFER_SIZE 1000 #define INITIAL_STACK_SIZE 2 void init_parser () { parser_state_tos = (struct parser_state *) xmalloc (sizeof (struct parser_state)); parser_state_tos->p_stack_size = INITIAL_STACK_SIZE; parser_state_tos->p_stack = (enum codes *) xmalloc (INITIAL_STACK_SIZE * sizeof (enum codes)); parser_state_tos->il = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int)); parser_state_tos->cstk = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int)); parser_state_tos->paren_indents = (short *) xmalloc (sizeof (short)); /* Although these are supposed to grow if we reach the end, I can find no place in the code which does this. */ combuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); labbuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); codebuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); save_com.size = INITIAL_BUFFER_SIZE; save_com.end = save_com.ptr = xmalloc (save_com.size); di_stack_alloc = 2; di_stack = (int *) xmalloc (di_stack_alloc * sizeof (*di_stack)); } void reset_parser () { parser_state_tos->next = 0; parser_state_tos->tos = 0; parser_state_tos->paren_indents_size = 1; parser_state_tos->p_stack[0] = stmt; /* this is the parser's stack */ parser_state_tos->last_nl = true; /* this is true if the last thing scanned was a newline */ parser_state_tos->last_token = semicolon; parser_state_tos->box_com = false; parser_state_tos->comment_delta = 0; parser_state_tos->n_comment_delta = 0; parser_state_tos->cast_mask = 0; parser_state_tos->noncast_mask = 0; parser_state_tos->sizeof_mask = 0; parser_state_tos->block_init = false; parser_state_tos->block_init_level = 0; parser_state_tos->col_1 = false; parser_state_tos->com_col = 0; parser_state_tos->dec_nest = 0; parser_state_tos->i_l_follow = 0; parser_state_tos->ind_level = 0; parser_state_tos->last_u_d = false; parser_state_tos->p_l_follow = 0; parser_state_tos->paren_level = 0; parser_state_tos->paren_depth = 0; parser_state_tos->search_brace = false; parser_state_tos->use_ff = false; parser_state_tos->its_a_keyword = false; parser_state_tos->sizeof_keyword = false; parser_state_tos->dumped_decl_indent = false; parser_state_tos->in_parameter_declaration = false; parser_state_tos->just_saw_decl = false; parser_state_tos->in_decl = false; parser_state_tos->decl_on_line = false; parser_state_tos->in_or_st = false; parser_state_tos->bl_line = true; parser_state_tos->want_blank = false; parser_state_tos->in_stmt = false; parser_state_tos->ind_stmt = false; parser_state_tos->procname = "\0"; parser_state_tos->procname_end = "\0"; parser_state_tos->pcase = false; parser_state_tos->dec_nest = 0; di_stack[parser_state_tos->dec_nest] = 0; l_com = combuf + INITIAL_BUFFER_SIZE - 5; l_lab = labbuf + INITIAL_BUFFER_SIZE - 5; l_code = codebuf + INITIAL_BUFFER_SIZE - 5; combuf[0] = codebuf[0] = labbuf[0] = ' '; combuf[1] = codebuf[1] = labbuf[1] = '\0'; else_if = 1; else_or_endif = false; s_lab = e_lab = labbuf + 1; s_code = e_code = codebuf + 1; s_com = e_com = combuf + 1; line_no = 1; had_eof = false; break_comma = false; bp_save = 0; be_save = 0; } /* like ++parser_state_tos->tos but checks for stack overflow and extends stack if necessary. */ static int inc_pstack () { if (++parser_state_tos->tos >= parser_state_tos->p_stack_size) { parser_state_tos->p_stack_size *= 2; parser_state_tos->p_stack = (enum codes *) xrealloc (parser_state_tos->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); parser_state_tos->il = (int *) xrealloc (parser_state_tos->il, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->cstk = (int *) xrealloc (parser_state_tos->cstk, parser_state_tos->p_stack_size * sizeof (int)); } return parser_state_tos->tos; } #ifdef DEBUG static char **debug_symbol_strings; void debug_init () { int size = ((int) period + 4) * sizeof (char *); debug_symbol_strings = (char **) xmalloc (size); debug_symbol_strings[code_eof] = "code_eof"; debug_symbol_strings[newline] = "newline"; debug_symbol_strings[lparen] = "lparen"; debug_symbol_strings[rparen] = "rparen"; debug_symbol_strings[unary_op] = "unary_op"; debug_symbol_strings[binary_op] = "binary_op"; debug_symbol_strings[postop] = "postop"; debug_symbol_strings[question] = "question"; debug_symbol_strings[casestmt] = "casestmt"; debug_symbol_strings[colon] = "colon"; debug_symbol_strings[semicolon] = "semicolon"; debug_symbol_strings[lbrace] = "lbrace"; debug_symbol_strings[rbrace] = "rbrace"; debug_symbol_strings[ident] = "ident"; debug_symbol_strings[comma] = "comma"; debug_symbol_strings[comment] = "comment"; debug_symbol_strings[swstmt] = "swstmt"; debug_symbol_strings[preesc] = "preesc"; debug_symbol_strings[form_feed] = "form_feed"; debug_symbol_strings[decl] = "decl"; debug_symbol_strings[sp_paren] = "sp_paren"; debug_symbol_strings[sp_nparen] = "sp_nparen"; debug_symbol_strings[ifstmt] = "ifstmt"; debug_symbol_strings[whilestmt] = "whilestmt"; debug_symbol_strings[forstmt] = "forstmt"; debug_symbol_strings[stmt] = "stmt"; debug_symbol_strings[stmtl] = "stmtl"; debug_symbol_strings[elselit] = "elselit"; debug_symbol_strings[dolit] = "dolit"; debug_symbol_strings[dohead] = "dohead"; debug_symbol_strings[dostmt] = "dostmt"; debug_symbol_strings[ifhead] = "ifhead"; debug_symbol_strings[elsehead] = "elsehead"; debug_symbol_strings[period] = "period"; } #endif void parse (tk) enum codes tk; /* the code for the construct scanned */ { int i; #ifdef DEBUG if (debug) { if (tk >= code_eof && tk <= period) printf ("Parse: %s\n", debug_symbol_strings[tk]); else printf ("Parse: Unknown code: %d for %s\n", tk, token ? token : "NULL"); } #endif while (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && tk != elselit) { /* true if we have an if without an else */ /* apply the if(..) stmt ::= stmt reduction */ parser_state_tos->p_stack[parser_state_tos->tos] = stmt; reduce (); /* see if this allows any reduction */ } switch (tk) { /* go on and figure out what to do with the input */ case decl: /* scanned a declaration word */ parser_state_tos->search_brace = btype_2; /* indicate that following brace should be on same line */ if (parser_state_tos->p_stack[parser_state_tos->tos] != decl) { /* only put one declaration onto stack */ break_comma = true; /* while in declaration, newline should be forced after comma */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = decl; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; if (ljust_decl) { /* only do if we want left justified declarations */ parser_state_tos->ind_level = 0; for (i = parser_state_tos->tos - 1; i > 0; --i) if (parser_state_tos->p_stack[i] == decl) /* indentation is number of declaration levels deep we are times spaces per level */ parser_state_tos->ind_level += ind_size; parser_state_tos->i_l_follow = parser_state_tos->ind_level; } } break; case ifstmt: /* scanned if (...) */ if (parser_state_tos->p_stack[parser_state_tos->tos] == elsehead && else_if) /* "else if ..." */ parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; case dolit: /* 'do' */ case forstmt: /* for (...) */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = tk; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->i_l_follow += ind_size; /* subsequent statements should be indented 1 */ parser_state_tos->search_brace = btype_2; break; case lbrace: /* scanned { */ break_comma = false; /* don't break comma in an initial list */ if (parser_state_tos->p_stack[parser_state_tos->tos] == stmt || parser_state_tos->p_stack[parser_state_tos->tos] == stmtl) /* it is a random, isolated stmt group or a declaration */ parser_state_tos->i_l_follow += ind_size; else if (parser_state_tos->p_stack[parser_state_tos->tos] == decl) { parser_state_tos->i_l_follow += ind_size; if (parser_state_tos->last_rw == rw_struct_like && !btype_2 && !parser_state_tos->col_1) { parser_state_tos->ind_level += brace_indent; parser_state_tos->i_l_follow += brace_indent; } } else { if (s_code == e_code) { /* only do this if there is nothing on the line */ parser_state_tos->ind_level -= ind_size; /* it is a group as part of a while, for, etc. */ /* For -bl formatting, indent by brace_indent additional spaces e.g. if (foo == bar) { <--> brace_indent spaces (in this example, 4) */ if (!btype_2) { parser_state_tos->ind_level += brace_indent; parser_state_tos->i_l_follow += brace_indent; if (parser_state_tos->p_stack[parser_state_tos->tos] == swstmt) case_ind += brace_indent; } if (parser_state_tos->p_stack[parser_state_tos->tos] == swstmt && case_indent >= ind_size) parser_state_tos->ind_level -= ind_size; /* for a switch, brace should be two levels out from the code */ } } inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = lbrace; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; /* allow null stmt between braces */ parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; break; case whilestmt: /* scanned while (...) */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dohead) { /* it is matched with do stmt */ parser_state_tos->ind_level = parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = whilestmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level = parser_state_tos->i_l_follow; } else { /* it is a while loop */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = whilestmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; parser_state_tos->i_l_follow += ind_size; parser_state_tos->search_brace = btype_2; } break; case elselit: /* scanned an else */ if (parser_state_tos->p_stack[parser_state_tos->tos] != ifhead) diag (1, "Unmatched 'else'"); else { /* indentation for else should be same as for if */ parser_state_tos->ind_level = parser_state_tos->il[parser_state_tos->tos]; /* everything following should be in 1 level */ parser_state_tos->i_l_follow = (parser_state_tos->ind_level + ind_size); parser_state_tos->p_stack[parser_state_tos->tos] = elsehead; /* remember if with else */ parser_state_tos->search_brace = btype_2 | else_if; } break; case rbrace: /* scanned a } */ /* stack should have or */ if (parser_state_tos->p_stack[parser_state_tos->tos - 1] == lbrace) { parser_state_tos->ind_level = parser_state_tos->i_l_follow = parser_state_tos->il[--parser_state_tos->tos]; parser_state_tos->p_stack[parser_state_tos->tos] = stmt; } else diag (1, "Stmt nesting error."); break; case swstmt: /* had switch (...) */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = swstmt; parser_state_tos->cstk[parser_state_tos->tos] = case_ind; /* save current case indent level */ parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; case_ind = parser_state_tos->i_l_follow + case_indent; /* cases should be one level down from switch */ /* statements should be two levels in */ parser_state_tos->i_l_follow += case_indent + ind_size; parser_state_tos->search_brace = btype_2; break; case semicolon: /* this indicates a simple stmt */ break_comma = false; /* turn off flag to break after commas in a declaration */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dostmt) { parser_state_tos->p_stack[parser_state_tos->tos] = stmt; } else { inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; } break; default: /* this is an error */ diag (1, "Unknown code to parser"); return; } /* end of switch */ reduce (); /* see if any reduction can be done */ #ifdef DEBUG if (debug) { printf ("\nParseStack [%d]:\n", parser_state_tos->p_stack_size); for (i = 1; i <= parser_state_tos->tos; ++i) printf (" stack[%d] => stack: %d ind_level: %d\n", i, parser_state_tos->p_stack[i], parser_state_tos->il[i]); printf ("\n"); } #endif return; } /* NAME: reduce FUNCTION: Implements the reduce part of the parsing algorithm ALGORITHM: The following reductions are done. Reductions are repeated until no more are possible. Old TOS New TOS do dohead if "ifstmt" switch decl "ifelse" for while "dostmt" while On each reduction, parser_state_tos->i_l_follow (the indentation for the following line) is set to the indentation level associated with the old TOS. PARAMETERS: None RETURNS: Nothing GLOBALS: parser_state_tos->cstk parser_state_tos->i_l_follow = parser_state_tos->il parser_state_tos->p_stack = parser_state_tos->tos = CALLS: None CALLED BY: parse HISTORY: initial coding November 1976 D A Willcox of CAC */ /*----------------------------------------------*\ | REDUCTION PHASE | \*----------------------------------------------*/ reduce () { register int i; for (;;) { /* keep looping until there is nothing left to reduce */ switch (parser_state_tos->p_stack[parser_state_tos->tos]) { case stmt: switch (parser_state_tos->p_stack[parser_state_tos->tos - 1]) { case stmt: case stmtl: /* stmtl stmt or stmt stmt */ parser_state_tos->p_stack[--parser_state_tos->tos] = stmtl; break; case dolit: /* */ parser_state_tos->p_stack[--parser_state_tos->tos] = dohead; parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; break; case ifstmt: /* */ parser_state_tos->p_stack[--parser_state_tos->tos] = ifhead; for (i = parser_state_tos->tos - 1; (parser_state_tos->p_stack[i] != stmt && parser_state_tos->p_stack[i] != stmtl && parser_state_tos->p_stack[i] != lbrace); --i); parser_state_tos->i_l_follow = parser_state_tos->il[i]; /* for the time being, we will assume that there is no else on this if, and set the indentation level accordingly. If an else is scanned, it will be fixed up later */ break; case swstmt: /* */ case_ind = parser_state_tos->cstk[parser_state_tos->tos - 1]; case decl: /* finish of a declaration */ case elsehead: /* < else> */ case forstmt: /* */ case whilestmt: /* */ parser_state_tos->p_stack[--parser_state_tos->tos] = stmt; parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; break; default: /* */ return; } /* end of section for on top of stack */ break; case whilestmt: /* while (...) on top */ if (parser_state_tos->p_stack[parser_state_tos->tos - 1] == dohead) { /* it is termination of a do while */ #if 0 parser_state_tos->p_stack[--parser_state_tos->tos] = stmt; #endif parser_state_tos->p_stack[--parser_state_tos->tos] = dostmt; break; } else return; default: /* anything else on top */ return; } } } /* This kludge is called from main. It is just like parse(semicolon) except that it does not clear break_comma. Leaving break_comma alone is necessary to make sure that "int foo(), bar()" gets formatted correctly under -bc. */ INLINE void parse_lparen_in_decl () { inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; reduce (); } indent-2.2.11/regression/standard/pr_comment.c.~1~0000644000177400010010000003250311145773151017024 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* NAME: pr_comment FUNCTION: This routine takes care of scanning and printing comments. ALGORITHM: 1) Decide where the comment should be aligned, and if lines should be broken. 2) If lines should not be broken and filled, just copy up to end of comment. 3) If lines should be filled, then scan thru input_buffer copying characters to com_buf. Remember where the last blank, tab, or newline was. When line is filled, print up to last blank and continue copying. HISTORY: November 1976 D A Willcox of CAC Initial coding 12/6/76 A Willcox of CAC Modification to handle UNIX-style comments */ /* this routine processes comments. It makes an attempt to keep comments from going over the max line length. If a line is too long, it moves everything from the last blank to the next comment line. Blanks and tabs from the beginning of the input line are removed */ #include "sys.h" #include "indent.h" /* Declared and documented in indent.h. */ int out_coms; pr_comment () { int now_col; /* column we are in now */ int adj_max_col; /* Adjusted max_col for when we decide to spill comments over the right margin */ char *last_bl; /* points to the last blank in the output buffer */ char *t_ptr; /* used for moving string */ int unix_comment; /* tri-state variable used to decide if it is a unix-style comment. 0 means only blanks since /*, 1 means regular style comment, 2 means unix style comment */ int break_delim = comment_delimiter_on_blankline; int l_just_saw_decl = parser_state_tos->just_saw_decl; /* int parser_state_tos->last_nl = 0; /* true iff the last significant thing weve seen is a newline */ int one_liner = 1; /* true iff this comment is a one-liner */ adj_max_col = max_col; parser_state_tos->just_saw_decl = 0; last_bl = 0; /* no blanks found so far */ parser_state_tos->box_com = false; /* at first, assume that we are not in a boxed comment or some other comment that should not be touched */ ++out_coms; /* keep track of number of comments */ unix_comment = 1; /* set flag to let us figure out if there is a unix-style comment ** DISABLED: use 0 to reenable this hack! */ /* Figure where to align and how to treat the comment */ if (parser_state_tos->col_1 && !format_col1_comments) { /* if comment starts in column 1 it should not be touched */ parser_state_tos->box_com = true; parser_state_tos->com_col = 1; } else { if (*buf_ptr == '-' || *buf_ptr == '*' || !format_comments) { parser_state_tos->box_com = true; /* a comment with a '-' or '*' immediately after the /* is assumed to be a boxed comment */ break_delim = 0; } /* Used to also check that parser_state_tos->bl_line != 0 */ if ((s_lab == e_lab) && (s_code == e_code)) { /* klg: check only if this line is blank */ /* If this (*and previous lines are*) blank, dont put comment way out at left */ parser_state_tos->com_col = (parser_state_tos->ind_level - unindent_displace) + 1; adj_max_col = block_comment_max_col; if (parser_state_tos->com_col <= 1) parser_state_tos->com_col = 1 + !format_col1_comments; /* If we have a comment in an old-style (pre-ANSI) parameter declaration, indent it like we would the parameter declaration. For example: int destroy (what) / * N things to destroy. * / int what; */ if (parser_state_tos->in_parameter_declaration && indent_parameters != 0 && parser_state_tos->dec_nest == 0) { parser_state_tos->com_col = indent_parameters + 1; parser_state_tos->ind_stmt = 0; } } else { register target_col; break_delim = 0; if (s_code != e_code) target_col = count_spaces (compute_code_target (), s_code); else { target_col = 1; if (s_lab != e_lab) target_col = count_spaces (compute_label_target (), s_lab); } parser_state_tos->com_col = parser_state_tos->decl_on_line || parser_state_tos->ind_level == 0 ? decl_com_ind : com_ind; /* If we are already past the position for the comment, put it at the next tab stop. */ if (parser_state_tos->com_col < target_col) parser_state_tos->com_col = ((target_col + (tabsize - 1)) & ~(tabsize - 1)) + 1; if (else_or_endif) { parser_state_tos->com_col = else_endif_col; else_or_endif = false; /* We want the comment to appear one space after the #else or #endif. */ if (parser_state_tos->com_col < target_col) parser_state_tos->com_col = target_col + 1; } if (parser_state_tos->com_col + 24 > adj_max_col) adj_max_col = parser_state_tos->com_col + 24; } } if (parser_state_tos->box_com) { parser_state_tos->n_comment_delta = 1 - parser_state_tos->com_col; #if 0 buf_ptr[-2] = 0; parser_state_tos->n_comment_delta = 1 - count_spaces (1, cur_line); buf_ptr[-2] = '/'; #endif } else { parser_state_tos->n_comment_delta = 0; while (*buf_ptr == ' ' || *buf_ptr == '\t') buf_ptr++; } parser_state_tos->comment_delta = 0; *e_com++ = '/'; /* put '/*' into buffer */ *e_com++ = '*'; if (*buf_ptr != ' ' && !parser_state_tos->box_com) *e_com++ = ' '; *e_com = '\0'; if (troff) { now_col = 1; adj_max_col = 80; } else /* figure what column we would be in if we printed the comment now */ now_col = count_spaces (parser_state_tos->com_col, s_com); /* Start to copy the comment */ while (1) { /* this loop will go until the comment is copied */ if (*buf_ptr > 040 && *buf_ptr != '*') parser_state_tos->last_nl = 0; check_com_size; switch (*buf_ptr) { /* this checks for various spcl cases */ case 014: /* check for a form feed */ if (!parser_state_tos->box_com) { /* in a text comment, break the line here */ parser_state_tos->use_ff = true; /* fix so dump_line uses a form feed */ dump_line (); last_bl = 0; *e_com++ = ' '; *e_com++ = '*'; *e_com++ = ' '; while (* ++buf_ptr == ' ' || *buf_ptr == '\t'); } else { if (++buf_ptr >= buf_end) fill_buffer (); *e_com++ = 014; } break; case '\n': if (had_eof) { /* check for unexpected eof */ printf ("Unterminated comment\n"); *e_com = '\0'; dump_line (); return; } one_liner = 0; if (parser_state_tos->box_com || parser_state_tos->last_nl) { /* if this is a boxed comment, we dont ignore the newline */ if (s_com == e_com) { *e_com++ = ' '; *e_com++ = ' '; } *e_com = '\0'; if (!parser_state_tos->box_com && e_com - s_com > 3) { if (break_delim == 1 && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } dump_line (); check_com_size; *e_com++ = ' '; *e_com++ = ' '; } dump_line (); now_col = parser_state_tos->com_col; } else { parser_state_tos->last_nl = 1; if (unix_comment != 1) { /* we not are in unix_style comment */ if (unix_comment == 0 && s_code == e_code) { /* if it is a UNIX-style comment, ignore the requirement that previous line be blank for unindention */ parser_state_tos->com_col = ((parser_state_tos->ind_level - unindent_displace) + ind_size); if (parser_state_tos->com_col <= 1) parser_state_tos->com_col = 2; } unix_comment = 2; /* permanently remember that we are in this type of comment */ dump_line (); ++line_no; now_col = parser_state_tos->com_col; *e_com++ = ' '; /* fix so that the star at the start of the line will line up */ do /* flush leading white space */ if (++buf_ptr >= buf_end) fill_buffer (); while (*buf_ptr == ' ' || *buf_ptr == '\t'); break; } if (*(e_com - 1) == ' ' || *(e_com - 1) == '\t') last_bl = e_com - 1; /* if there was a space at the end of the last line, remember where it was */ else { /* otherwise, insert one */ last_bl = e_com; check_com_size; *e_com++ = ' '; ++now_col; } } ++line_no; /* keep track of input line number */ if (!parser_state_tos->box_com) { int nstar = 1; do { /* flush any blanks and/or tabs at start of next line */ if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '*' && --nstar >= 0) { if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '/') goto end_of_comment; } } while (*buf_ptr == ' ' || *buf_ptr == '\t'); } else if (++buf_ptr >= buf_end) fill_buffer (); break; /* end of case for newline */ case '*': /* must check for possibility of being at end of comment */ if (++buf_ptr >= buf_end) /* get to next char after * */ fill_buffer (); if (unix_comment == 0) /* set flag to show we are not in unix-style comment */ unix_comment = 1; if (*buf_ptr == '/') { /* it is the end!!! */ end_of_comment: if (++buf_ptr >= buf_end) fill_buffer (); if (*(e_com - 1) != ' ' && !parser_state_tos->box_com) { /* insure blank before end */ *e_com++ = ' '; ++now_col; } if (break_delim == 1 && !one_liner && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } if (break_delim == 2 && e_com > s_com + 3 /* now_col > adj_max_col - 2 && !parser_state_tos->box_com */ ) { *e_com = '\0'; dump_line (); now_col = parser_state_tos->com_col; } check_com_size; *e_com++ = '*'; *e_com++ = '/'; *e_com = '\0'; parser_state_tos->just_saw_decl = l_just_saw_decl; return; } else { /* handle isolated '*' */ *e_com++ = '*'; ++now_col; } break; default: /* we have a random char */ if (unix_comment == 0 && *buf_ptr != ' ' && *buf_ptr != '\t') unix_comment = 1; /* we are not in unix-style comment */ *e_com = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); if (*e_com == '\t') /* keep track of column */ now_col = now_col + tabsize - (now_col - 1) % tabsize; else if (*e_com == '\b') /* this is a backspace */ --now_col; else ++now_col; if (*e_com == ' ' || *e_com == '\t') last_bl = e_com; /* remember we saw a blank */ ++e_com; if (now_col > adj_max_col && !parser_state_tos->box_com && unix_comment == 1 && e_com[-1] > ' ') { /* the comment is too long, it must be broken up */ if (break_delim == 1 && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } if (last_bl == 0) { /* we have seen no blanks */ last_bl = e_com; /* fake it */ *e_com++ = ' '; } *e_com = '\0'; /* print what we have */ *last_bl = '\0'; while (last_bl > s_com && last_bl[-1] < 040) * --last_bl = 0; e_com = last_bl; dump_line (); *e_com++ = ' '; /* add blanks for continuation */ *e_com++ = ' '; *e_com++ = ' '; t_ptr = last_bl + 1; last_bl = 0; if (t_ptr >= e_com) { while (*t_ptr == ' ' || *t_ptr == '\t') t_ptr++; while (*t_ptr != '\0') { /* move unprinted part of comment down in buffer */ if (*t_ptr == ' ' || *t_ptr == '\t') last_bl = e_com; *e_com++ = *t_ptr++; } } *e_com = '\0'; /* recompute current position */ now_col = count_spaces (parser_state_tos->com_col, s_com); } break; } } } indent-2.2.11/regression/standard/label.c0000644000177400010010000000030410775646104015204 00000000000000function() { if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; } indent-2.2.11/regression/standard/lshift.c0000644000177400010010000000010510775646104015415 00000000000000main () { int size; for (size_ = 32; size_ < n; size_ <<= 1); } indent-2.2.11/regression/standard/dont-line-up-parentheses.c0000644000177400010010000000030610775646104020761 00000000000000void t () { if ((really_long_variable_name_like_this = some_funct_group_create (mixer, SND_MIXER_GRP_IGAIN, igain_group_control, parameter5, parameter6, parameter7)) == NULL) error++; } indent-2.2.11/regression/standard/cplus.c-60000644000177400010010000000204410775646104015421 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration // comment 1 int var1; // Delcaration // comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to // right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here // is a very long C plus plus comment very long C // plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very // long C plus // plus comment // Here is a very // long C plus // plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/line-count.c0000644000177400010010000000000310775646104016176 0000000000000033 indent-2.2.11/regression/standard/comments1-fca.c0000644000177400010010000000525110775646104016570 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #define label_offset 2 /* number of levels a label is placed to left of code */ int c; /* And here is another comment which occupies more than two lines. */ /* profile types */ enum profile { PRO_BOOL, /* boolean */ PRO_INT, /* integer */ PRO_FONT, /* troff font */ PRO_IGN, /* ignore it */ PRO_KEY, /* -T switch */ PRO_SETTINGS, /* bundled set of settings */ PRO_PRSTRING /* Print string and exit */ }; /* profile specials for booleans */ enum on_or_off { ONOFF_NA, /* Not applicable. Used in table for non-booleans. */ OFF, /* This option turns on the boolean variable in question. */ ON /* it turns it off */ }; void parse (tk) enum codes tk; /* the code for the construct scanned */ { int i; while (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && tk != elselit) { /* true if we have an if without an else */ /* apply the if(..) stmt ::= stmt reduction */ parser_state_tos->p_stack[parser_state_tos->tos] = stmt; reduce (); /* see if this allows any reduction */ } switch (tk) { /* go on and figure out what to do with the input */ case decl: /* scanned a declaration word */ parser_state_tos->search_brace = btype_2; /* indicate that following brace should be on same line */ if (parser_state_tos->p_stack[parser_state_tos->tos] != decl) { /* only put one declaration onto stack */ break_comma = true; /* while in declaration, newline should be forced after comma */ inc_pstack (); } default: break; } } indent-2.2.11/regression/standard/cplus.c-70000644000177400010010000000174310775646104015427 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here is a very long C plus plus comment very long C plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very long C plus plus comment Here is a very long C plus plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/standard/bug206785.err~0000644000177400010010000000016211041664253016134 00000000000000indent: bug206785.c:22: Warning:Unterminated string constant indent: bug206785.c:22: Error:Unexpected end of file indent-2.2.11/regression/standard/line-break-comment.c0000644000177400010010000000024210775646104017577 00000000000000void foo () { if (0) ; else if (acptr->from == one || /* ...was the one I should skip */ (lp->flags & CHFL_ZOMBIE) || IsDeaf (acptr)) continue; } indent-2.2.11/regression/standard/scope.c0000644000177400010010000000011610775646104015237 00000000000000int foo (void) { if (0) { ++i; } { ++i; } } indent-2.2.11/regression/standard/comments1.c0000644000177400010010000000525010775646104016040 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #define label_offset 2 /* number of levels a label is placed to left of code */ int c; /* And here is another comment which occupies more than two lines. */ /* profile types */ enum profile { PRO_BOOL, /* boolean */ PRO_INT, /* integer */ PRO_FONT, /* troff font */ PRO_IGN, /* ignore it */ PRO_KEY, /* -T switch */ PRO_SETTINGS, /* bundled set of settings */ PRO_PRSTRING /* Print string and exit */ }; /* profile specials for booleans */ enum on_or_off { ONOFF_NA, /* Not applicable. Used in table for non-booleans. */ OFF, /* This option turns on the boolean variable in question. */ ON /* it turns it off */ }; void parse (tk) enum codes tk; /* the code for the construct scanned */ { int i; while (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && tk != elselit) { /* true if we have an if without an else */ /* apply the if(..) stmt ::= stmt reduction */ parser_state_tos->p_stack[parser_state_tos->tos] = stmt; reduce (); /* see if this allows any reduction */ } switch (tk) { /* go on and figure out what to do with the input */ case decl: /* scanned a declaration word */ parser_state_tos->search_brace = btype_2; /* indicate that following brace should be on same line */ if (parser_state_tos->p_stack[parser_state_tos->tos] != decl) { /* only put one declaration onto stack */ break_comma = true; /* while in declaration, newline should be forced after comma */ inc_pstack (); } default: break; } } indent-2.2.11/regression/standard/cs-on-return.c0000644000177400010010000000011411041665720016450 00000000000000unsigned char *cp = (unsigned char *) ptr; int foo () { return (int) n; } indent-2.2.11/regression/standard/boxed.c-90000644000177400010010000000453210775646104015403 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* * Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* * Note that Standard Input must be associated to a virtual terminal. */ /* * Further, it must be currently displayed for any sound to occur. */ /* * ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/standard/two-on-line.c0000644000177400010010000000014410775646104016277 00000000000000void main (int argc, char *argv[]) { /*lint -save *//* test of comment in column 1 */ farlj (); } indent-2.2.11/regression/standard/boxed.c-40000644000177400010010000000452710775646104015402 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/TEST0000755000177400010010000003323311331315415012660 00000000000000#/bin/sh # Compare the output of ../src/indent to correct output # generated by earlier versions INDENT=../src/indent # First, make sure the executable exists if test -x $INDENT; then if test -d ./output; then echo '****' echo 'Errors remain; output directory still exists' echo '****' ls -ld ./output exit 1 fi echo -n "Regression testing " $INDENT --version echo else echo '****' echo First, you must make $INDENT echo '****' echo exit 1 fi # Code to be tested with default options EXAMPLES="do.c else.c for.c func-def.c lshift.c ncs.c \ proto.c typedef.h no-newline.c emacs-compatible.h fp.c unary.c \ struct_param.c no-newline2.c no-newline3.c wide.c goto.c" BUGS="case-label.c one-line-1.c one-line-2.c one-line-3.c \ one-line-4.c struct-decl.c sizeof-in-while.c line-break-comment.c \ macro.c enum.c elif.c nested.c wrapped-string.c minus_predecrement.c" INDENTSRC="args.c backup.h backup.c dirent_def.h globs.c indent.h \ indent.c indent_globs.h io.c lexi.c memcpy.c parse.c pr_comment.c \ sys.h version.h" mkdir output echo -n "Generating indent et al with default settings..." for i in $EXAMPLES $INDENTSRC $BUGS do $INDENT -npro input/$i -o output/$i done echo "Done." # Cases testing certain options echo -n "Generating special option examples..." SPECIALS="typedef-bug.c bug-hp.c bug-di.c newlined-parms.c indent.pro.c \ comments1.c comments1-fca.c ncs-on-return.c cs-on-return.c sob.c continue.c continue-lp.c \ kr.c struct-decl-kr.c embedded-cuddle1.c embedded-cuddle2.c kr-proc-decls.c \ bbb-test.c preesc-comment.c if-decl-else-decl.c cp-indent.c comments.c \ elipsis-attribute.c comments2.c comments3.c comments4.c brackets.c brackets33.c \ brackets34.c brackets35.c brackets36.c brackets37.c brackets38.c \ initializers.c else-if.c else-comment-br.c else-comment-bl.c \ else-comment-br-ce.c const.c case.c case-br.c scope.c scope-br.c \ comment-break.c cdb.c bbreak.c bad-break.c pre.c pre_lps.c pre_nlps.c dont-line-up-parentheses.c \ bad-comment.c unknown-type.c unknown-type-npsl.c bug-npsl.c bug-psl.c do-cdw.c \ label.c goto-1.c goto-2.c line-count.c decl_block.c" ARGS="-bad" $INDENT -npro $ARGS input/bad-break.c -o output/bad-break.c $INDENT -npro $ARGS input/bad-comment.c -o output/bad-comment.c ARGS="-cdb" $INDENT -npro $ARGS input/cdb.c -o output/cdb.c ARGS="-kr" $INDENT -npro $ARGS input/kr.c -o output/kr.c $INDENT -npro $ARGS input/struct-decl.c -o output/struct-decl-kr.c $INDENT -npro $ARGS input/embedded-cuddle1.c -o output/embedded-cuddle1.c $INDENT -npro $ARGS input/embedded-cuddle2.c -o output/embedded-cuddle2.c $INDENT -npro $ARGS input/kr-proc-decls.c -o output/kr-proc-decls.c ARGS="-cli23 -bli8 -di50 -cbi1 -ci7 -i5" $INDENT -npro $ARGS input/case.c -o output/case.c $INDENT -npro $ARGS -br input/case.c -o output/case-br.c $INDENT -npro $ARGS input/scope.c -o output/scope.c $INDENT -npro $ARGS -br input/scope.c -o output/scope-br.c ARGS="-nlp -ci3 -fca" $INDENT -npro $ARGS input/continue.c -o output/continue.c ARGS="-lp" $INDENT -npro $ARGS input/continue.c -o output/continue-lp.c ARGS="-sob" $INDENT -npro $ARGS input/sob.c -o output/sob.c ARGS="-ncs -TUNCH" $INDENT -npro $ARGS input/typedef-bug.c -o output/typedef-bug.c $INDENT -npro $ARGS input/ncs-on-return.c -o output/ncs-on-return.c ARGS="-cs" $INDENT -npro $ARGS input/ncs-on-return.c -o output/cs-on-return.c ARGS="-kr -i2" $INDENT -npro $ARGS input/bug-hp.c -o output/bug-hp.c ARGS="-orig" $INDENT -npro $ARGS input/bug-di.c -o output/bug-di.c $INDENT -npro $ARGS input/newlined-parms.c -o output/newlined-parms.c ARGS="-bad -bap -nbc -bl -c36 -cd36 -ncdb -nce -ci8 -cli0 -cs -d0 \ -di1 -nfca -i2 -ip0 -l80 -nlp -npcs -npsl -nsc -nsob -ss -nv" $INDENT -npro $ARGS input/indent.pro.c -o output/indent.pro.c ARGS="-fca" $INDENT -npro $ARGS input/comments1.c -o output/comments1-fca.c ARGS="-bbb" $INDENT -npro $ARGS input/bbb-test.c -o output/bbb-test.c $INDENT -npro input/comments1.c -o output/comments1.c $INDENT -npro input/unknown-type.c -o output/unknown-type.c $INDENT -npro input/preesc-comment.c -o output/preesc-comment.c ARGS="-npsl" $INDENT -npro $ARGS input/if-decl-else-decl.c -o output/if-decl-else-decl.c $INDENT -npro $ARGS input/unknown-type.c -o output/unknown-type-npsl.c $INDENT -npro $ARGS input/bug-npsl.c -o output/bug-npsl.c $INDENT -npro input/bug-npsl.c -o output/bug-psl.c ARGS="-cp9" $INDENT -npro $ARGS input/cp-indent.c -o output/cp-indent.c ARGS="-di7" $INDENT -npro $ARGS input/comments.c -o output/comments.c ARGS="-ci5 -T aClient" $INDENT -npro $ARGS input/elipsis-attribute.c -o output/elipsis-attribute.c ARGS="-npsl -npcs -di3" $INDENT -npro $ARGS input/comments2.c -o output/comments2.c $INDENT -npro $ARGS input/comments3.c -o output/comments3.c ARGS="-cdb -sc" $INDENT -npro $ARGS input/comments4.c -o output/comments4.c $INDENT -npro input/brackets.c -o output/brackets.c $INDENT -npro --line-length33 input/brackets.c -o output/brackets33.c $INDENT -npro --line-length34 input/brackets.c -o output/brackets34.c $INDENT -npro --line-length35 input/brackets.c -o output/brackets35.c $INDENT -npro --line-length36 input/brackets.c -o output/brackets36.c $INDENT -npro --line-length37 input/brackets.c -o output/brackets37.c $INDENT -npro --line-length38 input/brackets.c -o output/brackets38.c $INDENT -npro --line-length40 input/bbreak.c -o output/bbreak.c ARGS="-ci5" $INDENT -npro $ARGS input/initializers.c -o output/initializers.c ARGS="-nhnl --brace-indent0 --indent-level2 --dont-line-up-parentheses --continuation-indentation4 --paren-indentation0 --line-length80" $INDENT -npro $ARGS input/else-if.c -o output/else-if.c ARGS="" $INDENT -npro -bl input/else-comment.c -o output/else-comment-bl.c $INDENT -npro -br input/else-comment.c -o output/else-comment-br.c $INDENT -npro -br -ce input/else-comment.c -o output/else-comment-br-ce.c ARGS="-kr -cp0 -l132 -lps -br -psl" $INDENT -npro $ARGS input/const.c -o output/const.c ARGS="--dont-break-procedure-type --ignore-newlines" $INDENT -npro $ARGS input/comment-break.c -o output/comment-break.c ARGS="-ppi 5" $INDENT -npro $ARGS input/pre.c -o output/pre.c ARGS="-nlps" $INDENT -npro $ARGS input/pre.c -o output/pre_nlps.c ARGS="-lps" $INDENT -npro $ARGS input/pre.c -o output/pre_lps.c ARGS="-i4 -l100 -nlp" $INDENT -npro $ARGS input/dont-line-up-parentheses.c -o output/dont-line-up-parentheses.c # Check line counting of input file $INDENT -npro input/line-count.c -o /dev/null 2>&1 | cut -d: -f3 > output/line-count.c ARGS="-cdw -bli0" $INDENT -npro input/do-cdw.c $ARGS -o output/do-cdw.c ARGS="-il2 -linux" $INDENT -npro input/label.c $ARGS -o output/label.c ARGS="-il1" $INDENT -npro input/goto.c $ARGS -o output/goto-1.c ARGS="-il-4" $INDENT -npro input/goto.c $ARGS -o output/goto-2.c ARGS="-bad" $INDENT -npro input/decl_block.c $ARGS -o output/decl_block.c echo "Done." ERR=output/errors # Now diff all the new files with the old standard echo echo "Diffing generated code against standard..." for i in $EXAMPLES $INDENTSRC $SPECIALS $BUGS do echo -n ...$i... if [ ! -f standard/$i ] then echo ERROR: standard/$i missing fi if [ ! -f output/$i ] then echo ERROR: output/$i missing fi diff --initial-tab standard/$i output/$i > output/$i-diffs 2>&1 if [ -s output/$i-diffs ] then echo ERROR: $i failed | tee -a $ERR else rm output/$i-diffs rm output/$i echo fi done echo "Diffing generated code against standard...Done." # Testing indent (x) == indent (indent (x)) echo echo -n "Testing meta-indent..." ARGS="-bacc -nbad -nbap -nbc -br -cdb -nce -ci4 -cli4 -cs -nfc1 \ -fca -i4 -ip0 -l78 -lp -npcs -psl -sc -ss -ts4" $INDENT -npro $ARGS input/meta-indent.c -o output/meta-indent.c diff --initial-tab output/meta-indent.c standard/meta-indent.c > output/meta-diffs if [ -s output/meta-diffs ] then echo ERROR: 1st Meta test failed | tee -a $ERR else rm output/meta-diffs fi for j in 1 2 3 4 5 do echo -n " $j" $INDENT -npro $ARGS output/meta-indent.c -o output/meta-indent.c-o diff --initial-tab output/meta-indent.c-o standard/meta-indent.c > output/meta-diffs-$j if [ -s output/meta-diffs-$j ] then echo ERROR: Meta test $i failed | tee -a $ERR else rm output/meta-diffs-$j mv output/meta-indent.c-o output/meta-indent.c if [ $j -eq 5 ] then rm output/meta-indent.c fi fi done echo " Done" # This section was added when `pr_comment.c' was rewritten, to test # the new comment-handling code. echo echo Testing new comment stuff... A1="-fca" A2="-fc1" A3="-fca -fc1" A4="-fca -fc1 -cdb" A5="-fca -fc1 -cdb -sc" A6="-fca -fc1 -sc" A7="-sc -fc1" A8="-cdb -fc1" A9="-sc -cdb -fc1" A10="-sc -cdb" $INDENT -npro -st input/boxed.c > output/boxed.c-0 $INDENT -npro -st $A1 input/boxed.c > output/boxed.c-1 $INDENT -npro -st $A2 input/boxed.c > output/boxed.c-2 $INDENT -npro -st $A3 input/boxed.c > output/boxed.c-3 $INDENT -npro -st $A4 input/boxed.c > output/boxed.c-4 $INDENT -npro -st $A5 input/boxed.c > output/boxed.c-5 $INDENT -npro -st $A6 input/boxed.c > output/boxed.c-6 $INDENT -npro -st $A7 input/boxed.c > output/boxed.c-7 $INDENT -npro -st $A8 input/boxed.c > output/boxed.c-8 $INDENT -npro -st $A9 input/boxed.c > output/boxed.c-9 $INDENT -npro input/outer.c -o output/outer.c-0 $INDENT -npro $A1 input/outer.c -o output/outer.c-1 $INDENT -npro $A2 input/outer.c -o output/outer.c-2 $INDENT -npro $A3 input/outer.c -o output/outer.c-3 $INDENT -npro $A4 input/outer.c -o output/outer.c-4 $INDENT -npro $A5 input/outer.c -o output/outer.c-5 $INDENT -npro $A6 input/outer.c -o output/outer.c-6 $INDENT -npro $A7 input/outer.c -o output/outer.c-7 $INDENT -npro $A8 input/outer.c -o output/outer.c-8 $INDENT -npro $A9 input/outer.c -o output/outer.c-9 A1="-fc1 -fca" A2="-fc1 -fca -cdb" A3="-fc1 -fca -cdb -sc" A4="-fc1 -fca -sc" A5="-fc1 -fca -l 50 -lc 50" A6="-fc1 -fca -l 50 -lc 50 -cdb" A7="-fc1 -fca -l 50 -lc 50 -sc" A8="-fc1 -fca -l 50 -lc 50 -sc -cdb" $INDENT -npro input/newlines.c -o output/newlines.c-0 $INDENT -npro $A1 input/newlines.c -o output/newlines.c-1 $INDENT -npro $A2 input/newlines.c -o output/newlines.c-2 $INDENT -npro $A3 input/newlines.c -o output/newlines.c-3 $INDENT -npro $A4 input/newlines.c -o output/newlines.c-4 $INDENT -npro $A5 input/newlines.c -o output/newlines.c-5 $INDENT -npro $A6 input/newlines.c -o output/newlines.c-6 $INDENT -npro $A7 input/newlines.c -o output/newlines.c-7 $INDENT -npro $A8 input/newlines.c -o output/newlines.c-8 A1="-l 50 -lc 50" A2="-l 50 -lc 50 -c 20" A3="-l 50 -lc 50 -cd 30" A4="-c 20 -cd 30" A5="-fc1 -fca" A6="-l 50 -lc 50 -fc1 -fca" A7="-cp 10" A8="-fc1 -fca -l50 -lc50 -c 30 -cd 20 -cp 8" A9="-cdb -sc -l 50 -lc 50 -fca -fc1" $INDENT -npro input/cplus.c -o output/cplus.c-0 $INDENT -npro $A1 input/cplus.c -o output/cplus.c-1 $INDENT -npro $A2 input/cplus.c -o output/cplus.c-2 $INDENT -npro $A3 input/cplus.c -o output/cplus.c-3 $INDENT -npro $A4 input/cplus.c -o output/cplus.c-4 $INDENT -npro $A5 input/cplus.c -o output/cplus.c-5 $INDENT -npro $A6 input/cplus.c -o output/cplus.c-6 $INDENT -npro $A7 input/cplus.c -o output/cplus.c-7 $INDENT -npro $A8 input/cplus.c -o output/cplus.c-8 $INDENT -npro $A9 input/cplus.c -o output/cplus.c-9 A1="-sc -cdb -fc1" A2="-i 10 -fc1" $INDENT -npro input/tabs.c -o -fc1 output/tabs.c-0 $INDENT -npro $A1 input/tabs.c -o output/tabs.c-1 $INDENT -npro $A2 input/tabs.c -o output/tabs.c-2 $INDENT -npro input/cplus-one.c -o output/cplus-one.c $INDENT -npro input/class-func.cc -o output/class-func.cc $INDENT -npro input/empty.c -o output/empty.c $INDENT -npro input/already-starred.c -o output/already-starred.c $INDENT -npro input/box-comm.c -o output/box-comm.c $INDENT -npro input/long-comm.c -o output/long-comm.c $INDENT -npro input/ind-star.c -o output/ind-star.c $INDENT -npro input/first-in-block.c -o output/first-in-block.c # currently fails $INDENT -npro input/two-on-line.c -o output/two-on-line.c $INDENT -npro input/method.c -o output/method.c A1="-fca" $INDENT -npro input/right-margin-comment.c $A1 -o output/right-margin-comment.c # These aren't really comment testing, they test the indent control # statements '*INDENT-ON*' and '*INDENT-OFF*' $INDENT -npro input/on-off-1.c -o output/on-off-1.c $INDENT -npro input/on-off-2.c -o output/on-off-2.c cd output ERR=errors # currently fails: two-on-line.c for i in boxed.c-* outer.c-* newlines.c-* cplus.c-* tabs.c-* cplus-one.c class-func.cc \ empty.c already-starred.c box-comm.c long-comm.c ind-star.c first-in-block.c \ on-off-1.c on-off-2.c \ method.c right-margin-comment.c do echo -n ...$i... diff --initial-tab ../standard/$i $i > $i-diffs 2>&1 if [ -s $i-diffs ] then echo -n ERROR: $i failed | tee -a $ERR echo >> $ERR else rm $i-diffs $i fi echo done cd .. echo Testing new comment stuff...Done. echo Testing bad code handling.... # This ends in a error from indent but it shouldn't coredump. $INDENT input/bug206785.c -o output/bug206785.c 2>output/bug206785.err if [ $? -ne 2 ] then echo -n ERROR: bad return status from indent. | tee -a $ERR echo >> $ERR fi cd output for i in bug206785.c bug206785.err do echo -n ...$i... diff --initial-tab ../standard/$i $i > $i-diffs 2>&1 if [ -s $i-diffs ] then echo -n ERROR: $i failed | tee -a $ERR echo >> $ERR else rm $i-diffs rm $i fi echo done echo Testing bad code handling...Done. # Now see if any errors occured. If so, bitch and moan, otherwise, # remove the output directory. # if test -s $ERR then echo '**** Errors occured:' cat $ERR echo '**** Errors occured: ./output not removed' echo else cd .. ls -l output rm -rf output echo echo Regression test successfully completed. echo fi indent-2.2.11/regression/Makefile0000644000177400010010000000006010775646104013620 00000000000000all: test test: ./TEST clean: rm -rf output indent-2.2.11/regression/input/0000777000177400010010000000000011331272170013372 500000000000000indent-2.2.11/regression/input/proto.c0000644000177400010010000000027710775646104014640 00000000000000static void bar (char *foo) { long whizzo; short spazzo; if (*foo == gibberish ()) whizzo = spazzo; } char * nevermind (char harrumph) { char buf[1024]; buf[3] = harrumph; } indent-2.2.11/regression/input/memcpy.c0000644000177400010010000000051210775646104014757 00000000000000/* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined if the source overlaps with the destination. Return DESTADDR. */ char * memcpy (destaddr, srcaddr, len) char *destaddr; char *srcaddr; int len; { char *dest = destaddr; while (len-- > 0) *destaddr++ = *srcaddr++; return dest; } indent-2.2.11/regression/input/preesc-comment.c0000644000177400010010000000061010775646104016405 00000000000000 /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ #if x /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ #if x /** */ foo #endif indent-2.2.11/regression/input/pre.c0000644000177400010010000000013610775646104014255 00000000000000#if x #if y # if z #define www #else # define ggg #endif #else # define kkk #endif #endif indent-2.2.11/regression/input/enum.c0000644000177400010010000000020710775646104014432 00000000000000enum foo bar () { if (1) { func (1); } return SUCCESSFUL; } void bar (enum foo) { if (1) { func (1); } } indent-2.2.11/regression/input/sob.c0000644000177400010010000000023010775646104014245 00000000000000 /* Optional blanklines */ main (foo) int foo; { barf (); *foo = eat_me (); return 93; /* Because */ } /* there wre */ indent-2.2.11/regression/input/toggles.c0000644000177400010010000000033411146004231015111 00000000000000void a () { id = source ? (f ? f->id_src_dev : fwr->id_src_dev) : (f ? f->id_dst_dev : fwr->id_dst_dev); strbuf_appendf(sb, "%s\n",inet_ntoa(*((struct in_addr *) &ifr->ifr_addr.sa_data[sizeof(sa.sin_port)]))); } indent-2.2.11/regression/input/continue.c0000644000177400010010000000121010775646104015305 00000000000000extern EXETOKEN savetkn; /* Last input token found. */ extern EXETOKEN NOTOKEN; /* Empty token */ word FilOpnTmp ( uword maxr, word creat) /* i: 0 - copies existing mastfil to tmpfil, 1- creates tmpfil */ { here_is_an_incredibly_long_variable = my * but * this * (is + a) / lengthy * expression; for (mastfil_dta = 0; mastfil_dta < cnfils && (strcmp(mastfil->fname, dtafilarr[mastfil_dta]->fname) != 0); mastfil_dta++); for (mastfil_dta = 0; mastfil_dta < cnfils; mastfil_dta++); } indent-2.2.11/regression/input/nested.c0000644000177400010010000000073410775646104014755 00000000000000#include void inner_function (int foo, int bar) { int baz; printf ("Hi!\n"); if (foo) printf ("Foo (%d)\n", foo); if (bar) printf ("Bar (%d)\n", bar); } void outer_function () { void inner_function (int foo, int bar) { int baz; printf ("Hi!\n"); if (foo) printf ("Foo (%d)\n", foo); if (bar) printf ("Bar (%d)\n", bar); } inner_function (1, 1); } int main (void) { outer_function (); return 0; } indent-2.2.11/regression/input/bug-di.c0000644000177400010010000000005210775646104014633 00000000000000 int foo() { bar(); /* A comment */ } indent-2.2.11/regression/input/bug206785.c0000644000177400010010000000206210775646104014740 00000000000000int main() { /* Notice the missing close comment on the next line . * Lets see what indent thinks of it ... */ printf(_("aaaaaaaaaaaaaaaaaaaaaaaaaa)); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"); printf(":"); } indent-2.2.11/regression/input/case.c0000644000177400010010000000020410775646104014376 00000000000000int foo(void) { if (0) { switch (x) { case 1: ++x; break; case 1: { ++x; break; } } } } indent-2.2.11/regression/input/typedef.h0000644000177400010010000000017610775646104015140 00000000000000 typedef boolean (*PFB) (); /* system defined globals */ extern int errno; extern int sys_nerr; extern char * sys_errlist[]; indent-2.2.11/regression/input/const.c0000644000177400010010000000017210775646104014615 00000000000000void graph_error(fmt, va_alist) const char *fmt; va_dcl { } int label_width(str, lines) const char *str; int *lines; { } indent-2.2.11/regression/input/else-comment.c0000644000177400010010000000310210775646104016053 00000000000000void foo() { if (0) i = 0; else /* This is a dirty place to put a comment */ if (1) i = 0; else /* comment behind else */ /* comment on new line, after else */ i = 0; if (0) /* Lets put a comment here too */ i = 0; else /* This is a dirty place to put a multi-line comment */ if (1) i = 0; else /* multi-line comment behind else */ i = 0; if (0) /* Lets put a comment here too */ i = 0; else /* This is a dirty place to put a comment */ if (1) i = 0; else /* comment behind else */ /* comment on new line, after else */ i = 0; if (0) i = 0; else if (1) /* comment after if */ i = 0; else /* multi-line comment */ i = 0; if (0) { i = 0; } else /* This is a dirty place to put a comment */ if (1) { i = 0; } else /* comment behind else */ { /* comment on new line, after else */ i = 0; } if (0) { /* Lets put a comment here too */ i = 0; } else /* This is a dirty place to put a multi-line comment */ if (1) { i = 0; } else /* multi-line comment behind else */ { i = 0; } if (0) /* Lets put a comment here too */ { i = 0; } else /* This is a dirty place to put a comment */ if (1) { i = 0; } else /* comment behind else */ /* comment on new line, after else */ { i = 0; } if (0) { i = 0; } else if (1) /* comment after if */ { i = 0; } else { /* multi-line comment */ i = 0; } } indent-2.2.11/regression/input/io.c0000644000177400010010000005015510775646104014104 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" #include /* POSIX says that should exist. Some systems might need to use or instead. */ #include #include #include /* number of levels a label is placed to left of code */ #define LABEL_OFFSET 2 /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *in_prog; char *in_prog_pos; char *cur_line; unsigned int in_prog_size; FILE *output; char *buf_ptr; char *buf_end; int had_eof; int out_lines; int com_lines; int suppress_blanklines = 0; int comment_open; int paren_target; /* Use `perror' to print the system error message caused by OFFENDER. */ static char *errbuf; void sys_error (offender) char *offender; { int size = strlen (offender); static int buffer_size; if (errbuf == 0) { buffer_size = size + 10; /* Extra for random unix lossage */ errbuf = (char *) xmalloc (buffer_size); } else if (size + 10 > buffer_size) { buffer_size = size + 10; errbuf = xrealloc (errbuf, buffer_size); } sprintf (errbuf, "indent: %s", offender); perror (errbuf); exit (1); } /* true if INDENT OFF is in effect */ static int inhibit_formatting; void dump_line () { /* dump_line is the routine that actually effects the printing of the new source. It prints the label section, followed by the code section with the appropriate nesting level, followed by any comments */ register int cur_col; register int target_col = 0; static not_first_line; if (parser_state_tos->procname[0]) { if (troff) { if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } fprintf (output, ".Pr \"%.*s\"\n", parser_state_tos->procname_end - parser_state_tos->procname, parser_state_tos->procname); } parser_state_tos->ind_level = 0; parser_state_tos->procname = "\0"; } /* A blank line */ if (s_code == e_code && s_lab == e_lab && s_com == e_com) { /* If we have a formfeed on a blank line, we should just output it, rather than treat it as a normal blank line. */ if (parser_state_tos->use_ff) { putc ('\014', output); parser_state_tos->use_ff = false; } else { if (suppress_blanklines > 0) suppress_blanklines--; else { parser_state_tos->bl_line = true; n_real_blanklines++; } } } else if (!inhibit_formatting) { suppress_blanklines = 0; parser_state_tos->bl_line = false; if (prefix_blankline_requested && not_first_line) { if (swallow_optional_blanklines && n_real_blanklines > 1) n_real_blanklines = 1; else if (n_real_blanklines == 0) n_real_blanklines = 1; } while (--n_real_blanklines >= 0) putc ('\n', output); n_real_blanklines = 0; if (parser_state_tos->ind_level == 0) parser_state_tos->ind_stmt = 0; /* this is a class A kludge. dont do additional statement indentation if we are at bracket level 0 */ if (e_lab != s_lab || e_code != s_code) ++code_lines; /* keep count of lines with code */ if (e_lab != s_lab) { /* print lab, if any */ if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; cur_col = pad_output (1, compute_label_target ()); if (s_lab[0] == '#' && (strncmp (s_lab, "#else", 5) == 0 || strncmp (s_lab, "#endif", 6) == 0)) { /* Treat #else and #endif as a special case because any text after #else or #endif should be converted to a comment. */ register char *s = s_lab; if (e_lab[-1] == '\n') e_lab--; do putc (*s++, output); while (s < e_lab && 'a' <= *s && *s <= 'z'); while ((*s == ' ' || *s == '\t') && s < e_lab) s++; if (s < e_lab) fprintf (output, s[0] == '/' && s[1] == '*' ? "\t%.*s" : "\t/* %.*s */", e_lab - s, s); } else fprintf (output, "%.*s", e_lab - s_lab, s_lab); cur_col = count_spaces (cur_col, s_lab); } else cur_col = 1; /* there is no label section */ parser_state_tos->pcase = false; if (s_code != e_code) { /* print code section, if any */ register char *p; if (comment_open) { comment_open = 0; fprintf (output, ".*/\n"); } target_col = compute_code_target (); /* If a line ends in an lparen character, the following line should not line up with the parenthesis, but should be indented by the usual amount. */ if (parser_state_tos->last_token == lparen) { parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] += ind_size - 1; } { register i; for (i = 0; i < parser_state_tos->p_l_follow; i++) if (parser_state_tos->paren_indents[i] >= 0) parser_state_tos->paren_indents[i] = -(parser_state_tos->paren_indents[i] + target_col); } cur_col = pad_output (cur_col, target_col); for (p = s_code; p < e_code; p++) if (*p == (char) 0200) fprintf (output, "%d", target_col * 7); else putc (*p, output); cur_col = count_spaces (cur_col, s_code); } if (s_com != e_com) { if (troff) { int all_here = 0; register char *p; if (e_com[-1] == '/' && e_com[-2] == '*') e_com -= 2, all_here++; while (e_com > s_com && e_com[-1] == ' ') e_com--; *e_com = 0; p = s_com; while (*p == ' ') p++; if (p[0] == '/' && p[1] == '*') p += 2, all_here++; else if (p[0] == '*') p += p[1] == '/' ? 2 : 1; while (*p == ' ') p++; if (*p == 0) goto inhibit_newline; if (comment_open < 2 && parser_state_tos->box_com) { comment_open = 0; fprintf (output, ".*/\n"); } if (comment_open == 0) { if ('a' <= *p && *p <= 'z') *p = *p + 'A' - 'a'; if (e_com - p < 50 && all_here == 2) { register char *follow = p; fprintf (output, "\n.nr C! \\w\1"); while (follow < e_com) { switch (*follow) { case '\n': putc (' ', output); case 1: break; case '\\': putc ('\\', output); default: putc (*follow, output); } follow++; } putc (1, output); } fprintf (output, "\n./* %dp %d %dp\n", parser_state_tos->com_col * 7, (s_code != e_code || s_lab != e_lab) - parser_state_tos->box_com, target_col * 7); } comment_open = 1 + parser_state_tos->box_com; while (*p) { if (*p == BACKSLASH) putc (BACKSLASH, output); putc (*p++, output); } } else { /* print comment, if any */ register target = parser_state_tos->com_col; register char *com_st = s_com; target += parser_state_tos->comment_delta; while (*com_st == '\t') com_st++, target += tabsize; while (target <= 0) if (*com_st == ' ') target++, com_st++; else if (*com_st == '\t') { target = ((target - 1) & ~(tabsize - 1)) + (tabsize + 1); com_st++; } else target = 1; if (cur_col > target) { /* if comment cant fit on this line, put it on next line */ putc ('\n', output); cur_col = 1; ++out_lines; } while (e_com > com_st && isspace (e_com[-1])) e_com--; cur_col = pad_output (cur_col, target); if (!parser_state_tos->box_com) { if (star_comment_cont && (com_st[1] != '*' || e_com <= com_st + 1)) if (com_st[1] == ' ' && com_st[0] == ' ' && e_com > com_st + 1) com_st[1] = '*'; else fwrite (" * ", (com_st[0] == '\t' ? 2 : (com_st[0] == '*' ? 1 : 3)), 1, output); } fwrite (com_st, e_com - com_st, 1, output); parser_state_tos->comment_delta = parser_state_tos->n_comment_delta; cur_col = count_spaces (cur_col, com_st); ++com_lines; /* count lines with comments */ } } if (parser_state_tos->use_ff) { putc ('\014', output); parser_state_tos->use_ff = false; } else putc ('\n', output); inhibit_newline: ++out_lines; if (parser_state_tos->just_saw_decl == 1 && blanklines_after_declarations) { prefix_blankline_requested = 1; parser_state_tos->just_saw_decl = 0; } else prefix_blankline_requested = postfix_blankline_requested; postfix_blankline_requested = 0; } /* if we are in the middle of a declaration, remember that fact for proper comment indentation */ parser_state_tos->decl_on_line = parser_state_tos->in_decl; /* next line should be indented if we have not completed this stmt and if we are not in the middle of a declaration */ parser_state_tos->ind_stmt = (parser_state_tos->in_stmt & ~parser_state_tos->in_decl); parser_state_tos->dumped_decl_indent = 0; *(e_lab = s_lab) = '\0'; /* reset buffers */ *(e_code = s_code) = '\0'; *(e_com = s_com) = '\0'; parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->paren_level = parser_state_tos->p_l_follow; if (parser_state_tos->paren_level > 0) paren_target = -parser_state_tos->paren_indents[parser_state_tos->paren_level - 1]; else paren_target = 0; not_first_line = 1; return; } /* Figure out where we should put the code in codebuf. Return the column number in spaces. */ INLINE int compute_code_target () { register target_col = parser_state_tos->ind_level + 1; if (parser_state_tos->paren_level) if (!lineup_to_parens) target_col += continuation_indent * parser_state_tos->paren_level; else { register w; register t = paren_target; if ((w = count_spaces (t, s_code) - max_col) > 0 && count_spaces (target_col, s_code) <= max_col) { t -= w + 1; if (t > target_col) target_col = t; } else target_col = t; } else if (parser_state_tos->ind_stmt) target_col += continuation_indent; return target_col; } INLINE int compute_label_target () { return parser_state_tos->pcase ? case_ind + 1 : *s_lab == '#' ? 1 : parser_state_tos->ind_level - LABEL_OFFSET + 1; } /* Read file FILENAME into a `fileptr' structure, and return a pointer to that structure. */ static struct file_buffer fileptr; struct file_buffer * read_file (filename) char *filename; { int fd; struct stat file_stats; int namelen = strlen (filename); fd = open (filename, O_RDONLY, 0777); if (fd < 0) sys_error (filename); if (fstat (fd, &file_stats) < 0) sys_error (filename); if (fileptr.data != 0) free (fileptr.data); fileptr.size = file_stats.st_size; fileptr.data = (char *) xmalloc (file_stats.st_size + 1); if (read (fd, fileptr.data, fileptr.size) < 0) sys_error (filename); if (close (fd) < 0) sys_error (filename); fileptr.name = (char *) xmalloc (namelen + 1); memcpy (fileptr.name, filename, namelen); fileptr.name[namelen] = '\0'; fileptr.data[fileptr.size] = '\0'; return &fileptr; } /* This should come from stdio.h and be some system-optimal number */ #ifndef BUFSIZ #define BUFSIZ 1024 #endif /* Suck the standard input into a file_buffer structure, and return a pointer to that structure. */ struct file_buffer stdinptr; struct file_buffer * read_stdin () { unsigned int size = 15 * BUFSIZ; int ch; register char *p; if (stdinptr.data != 0) free (stdinptr.data); stdinptr.data = (char *) xmalloc (size + 1); stdinptr.size = 0; p = stdinptr.data; do { while (stdinptr.size < size) { ch = getc (stdin); if (ch == EOF) break; *p++ = ch; stdinptr.size++; } if (ch != EOF) { size += (2 * BUFSIZ); stdinptr.data = xrealloc (stdinptr.data, size); } } while (ch != EOF); stdinptr.name = "Standard Input"; stdinptr.data[stdinptr.size] = '\0'; return &stdinptr; } /* Advance buf_ptr so that it points to the next line of input. Skip over indent errors (comments beginning with *INDENT**), ignoring them. Process INDENT ON and INDENT OFF. (Note: the name of this function is a historical artifact from before the time that indent kept the whole source file in memory). */ INLINE void fill_buffer () { /* Point various places in the buffer. */ register char *p; /* Character P points to. */ register char c; /* Have we found INDENT ON or INDENT OFF ? */ enum { None, Indent_on, Indent_off } com; /* indent() may be saving the text between "if (...)" and the following statement. To do so, it uses another buffer (`save_com'). Switch back to the previous buffer here. */ if (bp_save != 0) { buf_ptr = bp_save; buf_end = be_save; bp_save = be_save = 0; /* only return if there is really something in this buffer */ if (buf_ptr < buf_end) return; } fill_it: cur_line = in_prog_pos; buf_ptr = in_prog_pos; if (*buf_ptr == '\0') { had_eof = true; return; } p = buf_ptr; do { c = *p; p++; } while (c != '\0' && c != '\n'); buf_end = p; p = buf_ptr; in_prog_pos = buf_end; while (*p == ' ' || *p == '\t') p++; if (*p == '/' && p[1] == '*') { p += 2; if (p[1] == 'I' && strncmp (p, "*INDENT**", 9) == 0) goto fill_it; while (*p == ' ' || *p == '\t') p++; com = None; if (p[0] == 'I' && p[1] == 'N' && p[2] == 'D' && p[3] == 'E' && p[4] == 'N' && p[5] == 'T') { p += 6; while (*p == ' ' || *p == '\t') p++; if (*p == '*') com = Indent_on; else if (*p == 'O') if (*++p == 'N') p++, com = Indent_on; else if (*p == 'F' && *++p == 'F') p++, com = Indent_off; while (*p == ' ' || *p == '\t') p++; if (p[0] == '*' && p[1] == '/' && p[2] == '\n' && com) { if (s_com != e_com || s_lab != e_lab || s_code != e_code) dump_line (); if (!(inhibit_formatting = (int) com - 1)) { n_real_blanklines = 0; postfix_blankline_requested = 0; prefix_blankline_requested = 0; suppress_blanklines = 1; } } } } if (inhibit_formatting) { p = buf_ptr; do putc (*p, output); while (*p++ != '\n'); } } /* Copyright (C) 1976 by the Board of Trustees of the University of Illinois All rights reserved NAME: pad_output FUNCTION: Writes tabs and spaces to move the current column up to the desired position. ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf. PARAMETERS: current integer The current column target nteger The desired column RETURNS: Integer value of the new column. (If current >= target, no action is taken, and current is returned. GLOBALS: None CALLS: write (sys) CALLED BY: dump_line HISTORY: initial coding November 1976 D A Willcox of CAC */ INLINE int pad_output (current, target) /* writes tabs and blanks (if necessary) to get the current output position up to the target column */ int current; /* the current column value */ int target; /* position we want it at */ { register int curr; /* internal column pointer */ register int tcur; if (troff) fprintf (output, "\\h'|%dp'", (target - 1) * 7); else { if (current >= target) return (current); /* line is already long enough */ curr = current; while ((tcur = curr + tabsize - (curr - 1) % tabsize) <= target) { putc ('\t', output); curr = tcur; } while (curr++ < target) putc (' ', output); /* pad with final blanks */ } return (target); } /* Copyright (C) 1976 by the Board of Trustees of the University of Illinois All rights reserved NAME: count_spaces FUNCTION: Find out where printing of a given string will leave the current character position on output. ALGORITHM: Run thru input string and add appropriate values to current position. RETURNS: Integer value of position after printing "buffer" starting in column "current". HISTORY: initial coding November 1976 D A Willcox of CAC */ INLINE int count_spaces (current, buffer) /* this routine figures out where the character position will be after printing the text in buffer starting at column "current" */ int current; char *buffer; { register char *buf; /* used to look thru buffer */ register int cur; /* current character counter */ cur = current; for (buf = buffer; *buf != '\0'; ++buf) { switch (*buf) { case '\n': case 014: /* form feed */ cur = 1; break; case '\t': cur = cur + tabsize - (cur - 1) % tabsize; break; case 010: /* backspace */ --cur; break; default: ++cur; break; } /* end of switch */ } /* end of for loop */ return (cur); } /* Nonzero if we have found an error (not a warning). */ int found_err; /* Signal an error. LEVEL is nonzero if it is an error (as opposed to a warning. MSG is a printf-style format string. Additional arguments are additional arguments for printf. */ /* VARARGS2 */ diag (level, msg, a, b) int level; unsigned int a, b; char *msg; { if (level) found_err = 1; if (output == stdout) { fprintf (stdout, "/**INDENT** %s@%d: ", level == 0 ? "Warning" : "Error", line_no); fprintf (stdout, msg, a, b); fprintf (stdout, " */\n"); } else { fprintf (stderr, "%s: %d: ", in_name, line_no); fprintf (stderr, msg, a, b); fprintf (stderr, "\n"); } } writefdef (f, nm) register struct fstate *f; unsigned int nm; { fprintf (output, ".ds f%c %s\n.nr s%c %d\n", nm, f->font, nm, f->size); } /* Write characters starting at S to change the font from OF to NF. Return a pointer to the character after the last character written. For troff mode only. */ char * chfont (of, nf, s) register struct fstate *of, *nf; char *s; { if (of->font[0] != nf->font[0] || of->font[1] != nf->font[1]) { *s++ = '\\'; *s++ = 'f'; if (nf->font[1]) { *s++ = '('; *s++ = nf->font[0]; *s++ = nf->font[1]; } else *s++ = nf->font[0]; } if (nf->size != of->size) { *s++ = '\\'; *s++ = 's'; if (nf->size < of->size) { *s++ = '-'; *s++ = '0' + of->size - nf->size; } else { *s++ = '+'; *s++ = '0' + nf->size - of->size; } } return s; } void parsefont (f, s0) register struct fstate *f; char *s0; { register char *s = s0; int sizedelta = 0; int i; f->size = 0; f->allcaps = 1; for (i = 0; i < 4; i++) f->font[i] = 0; while (*s) { if (isdigit (*s)) f->size = f->size * 10 + *s - '0'; else if (isupper (*s)) if (f->font[0]) f->font[1] = *s; else f->font[0] = *s; else if (*s == 'c') f->allcaps = 1; else if (*s == '+') sizedelta++; else if (*s == '-') sizedelta--; else { fprintf (stderr, "indent: bad font specification: %s\n", s0); exit (1); } s++; } if (f->font[0] == 0) f->font[0] = 'R'; if (bodyf.size == 0) bodyf.size = 11; if (f->size == 0) f->size = bodyf.size + sizedelta; else if (sizedelta > 0) f->size += bodyf.size; else f->size = bodyf.size - f->size; } #ifdef DEBUG void dump_debug_line () { fprintf (output, "\n*** Debug output marker line ***\n"); } #endif indent-2.2.11/regression/input/embedded-cuddle2.c0000644000177400010010000000006510775646104016541 00000000000000void foo() { #ifdef foo if (1) { } /* if */ #endif } indent-2.2.11/regression/input/indent.pro.c0000644000177400010010000000005610775646104015550 00000000000000main() { int i, j; i <<= 1; j >>= 1; } indent-2.2.11/regression/input/comments.c0000644000177400010010000000146210775646104015317 00000000000000char * frob ( /* comment1 */ struct foo *param1, /* comment 2 * continued. */ int param (int (*)(char, void *, /* Really a * `struct foo *' */ char ccccccc, /* Extra param */ int *)), char *fooooooooooooooooo /* comment3, also * continued */ ) { int aaaaaaaaaaaaaaaaaaaaa, /* comment1 */ bc,/* comment2 */ def; /* comment3 */ if (1) { char *a, /* comment1 */ *bcccccccccccccccc, /* comment2 */ d; /* comment3 */ } if (strcmp (a /* comment a */ , b, /* comment b */ )) ; if (func_xxxxxxxxxxxxxxxx (a, /* comment 1 */ b, /* comment 2, * continued. */ c,/* comment 3 */ d (a + 11, /* comment 4a */ b - 11, /* comment 4b * continued. */ 11111), /* comment 5 */ e)) ; } indent-2.2.11/regression/input/dirent_def.h0000644000177400010010000000001710775646104015575 00000000000000#define DIRENT indent-2.2.11/regression/input/empty.c0000644000177400010010000000006110775646104014622 00000000000000 /* */ /* */ /* */ /* */ indent-2.2.11/regression/input/bad-comment.c0000644000177400010010000000015710775646104015660 00000000000000void zero(void) { struct cmtsConfig cmtscfg; /* CMTS configuration table used for initialization */ } indent-2.2.11/regression/input/pr_comment.c0000644000177400010010000003251510775646104015640 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* NAME: pr_comment FUNCTION: This routine takes care of scanning and printing comments. ALGORITHM: 1) Decide where the comment should be aligned, and if lines should be broken. 2) If lines should not be broken and filled, just copy up to end of comment. 3) If lines should be filled, then scan thru input_buffer copying characters to com_buf. Remember where the last blank, tab, or newline was. When line is filled, print up to last blank and continue copying. HISTORY: November 1976 D A Willcox of CAC Initial coding 12/6/76 A Willcox of CAC Modification to handle UNIX-style comments */ /* this routine processes comments. It makes an attempt to keep comments from going over the max line length. If a line is too long, it moves everything from the last blank to the next comment line. Blanks and tabs from the beginning of the input line are removed */ #include "sys.h" #include "indent.h" /* Declared and documented in indent.h. */ int out_coms; pr_comment () { int now_col; /* column we are in now */ int adj_max_col; /* Adjusted max_col for when we decide to spill comments over the right margin */ char *last_bl; /* points to the last blank in the output buffer */ char *t_ptr; /* used for moving string */ int unix_comment; /* tri-state variable used to decide if it is a unix-style comment. 0 means only blanks since /*, 1 means regular style comment, 2 means unix style comment */ int break_delim = comment_delimiter_on_blankline; int l_just_saw_decl = parser_state_tos->just_saw_decl; /* int parser_state_tos->last_nl = 0; /* true iff the last significant thing weve seen is a newline */ int one_liner = 1; /* true iff this comment is a one-liner */ adj_max_col = max_col; parser_state_tos->just_saw_decl = 0; last_bl = 0; /* no blanks found so far */ parser_state_tos->box_com = false; /* at first, assume that we are not in a boxed comment or some other comment that should not be touched */ ++out_coms; /* keep track of number of comments */ unix_comment = 1; /* set flag to let us figure out if there is a unix-style comment ** DISABLED: use 0 to reenable this hack! */ /* Figure where to align and how to treat the comment */ if (parser_state_tos->col_1 && !format_col1_comments) { /* if comment starts in column 1 it should not be touched */ parser_state_tos->box_com = true; parser_state_tos->com_col = 1; } else { if (*buf_ptr == '-' || *buf_ptr == '*' || !format_comments) { parser_state_tos->box_com = true; /* a comment with a '-' or '*' immediately after the /* is assumed to be a boxed comment */ break_delim = 0; } /* Used to also check that parser_state_tos->bl_line != 0 */ if ((s_lab == e_lab) && (s_code == e_code)) { /* klg: check only if this line is blank */ /* If this (*and previous lines are*) blank, dont put comment way out at left */ parser_state_tos->com_col = (parser_state_tos->ind_level - unindent_displace) + 1; adj_max_col = block_comment_max_col; if (parser_state_tos->com_col <= 1) parser_state_tos->com_col = 1 + !format_col1_comments; /* If we have a comment in an old-style (pre-ANSI) parameter declaration, indent it like we would the parameter declaration. For example: int destroy (what) / * N things to destroy. * / int what; */ if (parser_state_tos->in_parameter_declaration && indent_parameters != 0 && parser_state_tos->dec_nest == 0) { parser_state_tos->com_col = indent_parameters + 1; parser_state_tos->ind_stmt = 0; } } else { register target_col; break_delim = 0; if (s_code != e_code) target_col = count_spaces (compute_code_target (), s_code); else { target_col = 1; if (s_lab != e_lab) target_col = count_spaces (compute_label_target (), s_lab); } parser_state_tos->com_col = parser_state_tos->decl_on_line || parser_state_tos->ind_level == 0 ? decl_com_ind : com_ind; /* If we are already past the position for the comment, put it at the next tab stop. */ if (parser_state_tos->com_col < target_col) parser_state_tos->com_col = ((target_col + (tabsize - 1)) & ~(tabsize - 1)) + 1; if (else_or_endif) { parser_state_tos->com_col = else_endif_col; else_or_endif = false; /* We want the comment to appear one space after the #else or #endif. */ if (parser_state_tos->com_col < target_col) parser_state_tos->com_col = target_col + 1; } if (parser_state_tos->com_col + 24 > adj_max_col) adj_max_col = parser_state_tos->com_col + 24; } } if (parser_state_tos->box_com) { parser_state_tos->n_comment_delta = 1 - parser_state_tos->com_col; #if 0 buf_ptr[-2] = 0; parser_state_tos->n_comment_delta = 1 - count_spaces (1, cur_line); buf_ptr[-2] = '/'; #endif } else { parser_state_tos->n_comment_delta = 0; while (*buf_ptr == ' ' || *buf_ptr == '\t') buf_ptr++; } parser_state_tos->comment_delta = 0; *e_com++ = '/'; /* put '/*' into buffer */ *e_com++ = '*'; if (*buf_ptr != ' ' && !parser_state_tos->box_com) *e_com++ = ' '; *e_com = '\0'; if (troff) { now_col = 1; adj_max_col = 80; } else /* figure what column we would be in if we printed the comment now */ now_col = count_spaces (parser_state_tos->com_col, s_com); /* Start to copy the comment */ while (1) { /* this loop will go until the comment is copied */ if (*buf_ptr > 040 && *buf_ptr != '*') parser_state_tos->last_nl = 0; check_com_size; switch (*buf_ptr) { /* this checks for various spcl cases */ case 014: /* check for a form feed */ if (!parser_state_tos->box_com) { /* in a text comment, break the line here */ parser_state_tos->use_ff = true; /* fix so dump_line uses a form feed */ dump_line (); last_bl = 0; *e_com++ = ' '; *e_com++ = '*'; *e_com++ = ' '; while (*++buf_ptr == ' ' || *buf_ptr == '\t'); } else { if (++buf_ptr >= buf_end) fill_buffer (); *e_com++ = 014; } break; case '\n': if (had_eof) { /* check for unexpected eof */ printf ("Unterminated comment\n"); *e_com = '\0'; dump_line (); return; } one_liner = 0; if (parser_state_tos->box_com || parser_state_tos->last_nl) { /* if this is a boxed comment, we dont ignore the newline */ if (s_com == e_com) { *e_com++ = ' '; *e_com++ = ' '; } *e_com = '\0'; if (!parser_state_tos->box_com && e_com - s_com > 3) { if (break_delim == 1 && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } dump_line (); check_com_size; *e_com++ = ' '; *e_com++ = ' '; } dump_line (); now_col = parser_state_tos->com_col; } else { parser_state_tos->last_nl = 1; if (unix_comment != 1) { /* we not are in unix_style comment */ if (unix_comment == 0 && s_code == e_code) { /* if it is a UNIX-style comment, ignore the requirement that previous line be blank for unindention */ parser_state_tos->com_col = ((parser_state_tos->ind_level - unindent_displace) + ind_size); if (parser_state_tos->com_col <= 1) parser_state_tos->com_col = 2; } unix_comment = 2; /* permanently remember that we are in this type of comment */ dump_line (); ++line_no; now_col = parser_state_tos->com_col; *e_com++ = ' '; /* fix so that the star at the start of the line will line up */ do /* flush leading white space */ if (++buf_ptr >= buf_end) fill_buffer (); while (*buf_ptr == ' ' || *buf_ptr == '\t'); break; } if (*(e_com - 1) == ' ' || *(e_com - 1) == '\t') last_bl = e_com - 1; /* if there was a space at the end of the last line, remember where it was */ else { /* otherwise, insert one */ last_bl = e_com; check_com_size; *e_com++ = ' '; ++now_col; } } ++line_no; /* keep track of input line number */ if (!parser_state_tos->box_com) { int nstar = 1; do { /* flush any blanks and/or tabs at start of next line */ if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '*' && --nstar >= 0) { if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '/') goto end_of_comment; } } while (*buf_ptr == ' ' || *buf_ptr == '\t'); } else if (++buf_ptr >= buf_end) fill_buffer (); break; /* end of case for newline */ case '*': /* must check for possibility of being at end of comment */ if (++buf_ptr >= buf_end) /* get to next char after * */ fill_buffer (); if (unix_comment == 0)/* set flag to show we are not in unix-style comment */ unix_comment = 1; if (*buf_ptr == '/') { /* it is the end!!! */ end_of_comment: if (++buf_ptr >= buf_end) fill_buffer (); if (*(e_com - 1) != ' ' && !parser_state_tos->box_com) { /* insure blank before end */ *e_com++ = ' '; ++now_col; } if (break_delim == 1 && !one_liner && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } if (break_delim == 2 && e_com > s_com + 3 /* now_col > adj_max_col - 2 && !parser_state_tos->box_com */ ) { *e_com = '\0'; dump_line (); now_col = parser_state_tos->com_col; } check_com_size; *e_com++ = '*'; *e_com++ = '/'; *e_com = '\0'; parser_state_tos->just_saw_decl = l_just_saw_decl; return; } else { /* handle isolated '*' */ *e_com++ = '*'; ++now_col; } break; default: /* we have a random char */ if (unix_comment == 0 && *buf_ptr != ' ' && *buf_ptr != '\t') unix_comment = 1; /* we are not in unix-style comment */ *e_com = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); if (*e_com == '\t') /* keep track of column */ now_col = now_col + tabsize - (now_col - 1) % tabsize; else if (*e_com == '\b') /* this is a backspace */ --now_col; else ++now_col; if (*e_com == ' ' || *e_com == '\t') last_bl = e_com; /* remember we saw a blank */ ++e_com; if (now_col > adj_max_col && !parser_state_tos->box_com && unix_comment == 1 && e_com[-1] > ' ') { /* the comment is too long, it must be broken up */ if (break_delim == 1 && s_com[0] == '/' && s_com[1] == '*' && s_com[2] == ' ') { char *t = e_com; break_delim = 2; e_com = s_com + 2; *e_com = 0; if (blanklines_before_blockcomments) prefix_blankline_requested = 1; dump_line (); e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } if (last_bl == 0) { /* we have seen no blanks */ last_bl = e_com; /* fake it */ *e_com++ = ' '; } *e_com = '\0'; /* print what we have */ *last_bl = '\0'; while (last_bl > s_com && last_bl[-1] < 040) *--last_bl = 0; e_com = last_bl; dump_line (); *e_com++ = ' '; /* add blanks for continuation */ *e_com++ = ' '; *e_com++ = ' '; t_ptr = last_bl + 1; last_bl = 0; if (t_ptr >= e_com) { while (*t_ptr == ' ' || *t_ptr == '\t') t_ptr++; while (*t_ptr != '\0') { /* move unprinted part of comment down in buffer */ if (*t_ptr == ' ' || *t_ptr == '\t') last_bl = e_com; *e_com++ = *t_ptr++; } } *e_com = '\0'; /* recompute current position */ now_col = count_spaces (parser_state_tos->com_col, s_com); } break; } } } indent-2.2.11/regression/input/comments2.c0000644000177400010010000000023010775646104015371 00000000000000void count_memory() { int lc = 0, /* local clients */ ch = 0, /* channels */ co = 0; /* conf lines */ } indent-2.2.11/regression/input/class-func.cc0000644000177400010010000000005310775646104015666 00000000000000classname::procname () { if (a) 1; } indent-2.2.11/regression/input/bbb-test.c0000644000177400010010000000105210775646104015167 00000000000000int x; /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ #if x /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ void main (int argc, char *argv[]) { int y; printf ("foo"); /********************************* * Block Comment * * */ } indent-2.2.11/regression/input/sizeof-in-while.c0000644000177400010010000000006110775646104016475 00000000000000f () { do g (); while (sizeof (char)); } indent-2.2.11/regression/input/comment-break.c0000644000177400010010000000106310775646104016213 00000000000000int snafuscate(// char *foo, /* text to be snafuscated */ int bar, /* snafuscation index. NOTE: For non-integral snafuscation indices, use fsnafuscate(). */ int flags) /* defined in snafuscate.h */ { } int snafuscate(/* */ char *foo, /* text to be snafuscated */ int bar, /* snafuscation index. NOTE: For non-integral snafuscation indices, use fsnafuscate(). */ int flags) /* defined in snafuscate.h */ { } indent-2.2.11/regression/input/indent.c.~1~0000644000177400010010000014437711331271327015511 00000000000000 /* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" #include void usage () { fprintf (stderr, "usage: indent file [-o outfile ] [ options ]\n"); fprintf (stderr, " indent file1 file2 ... fileN [ options ]\n"); exit (1); } /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *labbuf; char *s_lab; char *e_lab; char *l_lab; char *codebuf; char *s_code; char *e_code; char *l_code; char *combuf; char *s_com; char *e_com; char *l_com; struct buf save_com; char *bp_save; char *be_save; int code_lines; int line_no; struct fstate keywordf; struct fstate stringf; struct fstate boxcomf; struct fstate blkcomf; struct fstate scomf; struct fstate bodyf; int break_comma; /* Insure that BUFSTRUC has at least REQ more chars left, if not extend it. Note: This may change bufstruc.ptr. */ #define need_chars(bufstruc, req) \ if ((bufstruc.end - bufstruc.ptr + (req)) >= bufstruc.size) \ {\ int cur_chars = bufstruc.end - bufstruc.ptr;\ bufstruc.size *= 2;\ bufstruc.ptr = xrealloc(bufstruc.ptr,bufstruc.size);\ bufstruc.end = bufstruc.ptr + cur_chars;\ } int else_or_endif; /* true iff last keyword was an else */ int last_else; /* True if we have just encountered the end of an if (...), etc. (i.e. the ')' of the if (...) was the last token). The variable is set to 2 in the middle of the main token reading loop and is decremented at the beginning of the loop, so it will reach zero when the second token after the ')' is read. */ int last_token_ends_sp; /* current indentation for declarations */ int dec_ind; /* structure indentation levels */ int *di_stack; /* Currently allocated size of di_stack. */ int di_stack_alloc; /* used when buffering up comments to remember that a newline was passed over */ int flushed_nl; int force_nl; /* set to true when we see a case, so we will know what to do with the following colon */ int scase; /* when true, we are in the expressin of if(...), while(...), etc. */ int sp_sw; /* when this is positive, we have seen a ? without the matching : in a ?: construct */ int squest; static void indent (this_file) struct file_buffer *this_file; { register int i; enum codes hd_type; register char *t_ptr; enum codes type_code; int dec_ind; /* current indentation for declarations */ int flushed_nl; int force_nl; int scase; /* true when we've just see a case */ int sp_sw; /* when true, we are in the expressin of if(...), while(...), etc. */ /* True if we have just encountered the end of an if (...), etc. (i.e. the ')' of the if (...) was the last token). The variable is set to 2 in the middle of the main token reading loop and is decremented at the beginning of the loop, so it will reach zero when the second token after the ')' is read. */ int last_token_ends_sp; int squest; /* when this is positive, we have seen a ? without the matching : in a ?: construct */ int last_else; /* true iff last keyword was an else */ in_prog = in_prog_pos = this_file->data; in_prog_size = this_file->size; hd_type = code_eof; dec_ind = 0; last_token_ends_sp = false; last_else = false; sp_sw = force_nl = false; scase = false; if (com_ind <= 1) com_ind = 2; /* dont put normal comments before column 2 */ if (troff) { if (bodyf.font[0] == 0) parsefont (&bodyf, "R"); if (scomf.font[0] == 0) parsefont (&scomf, "I"); if (blkcomf.font[0] == 0) blkcomf = scomf, blkcomf.size += 2; if (boxcomf.font[0] == 0) boxcomf = blkcomf; if (stringf.font[0] == 0) parsefont (&stringf, "L"); if (keywordf.font[0] == 0) parsefont (&keywordf, "B"); writefdef (&bodyf, 'B'); writefdef (&scomf, 'C'); writefdef (&blkcomf, 'L'); writefdef (&boxcomf, 'X'); writefdef (&stringf, 'S'); writefdef (&keywordf, 'K'); } if (block_comment_max_col <= 0) block_comment_max_col = max_col; if (decl_com_ind <= 0) /* if not specified by user, set this */ decl_com_ind = ljust_decl ? (com_ind <= 10 ? 2 : com_ind - 8) : com_ind; if (continuation_indent == 0) continuation_indent = ind_size; fill_buffer (); /* get first batch of stuff into input buffer */ parse (semicolon); { register char *p = buf_ptr; register col = 1; while (1) { if (*p == ' ') col++; else if (*p == '\t') col = ((col - 1) & ~7) + 9; else break; p++; } if (col > ind_size) parser_state_tos->ind_level = parser_state_tos->i_l_follow = col; } if (troff) { register char *p = in_name, *beg = in_name; while (*p) if (*p++ == '/') beg = p; fprintf (output, ".Fn \"%s\"\n", beg); } /* START OF MAIN LOOP */ while (1) { /* this is the main loop. it will go until we reach eof */ int is_procname; type_code = lexi (); /* lexi reads one token. "token" points to the actual characters. lexi returns a code indicating the type of token */ if (last_token_ends_sp > 0) last_token_ends_sp--; is_procname = parser_state_tos->procname[0]; /* The following code moves everything following an if (), while (), else, etc. up to the start of the following stmt to a buffer. This allows proper handling of both kinds of brace placement. */ flushed_nl = false; while (parser_state_tos->search_brace) { /* After scanning an if(), while (), etc., it might be necessary to keep track of the text between the if() and the start of the statement which follows. Use save_com to do so. */ switch (type_code) { case newline: ++line_no; flushed_nl = true; case form_feed: break; /* form feeds and newlines found here will be ignored */ case lbrace: /* this is a brace that starts the compound stmt */ if (save_com.end == save_com.ptr) { /* ignore buffering if a comment wasnt stored up */ parser_state_tos->search_brace = false; goto check_type; } /* We need to put the '{' back into save_com somewhere. */ if (btype_2) /* Put it at the beginning, e.g. if (foo) { / * comment here * / */ save_com.ptr[0] = '{'; else { /* Put it at the end, e.g. if (foo) / * comment here * / { */ /* Putting in this newline causes a dump_line to occur right after the comment, thus insuring that it will be put in the correct column. */ *save_com.end++ = '\n'; *save_com.end++ = '{'; } /* Go to common code to get out of this loop. */ goto sw_buffer; case comment: /* we have a comment, so we must copy it into the buffer */ if (!flushed_nl || save_com.end != save_com.ptr) { need_chars (save_com, 10); if (save_com.end == save_com.ptr) { /* if this is the first comment, we must set up the buffer */ save_com.ptr[0] = save_com.ptr[1] = ' '; save_com.end = save_com.ptr + 2; } else { *save_com.end++ = '\n'; /* add newline between comments */ *save_com.end++ = ' '; --line_no; } *save_com.end++ = '/'; /* copy in start of comment */ *save_com.end++ = '*'; for (;;) { /* loop until we get to the end of the comment */ /* make sure there is room for this character and (while we're at it) the '/' we might add at the end of the loop. */ need_chars (save_com, 2); *save_com.end = *buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer (); if (had_eof) { diag (1, "Unclosed comment"); exit (1); } } if (*save_com.end++ == '*' && *buf_ptr == '/') break; /* we are at end of comment */ } *save_com.end++ = '/'; /* add ending slash */ if (++buf_ptr >= buf_end) /* get past / in buffer */ fill_buffer (); break; } default: /* it is the start of a normal statment */ if (flushed_nl) /* if we flushed a newline, make sure it is put back */ force_nl = true; if ((type_code == sp_paren && *token == 'i' && last_else && else_if) || (type_code == sp_nparen && *token == 'e' && e_code != s_code && e_code[-1] == '}')) force_nl = false; if (save_com.end == save_com.ptr) { /* ignore buffering if comment wasnt saved up */ parser_state_tos->search_brace = false; goto check_type; } if (force_nl) { /* if we should insert a nl here, put it into the buffer */ force_nl = false; --line_no; /* this will be re-increased when the nl is read from the buffer */ need_chars (save_com, 2); *save_com.end++ = '\n'; *save_com.end++ = ' '; if (verbose && !flushed_nl) /* print error msg if the line was not already broken */ diag (0, "Line broken"); flushed_nl = false; } for (t_ptr = token; t_ptr < token_end; ++t_ptr) { need_chars (save_com, 1); *save_com.end++ = *t_ptr; /* copy token into temp buffer */ } parser_state_tos->procname = "\0"; sw_buffer: parser_state_tos->search_brace = false; /* stop looking for start of stmt */ bp_save = buf_ptr;/* save current input buffer */ be_save = buf_end; buf_ptr = save_com.ptr; /* fix so that subsequent calls to lexi will take tokens out of save_com */ need_chars (save_com, 1); *save_com.end++ = ' '; /* add trailing blank, just in case */ buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ break; } /* end of switch */ /* we must make this check, just in case there was an unexpected EOF */ if (type_code != code_eof) type_code = lexi ();/* read another token */ /* if (parser_state_tos->search_brace) parser_state_tos->procname[0] = 0; */ if ((is_procname = parser_state_tos->procname[0]) && flushed_nl && !procnames_start_line && parser_state_tos->in_decl && type_code == ident) flushed_nl = 0; } /* end of while (search_brace) */ last_else = 0; check_type: if (type_code == code_eof) { /* we got eof */ if (s_lab != e_lab || s_code != e_code || s_com != e_com)/* must dump end of line */ dump_line (); if (parser_state_tos->tos > 1) /* check for balanced braces */ diag (1, "Stuff missing from end of file."); if (verbose) { printf ("There were %d output lines and %d comments\n", out_lines, out_coms); printf ("(Lines with comments)/(Lines with code): %6.3f\n", (1.0 * com_lines) / code_lines); } fflush (output); if (found_err) exit (found_err); return; } if ((type_code != comment) && (type_code != newline) && (type_code != preesc) && (type_code != form_feed)) { if (force_nl && (type_code != semicolon) && (type_code != lbrace || !btype_2)) { /* we should force a broken line here */ if (verbose && !flushed_nl) diag (0, "Line broken"); flushed_nl = false; dump_line (); parser_state_tos->want_blank = false; /* dont insert blank at line start */ force_nl = false; } parser_state_tos->in_stmt = true; /* turn on flag which causes an extra level of indentation. this is turned off by a ; or } */ if (s_com != e_com) { /* the turkey has embedded a comment in a line. Move it from the com buffer to the code buffer. */ /* Do not add a space before the comment if it is the first thing on the line. */ if (e_code != s_code) { *e_code++ = ' '; } for (t_ptr = s_com; *t_ptr; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } *e_code++ = ' '; *e_code = '\0'; /* null terminate code sect */ parser_state_tos->want_blank = false; e_com = s_com; } } else if (type_code != comment) /* preserve force_nl thru a comment */ force_nl = false; /* cancel forced newline after newline, form feed, etc */ /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ check_code_size; switch (type_code) { /* now, decide what to do with the token */ case form_feed: /* found a form feed in line */ parser_state_tos->use_ff = true; /* a form feed is treated much like a newline */ dump_line (); parser_state_tos->want_blank = false; break; case newline: if (parser_state_tos->last_token != comma || parser_state_tos->p_l_follow > 0 || !leave_comma || parser_state_tos->block_init || !break_comma || s_com != e_com) { dump_line (); parser_state_tos->want_blank = false; } /* If we were on the line with a #else or a #endif, we aren't anymore. */ else_or_endif = false; ++line_no; /* keep track of input line number */ break; case lparen: /* Braces in initializer lists should be put on new lines. This is necessary so that -gnu does not cause things like char *this_is_a_string_array[] = { "foo", "this_string_does_not_fit", "nor_does_this_rather_long_string" } which is what happens because we are trying to line the strings up with the parentheses, and those that are too long are moved to the right an ugly amount. However, if the current line is empty, the left brace is already on a new line, so don't molest it. */ if (token[0] == '{' && (s_code != e_code || s_com != e_com || s_lab != e_lab)) { dump_line (); /* Do not put a space before the '{'. */ parser_state_tos->want_blank = false; } /* Count parens so we know how deep we are. */ if (++parser_state_tos->p_l_follow >= parser_state_tos->paren_indents_size) { parser_state_tos->paren_indents_size *= 2; parser_state_tos->paren_indents = (short *) xrealloc (parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } parser_state_tos->paren_depth++; if (parser_state_tos->want_blank && *token != '[' && (parser_state_tos->last_token != ident || proc_calls_space || (parser_state_tos->its_a_keyword && (!parser_state_tos->sizeof_keyword || blank_after_sizeof)))) *e_code++ = ' '; if (parser_state_tos->in_decl && !parser_state_tos->block_init) if (troff && !parser_state_tos->dumped_decl_indent && !is_procname && parser_state_tos->last_token == decl) { parser_state_tos->dumped_decl_indent = 1; sprintf (e_code, "\n.Du %dp+\200p \"%.*s\"\n", dec_ind * 7, token_end - token, token); e_code += strlen (e_code); } else { while ((e_code - s_code) < dec_ind) { check_code_size; *e_code++ = ' '; } *e_code++ = token[0]; } else *e_code++ = token[0]; parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] = e_code - s_code; if (sp_sw && parser_state_tos->p_l_follow == 1 && extra_expression_indent && parser_state_tos->paren_indents[0] < 2 * ind_size) parser_state_tos->paren_indents[0] = 2 * ind_size; parser_state_tos->want_blank = false; if (parser_state_tos->in_or_st && *token == '(' && parser_state_tos->tos <= 2) { /* this is a kluge to make sure that declarations will be aligned right if proc decl has an explicit type on it, i.e. "int a(x) {..." */ parse_lparen_in_decl (); /* Turn off flag for structure decl or initialization. */ parser_state_tos->in_or_st = false; } if (parser_state_tos->sizeof_keyword) parser_state_tos->sizeof_mask |= 1 << parser_state_tos->p_l_follow; /* The '(' that starts a cast can never be preceeded by an indentifier or decl. */ if (parser_state_tos->last_token == decl || (parser_state_tos->last_token == ident && parser_state_tos->last_rw != rw_return)) parser_state_tos->noncast_mask |= 1 << parser_state_tos->p_l_follow; else parser_state_tos->noncast_mask &= ~(1 << parser_state_tos->p_l_follow); break; case rparen: if (parser_state_tos->cast_mask & (1 << parser_state_tos->p_l_follow) & ~parser_state_tos->sizeof_mask) { parser_state_tos->last_u_d = true; parser_state_tos->cast_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (!parser_state_tos->cast_mask && cast_space) parser_state_tos->want_blank = true; else parser_state_tos->want_blank = false; } parser_state_tos->sizeof_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (--parser_state_tos->p_l_follow < 0) { parser_state_tos->p_l_follow = 0; diag (0, "Extra %c", *token); } parser_state_tos->paren_depth--; /* if the paren starts the line, then indent it */ if (e_code == s_code) { int level = parser_state_tos->p_l_follow; parser_state_tos->paren_level = level; if (level > 0) paren_target = -parser_state_tos->paren_indents[level - 1]; else paren_target = 0; } else if (parser_state_tos->in_decl && parser_state_tos->paren_depth == 0) parser_state_tos->want_blank = true; *e_code++ = token[0]; #if 0 if (!parser_state_tos->cast_mask || cast_space) parser_state_tos->want_blank = true; #endif /* check for end of if (...), or some such */ if (sp_sw && (parser_state_tos->p_l_follow == 0)) { /* Indicate that we have just left the parenthesized expression of a while, if, or for, unless we are getting out of the parenthesized expression of the while of a do-while loop. (do-while is different because a semicolon immediately following this will not indicate a null loop body). */ if (parser_state_tos->p_stack[parser_state_tos->tos] != dohead) last_token_ends_sp = 2; sp_sw = false; force_nl = true; /* must force newline after if */ parser_state_tos->last_u_d = true; /* inform lexi that a following operator is unary */ parser_state_tos->in_stmt = false; /* dont use stmt continuation indentation */ parse (hd_type); /* let parser worry about if, or whatever */ } parser_state_tos->search_brace = btype_2; /* this should insure that constructs such as main(){...} and int[]{...} have their braces put in the right place */ break; case unary_op: /* this could be any unary operation */ if (parser_state_tos->want_blank) *e_code++ = ' '; if (troff && !parser_state_tos->dumped_decl_indent && parser_state_tos->in_decl && !is_procname) { sprintf (e_code, "\n.Du %dp+\200p \"%.*s\"\n", dec_ind * 7, token_end - token, token); parser_state_tos->dumped_decl_indent = 1; e_code += strlen (e_code); } else { char *res = token; char *res_end = token_end; /* if this is a unary op in a declaration, we should indent this token */ if (parser_state_tos->paren_depth == 0 && parser_state_tos->in_decl && !parser_state_tos->block_init) { while ((e_code - s_code) < (dec_ind - (token_end - token))) { check_code_size; *e_code++ = ' '; } } if (troff && token[0] == '-' && token[1] == '>') { static char resval[] = "\\(->"; res = resval; res_end = res + sizeof (resval); } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } } parser_state_tos->want_blank = false; break; case binary_op: /* any binary operation */ if (parser_state_tos->want_blank || (e_code > s_code && *e_code != ' ')) *e_code++ = ' '; { char *res = token; char *res_end = token_end; #define set_res(str) \ {\ static char resval[] = str;\ res = resval;\ res_end = res + sizeof(resval);\ } if (troff) switch (token[0]) { case '<': if (token[1] == '=') set_res ("\\(<="); break; case '>': if (token[1] == '=') set_res ("\\(>="); break; case '!': if (token[1] == '=') set_res ("\\(!="); break; case '|': if (token[1] == '|') { set_res ("\\(br\\(br"); } else if (token[1] == 0) set_res ("\\(br"); break; } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; /* move the operator */ } } parser_state_tos->want_blank = true; break; case postop: /* got a trailing ++ or -- */ *e_code++ = token[0]; *e_code++ = token[1]; parser_state_tos->want_blank = true; break; case question: /* got a ? */ squest++; /* this will be used when a later colon appears so we can distinguish the ?: construct */ if (parser_state_tos->want_blank) *e_code++ = ' '; *e_code++ = '?'; parser_state_tos->want_blank = true; break; case casestmt: /* got word 'case' or 'default' */ scase = true; /* so we can process the later colon properly */ goto copy_id; case colon: /* got a ':' */ if (squest > 0) { /* it is part of the ?: construct */ --squest; if (parser_state_tos->want_blank) *e_code++ = ' '; *e_code++ = ':'; parser_state_tos->want_blank = true; break; } if (parser_state_tos->in_decl) { *e_code++ = ':'; parser_state_tos->want_blank = false; break; } parser_state_tos->in_stmt = false; /* seeing a label does not imply we are in a stmt */ for (t_ptr = s_code; *t_ptr; ++t_ptr) *e_lab++ = *t_ptr; /* turn everything so far into a label */ e_code = s_code; *e_lab++ = ':'; *e_lab++ = ' '; *e_lab = '\0'; /* parser_state_tos->pcas e will be used by dump_line to decide how to indent the label. force_nl will force a case n: to be on a line by itself */ force_nl = parser_state_tos->pcase = scase; scase = false; parser_state_tos->want_blank = false; break; case semicolon: /* we are not in an initialization or structure declaration */ parser_state_tos->in_or_st = false; scase = false; squest = 0; /* The following code doesn't seem to do much good. Just because we've found something like extern int foo(); or int (*foo)(); doesn't mean we are out of a declaration. Now if it was serving some purpose we'll have to address that.... if (parser_state_tos->last_token == rparen) parser_state_tos->in_parameter_declaration = 0; */ parser_state_tos->cast_mask = 0; parser_state_tos->sizeof_mask = 0; parser_state_tos->block_init = 0; parser_state_tos->block_init_level = 0; parser_state_tos->just_saw_decl--; if (parser_state_tos->in_decl && s_code == e_code && !parser_state_tos->block_init) while ((e_code - s_code) < (dec_ind - 1)) { check_code_size; *e_code++ = ' '; } /* if we were in a first level structure declaration, we aren't any more */ parser_state_tos->in_decl = (parser_state_tos->dec_nest > 0); if ((!sp_sw || hd_type != forstmt) && parser_state_tos->p_l_follow > 0) { /* This should be true iff there were unbalanced parens in the stmt. It is a bit complicated, because the semicolon might be in a for stmt */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; if (sp_sw) { /* this is a check for a if, while, etc. with unbalanced parens */ sp_sw = false; parse (hd_type); /* dont lose the if, or whatever */ } } /* If we have a semicolon following an if, while, or for, and the user wants us to, we should insert a space (to show that there is a null statement there). */ if (last_token_ends_sp && space_sp_semicolon) { *e_code++ = ' '; } *e_code++ = ';'; parser_state_tos->want_blank = true; /* we are no longer in the middle of a stmt */ parser_state_tos->in_stmt = (parser_state_tos->p_l_follow > 0); if (!sp_sw) { /* if not if for (;;) */ parse (semicolon);/* let parser know about end of stmt */ force_nl = true; /* force newline after a end of stmt */ } break; case lbrace: /* got a '{' */ parser_state_tos->in_stmt = false; /* dont indent the {} */ if (!parser_state_tos->block_init) force_nl = true; /* force other stuff on same line as '{' onto new line */ else if (parser_state_tos->block_init_level <= 0) parser_state_tos->block_init_level = 1; else parser_state_tos->block_init_level++; if (s_code != e_code && !parser_state_tos->block_init) { if (!btype_2) { dump_line (); parser_state_tos->want_blank = false; } else { if (parser_state_tos->in_parameter_declaration && !parser_state_tos->in_or_st) { parser_state_tos->i_l_follow = 0; dump_line (); parser_state_tos->want_blank = false; } else parser_state_tos->want_blank = true; } } if (parser_state_tos->in_parameter_declaration) prefix_blankline_requested = 0; if (parser_state_tos->p_l_follow > 0) { /* check for preceeding unbalanced parens */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; if (sp_sw) { /* check for unclosed if, for, etc. */ sp_sw = false; parse (hd_type); parser_state_tos->ind_level = parser_state_tos->i_l_follow; } } if (s_code == e_code) parser_state_tos->ind_stmt = false; /* dont put extra indentation on line with '{' */ if (parser_state_tos->in_decl && parser_state_tos->in_or_st) { /* This is a structure declaration. */ if (parser_state_tos->dec_nest >= di_stack_alloc) { di_stack_alloc *= 2; di_stack = (int *) xrealloc (di_stack, di_stack_alloc * sizeof (*di_stack)); } di_stack[parser_state_tos->dec_nest++] = dec_ind; /* ? dec_ind = 0; */ } else { parser_state_tos->decl_on_line = false; /* we cant be in the middle of a declaration, so dont do special indentation of comments */ #if 0 /* Doesn't work currently. */ if (blanklines_after_declarations_at_proctop && parser_state_tos->in_parameter_declaration) postfix_blankline_requested = 1; #endif parser_state_tos->in_parameter_declaration = 0; } dec_ind = 0; /* We are no longer looking for an initializer or structure. Needed so that the '=' in "enum bar {a = 1" does not get interpreted as the start of an initializer. */ parser_state_tos->in_or_st = false; parse (lbrace); /* let parser know about this */ if (parser_state_tos->want_blank) /* put a blank before '{' if '{' is not at start of line */ *e_code++ = ' '; parser_state_tos->want_blank = false; *e_code++ = '{'; parser_state_tos->just_saw_decl = 0; break; case rbrace: /* got a '}' */ /* semicolons can be omitted in declarations */ if (parser_state_tos->p_stack[parser_state_tos->tos] == decl && !parser_state_tos->block_init) parse (semicolon); if (parser_state_tos->p_l_follow) { /* check for unclosed if, for, else. */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; sp_sw = false; } parser_state_tos->just_saw_decl = 0; parser_state_tos->block_init_level--; if (s_code != e_code && !parser_state_tos->block_init) { /* '}' must be first on line */ if (verbose) diag (0, "Line broken"); dump_line (); } *e_code++ = '}'; parser_state_tos->want_blank = true; parser_state_tos->in_stmt = parser_state_tos->ind_stmt = false; if (parser_state_tos->dec_nest > 0) { /* we are in multi-level structure declaration */ dec_ind = di_stack[--parser_state_tos->dec_nest]; if (parser_state_tos->dec_nest == 0 && !parser_state_tos->in_parameter_declaration) parser_state_tos->just_saw_decl = 2; parser_state_tos->in_decl = true; } prefix_blankline_requested = 0; parse (rbrace); /* let parser know about this */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dohead && !btype_2) force_nl = true; parser_state_tos->search_brace = (cuddle_else && parser_state_tos->p_stack[parser_state_tos->tos] == ifhead); #if 0 parser_state_tos->search_brace = (cuddle_else && parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && (parser_state_tos->il[parser_state_tos->tos] >= parser_state_tos->ind_level)); #endif if (parser_state_tos->tos <= 1 && blanklines_after_procs && parser_state_tos->dec_nest <= 0) postfix_blankline_requested = 1; break; case swstmt: /* got keyword "switch" */ sp_sw = true; hd_type = swstmt; /* keep this for when we have seen the expression */ goto copy_id; /* go move the token into buffer */ case sp_paren: /* token is if, while, for */ sp_sw = true; /* the interesting stuff is done after the expression is scanned */ hd_type = (*token == 'i' ? ifstmt : (*token == 'w' ? whilestmt : forstmt)); /* remember the type of header for later use by parser */ goto copy_id; /* copy the token into line */ case sp_nparen: /* got else, do */ parser_state_tos->in_stmt = false; if (*token == 'e') { if (e_code != s_code && (!cuddle_else || e_code[-1] != '}')) { if (verbose) diag (0, "Line broken"); dump_line (); /* make sure this starts a line */ parser_state_tos->want_blank = false; } force_nl = true; /* also, following stuff must go onto new line */ last_else = 1; parse (elselit); } else { if (e_code != s_code) { /* make sure this starts a line */ if (verbose) diag (0, "Line broken"); dump_line (); parser_state_tos->want_blank = false; } force_nl = true; /* also, following stuff must go onto new line */ last_else = 0; parse (dolit); } goto copy_id; /* move the token into line */ case decl: /* we have a declaration type (int, register, etc.) */ parse (decl); /* let parser worry about indentation */ if (parser_state_tos->last_token == rparen && parser_state_tos->tos <= 1) { parser_state_tos->in_parameter_declaration = 1; if (s_code != e_code) { dump_line (); parser_state_tos->want_blank = false; } } if (parser_state_tos->in_parameter_declaration && indent_parameters && parser_state_tos->dec_nest == 0 && parser_state_tos->p_l_follow == 0) { parser_state_tos->ind_level = parser_state_tos->i_l_follow = indent_parameters; parser_state_tos->ind_stmt = 0; } /* in_or_st set for struct or initialization decl. Don't set it if we're in ansi prototype */ if (!parser_state_tos->paren_depth) parser_state_tos->in_or_st = true; parser_state_tos->in_decl = parser_state_tos->decl_on_line = true; #if 0 if (!parser_state_tos->in_or_st && parser_state_tos->dec_nest <= 0) #endif if (parser_state_tos->dec_nest <= 0) parser_state_tos->just_saw_decl = 2; if (prefix_blankline_requested && (parser_state_tos->block_init != 0 || parser_state_tos->block_init_level != -1 || parser_state_tos->last_token != rbrace || e_code != s_code || e_lab != s_lab || e_com != s_com)) prefix_blankline_requested = 0; i = token_end - token + 1; /* get length of token plus 1 */ /* dec_ind = e_code - s_code + (parser_state_tos->decl_indent>i ? parser_state_tos->decl_indent : i); */ dec_ind = decl_indent > 0 ? decl_indent : i; goto copy_id; case ident: /* got an identifier or constant */ /* If we are in a declaration, we must indent identifier. But not inside the parentheses of an ANSI function declaration. */ if (parser_state_tos->in_decl && parser_state_tos->p_l_follow == 0 && parser_state_tos->last_token != rbrace) { if (parser_state_tos->want_blank) *e_code++ = ' '; parser_state_tos->want_blank = false; if (is_procname == 0 || !procnames_start_line) { if (!parser_state_tos->block_init) if (troff && !parser_state_tos->dumped_decl_indent) { sprintf (e_code, "\n.De %dp+\200p\n", dec_ind * 7); parser_state_tos->dumped_decl_indent = 1; e_code += strlen (e_code); } else while ((e_code - s_code) < dec_ind) { check_code_size; *e_code++ = ' '; } } else { if (dec_ind && s_code != e_code) dump_line (); dec_ind = 0; parser_state_tos->want_blank = false; } } else if (sp_sw && parser_state_tos->p_l_follow == 0) { sp_sw = false; force_nl = true; parser_state_tos->last_u_d = true; parser_state_tos->in_stmt = false; parse (hd_type); } copy_id: if (parser_state_tos->want_blank) *e_code++ = ' '; if (troff && parser_state_tos->its_a_keyword) { e_code = chfont (&bodyf, &keywordf, e_code); for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size; *e_code++ = keywordf.allcaps && islower (*t_ptr) ? toupper (*t_ptr) : *t_ptr; } e_code = chfont (&keywordf, &bodyf, e_code); } else { /* Troff mode requires that strings be processed specially. */ if (troff && (*token == '"' || *token == '\'')) { char qchar; qchar = *token; *e_code++ = '`'; if (qchar == '"') *e_code++ = '`'; e_code = chfont (&bodyf, &stringf, e_code); t_ptr = token + 1; while (t_ptr < token_end) { *e_code = *t_ptr++; if (*e_code == '\\') { *++e_code = '\\'; if (*t_ptr == '\\') *++e_code = '\\'; /* Copy char after backslash. */ *++e_code = *t_ptr++; /* Point after the last char we copied. */ e_code++; } } e_code = chfont (&stringf, &bodyf, e_code - 1); if (qchar == '"') *e_code++ = '\''; } else for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } } parser_state_tos->want_blank = true; /* If the token is va_dcl, it appears without a semicolon, so we need to pretend that one was there. */ if ((token_end - token) == 6 && strncmp (token, "va_dcl", 6) == 0) { parser_state_tos->in_or_st = false; parser_state_tos->just_saw_decl--; parser_state_tos->in_decl = 0; parse (semicolon); force_nl = true; } break; case period: /* treat a period kind of like a binary operation */ *e_code++ = '.'; /* move the period into line */ parser_state_tos->want_blank = false; /* dont put a blank after a period */ break; case comma: /* only put blank after comma if comma does not start the line */ parser_state_tos->want_blank = (s_code != e_code); if (parser_state_tos->paren_depth == 0 && parser_state_tos->in_decl && is_procname == 0 && !parser_state_tos->block_init) while ((e_code - s_code) < (dec_ind - 1)) { check_code_size; *e_code++ = ' '; } *e_code++ = ','; if (parser_state_tos->p_l_follow == 0) { if (parser_state_tos->block_init_level <= 0) parser_state_tos->block_init = 0; /* If we are in a declaration, and either the user wants all comma'd declarations broken, or the line is getting too long, break the line. */ if (break_comma && (!leave_comma || (compute_code_target () + (e_code - s_code) > max_col - 8) )) force_nl = true; } break; case preesc: /* got the character '#' */ if ((s_com != e_com) || (s_lab != e_lab) || (s_code != e_code)) dump_line (); *e_lab++ = '#'; /* move whole line to 'label' buffer */ { int in_comment = 0; int com_start = 0; char quote = 0; int com_end = 0; /* ANSI allows spaces between '#' and preprocessor directives. Remove such spaces unless user has specified "-lpb". */ while (*buf_ptr == ' ' || *buf_ptr == '\t') { if (leave_preproc_space) *e_lab++ = *buf_ptr; buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } while (*buf_ptr != '\n' || (in_comment && !had_eof)) { check_lab_size; *e_lab = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); switch (*e_lab++) { case BACKSLASH: if (troff) *e_lab++ = BACKSLASH; if (!in_comment) { *e_lab++ = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } break; case '/': if (*buf_ptr == '*' && !in_comment && !quote) { in_comment = 1; *e_lab++ = *buf_ptr++; com_start = e_lab - s_lab - 2; } break; case '"': if (quote == '"') quote = 0; break; case '\'': if (quote == '\'') quote = 0; break; case '*': if (*buf_ptr == '/' && in_comment) { in_comment = 0; *e_lab++ = *buf_ptr++; com_end = e_lab - s_lab; } break; } } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on preprocessor line */ if (save_com.end != save_com.ptr) { need_chars (save_com, 2); *save_com.end++ = '\n'; /* add newline between comments */ *save_com.end++ = ' '; --line_no; } need_chars (save_com, com_end - com_start); strncpy (save_com.end, s_lab + com_start, com_end - com_start); save_com.end += com_end - com_start; e_lab = s_lab + com_start; while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; bp_save = buf_ptr; /* save current input buffer */ be_save = buf_end; buf_ptr = save_com.ptr; /* fix so that subsequent calls to lexi will take tokens out of save_com */ need_chars (save_com, 1); *save_com.end++ = ' '; /* add trailing blank, just in case */ buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ } *e_lab = '\0'; /* null terminate line */ parser_state_tos->pcase = false; } if (strncmp (s_lab + 1, "if", 2) == 0) { if (blanklines_around_conditional_compilation) { register c; prefix_blankline_requested++; while ((c = *in_prog_pos++) == '\n'); in_prog_pos--; } { /* Push a copy of the parser_state onto the stack. All manipulations will use the copy at the top of stack, and then we can return to the previous state by popping the stack. */ struct parser_state *new; new = (struct parser_state *) xmalloc (sizeof (struct parser_state)); memcpy (new, parser_state_tos, sizeof (struct parser_state)); /* We need to copy the dynamically allocated arrays in the struct parser_state too. */ new->p_stack = (enum codes *) xmalloc (parser_state_tos->p_stack_size * sizeof (enum codes)); memcpy (new->p_stack, parser_state_tos->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); new->il = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); memcpy (new->il, parser_state_tos->il, parser_state_tos->p_stack_size * sizeof (int)); new->cstk = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); memcpy (new->cstk, parser_state_tos->cstk, parser_state_tos->p_stack_size * sizeof (int)); new->paren_indents = (short *) xmalloc (parser_state_tos->paren_indents_size * sizeof (short)); memcpy (new->paren_indents, parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); new->next = parser_state_tos; parser_state_tos = new; } } else if (strncmp (s_lab + 1, "else", 4) == 0) { /* When we get #else, we want to restore the parser state to what it was before the matching #if, so that things get lined up with the code before the #if. However, we do not want to pop the stack; we just want to copy the second to top elt of the stack because when we encounter the #endif, it will pop the stack. */ else_or_endif = true; if (parser_state_tos->next) { /* First save the addresses of the arrays for the top of stack. */ enum codes *tos_p_stack = parser_state_tos->p_stack; int *tos_il = parser_state_tos->il; int *tos_cstk = parser_state_tos->cstk; short *tos_paren_indents = parser_state_tos->paren_indents; struct parser_state *second = parser_state_tos->next; memcpy (parser_state_tos, second, sizeof (struct parser_state)); parser_state_tos->next = second; /* Now copy the arrays from the second to top of stack to the top of stack. */ /* Since the p_stack, etc. arrays only grow, never shrink, we know that they will be big enough to fit the array from the second to top of stack. */ parser_state_tos->p_stack = tos_p_stack; memcpy (parser_state_tos->p_stack, parser_state_tos->next->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); parser_state_tos->il = tos_il; memcpy (parser_state_tos->il, parser_state_tos->next->il, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->cstk = tos_cstk; memcpy (parser_state_tos->cstk, parser_state_tos->next->cstk, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->paren_indents = tos_paren_indents; memcpy (parser_state_tos->paren_indents, parser_state_tos->next->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } else diag (1, "Unmatched #else"); } else if (strncmp (s_lab + 1, "endif", 5) == 0) { else_or_endif = true; /* We want to remove the second to top elt on the stack, which was put there by #if and was used to restore the stack at the #else (if there was one). We want to leave the top of stack unmolested so that the state which we have been using is unchanged. */ if (parser_state_tos->next) { struct parser_state *second = parser_state_tos->next; parser_state_tos->next = second->next; free (second->p_stack); free (second->il); free (second->cstk); free (second->paren_indents); free (second); } else diag (1, "Unmatched #endif"); if (blanklines_around_conditional_compilation) { postfix_blankline_requested++; n_real_blanklines = 0; } } /* Normally, subsequent processing of the newline character causes the line to be printed. The following clause handles a special case (comma-separated declarations separated by the preprocessor lines) where this doesn't happen. */ if (parser_state_tos->last_token == comma && parser_state_tos->p_l_follow <= 0 && leave_comma && !parser_state_tos->block_init && break_comma && s_com == e_com) { dump_line (); parser_state_tos->want_blank = false; } break; case comment: /* we have gotten a /* this is a biggie */ if (flushed_nl) { /* we should force a broken line here */ flushed_nl = false; dump_line (); parser_state_tos->want_blank = false; /* dont insert blank at line start */ force_nl = false; } pr_comment (); break; } /* end of big switch stmt */ *e_code = '\0'; /* make sure code section is null terminated */ if (type_code != comment && type_code != newline && type_code != preesc && type_code != form_feed) parser_state_tos->last_token = type_code; } /* end of main while (1) loop */ } char *set_profile (); void set_defaults (); int set_option (); /* Points to current input file */ char *in_name = 0; /* Points to the name of the output file */ char *out_name = 0; /* How many input files were specified */ int input_files; /* Names of all input files */ char **in_file_names; /* Initial number of input filenames to allocate. */ int max_input_files = 128; #ifdef DEBUG int debug; #endif main (argc, argv) int argc; char **argv; { int i; struct file_buffer *current_input; char *profile_pathname = 0; int using_stdin = false; #ifdef DEBUG if (debug) { debug_init (); } #endif init_parser (); initialize_backups (); output = 0; input_files = 0; in_file_names = (char **) xmalloc (max_input_files * sizeof (char *)); set_defaults (); for (i = 1; i < argc; ++i) { if (strcmp (argv[i], "-npro") == 0 || strcmp (argv[i], "--ignore-profile") == 0 || strcmp (argv[i], "+ignore-profile") == 0) { break; } } if (i >= argc) { profile_pathname = set_profile (); } for (i = 1; i < argc; ++i) { if (argv[i][0] != '-' && argv[i][0] != '+') /* Filename */ { if (expect_output_file == true) /* Last arg was "-o" */ { if (out_name != 0) { fprintf (stderr, "indent: only one output file (2nd was %s)\n", argv[i]); exit (1); } if (input_files > 1) { fprintf (stderr, "indent: only one input file when output file is specified\n"); exit (1); } out_name = argv[i]; expect_output_file = false; continue; } else { if (using_stdin) { fprintf (stderr, "indent: can't have filenames when specifying standard input\n"); exit (1); } input_files++; if (input_files > 1) { if (out_name != 0) { fprintf (stderr, "indent: only one input file when output file is specified\n"); exit (1); } if (use_stdout != 0) { fprintf (stderr, "indent: only one input file when stdout is used\n"); exit (1); } if (input_files > max_input_files) { max_input_files = 2 * max_input_files; in_file_names = (char **) xrealloc (in_file_names, (max_input_files * sizeof (char *))); } } in_file_names[input_files - 1] = argv[i]; } } else { /* '-' as filename means stdin. */ if (argv[i][0] == '-' && argv[i][1] == '\0') { if (input_files > 0) { fprintf (stderr, "indent: can't have filenames when specifying standard input\n"); exit (1); } using_stdin = true; } else { i += set_option (argv[i], (i < argc ? argv[i + 1] : 0), 1); } } } if (verbose && profile_pathname) { fprintf (stderr, "Read profile %s\n", profile_pathname); } if (input_files > 1) { /* When multiple input files are specified, make a backup copy and then output the indented code into the same filename. */ for (i = 0; input_files; i++, input_files--) { current_input = read_file (in_file_names[i]); in_name = out_name = in_file_names[i]; output = fopen (out_name, "w"); if (output == 0) { fprintf (stderr, "indent: can't create %s\n", out_name); exit (1); } make_backup (current_input); reset_parser (); indent (current_input); if (fclose (output) != 0) { sys_error (out_name); } } } else { /* One input stream -- specified file, or stdin */ if (input_files == 0 || using_stdin) { input_files = 1; in_file_names[0] = "Standard input"; current_input = read_stdin (); } else /* 1 input file */ { current_input = read_file (in_file_names[0]); if (!out_name && !use_stdout) { out_name = in_file_names[0]; make_backup (current_input); } } in_name = in_file_names[0]; /* Uset stdout if it was specified ("-st"), or neither input nor output file was specified, or we're doing troff. */ if (use_stdout || !out_name || troff) { output = stdout; } else { output = fopen (out_name, "w"); if (output == 0) { fprintf (stderr, "indent: can't create %s\n", out_name); exit (1); } } reset_parser (); indent (current_input); } exit (0); } indent-2.2.11/regression/input/outer.c0000644000177400010010000000210010775646104014616 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here's a multi-line cooment where the closing delimiter ends on a line by itself */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/input/goto.c0000644000177400010010000000023310775646104014435 00000000000000int f(void) { for (i = 0; i < 10; i++) { if (i > 5) goto two; i++; two: } } int main(void) { if (f()) goto out; out: return 0; } indent-2.2.11/regression/input/one-line-4.c0000644000177400010010000000010310775646104015330 00000000000000main (){ if (foo) { bar (33); grop (); } else foo (); return -1; } indent-2.2.11/regression/input/wide.c0000644000177400010010000000025410775646104014420 00000000000000extern char *s = L"long string"; void main (int argc, char *argv[]) { char *s1, *s2; char c; s1 = "foobar"; if (x) foo (); s2 = L"barfoo"; c = L'\0'; } indent-2.2.11/regression/input/bad-break.c0000644000177400010010000000016710775646104015303 00000000000000int foo (void) { p = qsort (*aasdfagddsdf, *afasdfsdafasd, sizeof (struct foo), comparisonFunction); } indent-2.2.11/regression/input/globs.c0000644000177400010010000000343110775646104014576 00000000000000/* Copyright (C) 1986, 1989, 1992 Free Software Foundation, Inc. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" /* Like malloc but get error if no storage available. size really should be size_t, but not all systems have size_t, so I hope "unsigned" will work. It works for GNU style machines, where it is 32 bits, and works on MS-DOS. */ char * xmalloc (size) unsigned size; { register char *val = (char *) malloc (size); if (!val) { fprintf (stderr, "indent: Virtual memory exhausted.\n"); exit (1); } #if defined (DEBUG) /* Fill it with garbage to detect code which depends on stuff being zero-filled. */ memset (val, 'x', size); #endif return val; } /* Like realloc but get error if no storage available. */ char * xrealloc (ptr, size) char *ptr; unsigned size; { register char *val = (char *) realloc (ptr, size); if (!val) { fprintf (stderr, "indent: Virtual memory exhausted.\n"); exit (1); } return val; } indent-2.2.11/regression/input/decl_block.c0000644000177400010010000000011111331272170015524 00000000000000int main (int a, char ** b) { int a; int b; return 0; } indent-2.2.11/regression/input/emacs-compatible.h0000644000177400010010000000074010775646104016702 00000000000000struct token_data { enum token_data_type type; union { struct { char *text; } u_t; struct { builtin_func *func; boolean traced; } u_f; } u; }; foo () { while (1) { foobar (); } do { ralph (); } while (nigel ()); switch (x) { case 33: break; case 49: printf ("foobar"); { int i; i = 23; f (i); } default: {int x; abort ();} ; } } indent-2.2.11/regression/input/struct-decl.c0000644000177400010010000000032110775646104015714 00000000000000enum { t1, t2 } barfoo; struct foobar { int ch; char f; } xyz; main () { enum { None, Indent_on, Indent_off } com; struct foobar { int ch; char f; } xyz; } indent-2.2.11/regression/input/do.c0000644000177400010010000000033010775646104014065 00000000000000foo (a) int a; { int b; if (a == 1) do b = getchar (); while (b != 0x1a); else do b = getchar (); while (b != 0xff); do { b = getchar (); } while (b != 0xff); } indent-2.2.11/regression/input/no-newline.c0000644000177400010010000000135610775646104015547 00000000000000 /* RADIX!!(N) */ int * function_2 (var_0_0) int var_0_0; { int _local_iters0_, _size0_; int * var_1_0, * map1_1; struct shape_1d _shape0_, * var_2_0; var_2_0 = make_shape_1d (var_0_0); _shape0_ = var_2_0; _size0_ = shape_size (_shape0_); _local_iters0_ = shape_local_iters (_shape0_); { int _i_ = 0; int _self_address_ = _size0_ * SELF_PE_INT; int * _dest0_; int map1_2 = 65535; map1_1 = get_pvar (_shape0_); _dest0_ = pvar_values (map1_1); for (; _i_ < _local_iters0_; _i_++, _self_address_++) { _dest0_[_i_] = ((((_self_address_ * _self_address_) * 57) + (_self_address_ * 17)) % map1_2); } } dec_count_shape (var_2_0); var_1_0 = function_1 (map1_1, 65536); return (var_1_0); }indent-2.2.11/regression/input/else-if.c0000644000177400010010000000113010775646104015006 00000000000000void foo() { if (1) if (1) if (else_chptr->creationtime && chanTS > chptr->creationtime && chptr->creationtime != MAGIC_REMOTE_JOIN_TS) { int i; } else if (chptr->creationtime && chanTS > chptr->creationtime && chptr->creationtime != MAGIC_REMOTE_JOIN_TS) ; else if (chptr->creationtime && chanTS > chptr->creationtime && chptr->creationtime != MAGIC_REMOTE_JOIN_TS) { j = 1; i = 2; } if (0) i = 0; else /* Seperate banmasks with a space because they can contain commas themselfs: */ { j = 0; } } indent-2.2.11/regression/input/first-in-block.c0000644000177400010010000000030710775646104016312 00000000000000main() { int i = 0; switch (i) { // // First line comment // case 1: return 1; } switch (i) { // // First line comment, but not col 1. // case 1: return 1; } } indent-2.2.11/regression/input/else.c0000644000177400010010000000115410775646104014420 00000000000000 cmd_tab (n) int n; { int i, pos, col; if (tabch) { i = 0; ch = tabch; while (tabstop[i] <= vcol) i++; do { pos = tabstop[i++]; col = vcol; if (overwrite) do { FWD; } while (pos > vcol && vcol > col); else do { ch = tabch; ch1 = tabch2; inst_ch (0); } while (pos > vcol && vcol > col); } while (--n > 0); return (kcol = 0); } if (overwrite) { do { do { FWD; } while (vcol & TABCNT); } while (--n > 0); return (0); } return (inst_ch (n)); } indent-2.2.11/regression/input/for.c0000644000177400010010000000010610775646104014252 00000000000000main () { int size_; for (size_ = 32; size_ < n; size_ <<= 1); } indent-2.2.11/regression/input/cplus.c0000644000177400010010000000176510775646104014626 00000000000000// Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 // Here is a C plus plus commment in column 1 int var1; // Delcaration comment 1 int var1; // Delcaration comment 1 */ main () { var1 = 33; while (grop ()) { // A comment to right of code. foob (); turds (); } /* A single line comment. */ exit (); } // Here is a very long C plus plus comment Here is a very long C plus plus comment very long C plus plus comment // // Test comment // /* * Another form of boxed * comment which should be left the fuck alone!!! * */ boof () { var1 = 99; return 0; // Here is a very long C plus plus comment Here is a very long C plus plus comment } #if 0 #else // cpp cplus comment #endif #if 0 #else /* Regular comment */ #endif /* Yet another */ indent-2.2.11/regression/input/lexi.c0000644000177400010010000004572510775646104014445 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Here we have the token scanner for indent. It scans off one token and puts it in the global variable "token". It returns a code, indicating the type of token scanned. */ #include "sys.h" #include "indent.h" #include /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *token; char *token_end; #define alphanum 1 #define opchar 3 struct templ { char *rwd; enum rwcodes rwcode; }; /* Pointer to a vector of keywords specified by the user. */ static struct templ *user_specials = 0; /* Allocated size of user_specials. */ static unsigned int user_specials_max; /* Index in user_specials of the first unused entry. */ static unsigned int user_specials_idx; char chartype[128] = { /* this is used to facilitate the decision of what type (alphanumeric, operator) each character is */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 3, 3, 0, 0, 0, 3, 3, 0, 3, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 3, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 3, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 0, 3, 0 }; /* C code produced by gperf version 2.0 (K&R C version) Command-line: gperf -c -p -t -T -g -j1 -o -K rwd -N is_reserved indent.gperf */ #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 8 #define MIN_HASH_VALUE 4 #define MAX_HASH_VALUE 42 /* 31 keywords, 39 is the maximum key range */ INLINE static int hash (str, len) register char *str; register unsigned int len; { static unsigned char hash_table[] = { 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 6, 9, 10, 0, 16, 5, 4, 24, 42, 0, 20, 4, 20, 0, 42, 42, 6, 0, 0, 10, 10, 2, 42, 42, 42, 42, 42, 42, 42, 42, }; return len + hash_table[str[len - 1]] + hash_table[str[0]]; } INLINE struct templ * is_reserved (str, len) register char *str; register unsigned int len; { static struct templ wordlist[] = { {"",}, {"",}, {"",}, {"",}, {"else", rw_sp_nparen,}, {"short", rw_decl,}, {"struct", rw_struct_like,}, {"while", rw_sp_paren,}, {"enum", rw_struct_like,}, {"goto", rw_break,}, {"switch", rw_switch,}, {"break", rw_break,}, {"do", rw_sp_nparen,}, {"case", rw_case,}, {"const", rw_decl,}, {"static", rw_decl,}, {"double", rw_decl,}, {"default", rw_case,}, {"volatile", rw_decl,}, {"char", rw_decl,}, {"register", rw_decl,}, {"float", rw_decl,}, {"sizeof", rw_sizeof,}, {"typedef", rw_decl,}, {"void", rw_decl,}, {"for", rw_sp_paren,}, {"extern", rw_decl,}, {"int", rw_decl,}, {"unsigned", rw_decl,}, {"long", rw_decl,}, {"",}, {"global", rw_decl,}, {"return", rw_break,}, {"",}, {"",}, {"union", rw_struct_like,}, {"va_dcl", rw_decl,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"if", rw_sp_paren,}, }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) { register char *s = wordlist[key].rwd; if (*s == *str && !strncmp (str + 1, s + 1, len - 1)) return &wordlist[key]; } } return 0; } enum codes lexi () { int unary_delim; /* this is set to 1 if the current token forces a following operator to be unary */ static enum codes last_code; /* the last token type returned */ static int l_struct; /* set to 1 if the last token was 'struct' */ enum codes code; /* internal code to be returned */ char qchar; /* the delimiter character for a string */ unary_delim = false; /* tell world that this token started in column 1 iff the last thing scanned was nl */ parser_state_tos->col_1 = parser_state_tos->last_nl; parser_state_tos->last_nl = false; while (*buf_ptr == ' ' || *buf_ptr == '\t') { /* get rid of blanks */ parser_state_tos->col_1 = false; /* leading blanks imply token is not in column 1 */ if (++buf_ptr >= buf_end) fill_buffer (); } token = buf_ptr; /* Scan an alphanumeric token */ if (chartype[*buf_ptr] == alphanum || (buf_ptr[0] == '.' && isdigit (buf_ptr[1]))) { /* we have a character or number */ register struct templ *p; if (isdigit (*buf_ptr) || (buf_ptr[0] == '.' && isdigit (buf_ptr[1]))) { int seendot = 0, seenexp = 0; if (*buf_ptr == '0' && (buf_ptr[1] == 'x' || buf_ptr[1] == 'X')) { buf_ptr += 2; while (isxdigit (*buf_ptr)) buf_ptr++; } else while (1) { if (*buf_ptr == '.') if (seendot) break; else seendot++; buf_ptr++; if (!isdigit (*buf_ptr) && *buf_ptr != '.') if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp) break; else { seenexp++; seendot++; buf_ptr++; if (*buf_ptr == '+' || *buf_ptr == '-') buf_ptr++; } } /* Accept unsigned and unsigned long constants (U and UL suffixes). I'm not sure if LU is ansii. */ if (*buf_ptr == 'U' || *buf_ptr == 'u') buf_ptr++; if (*buf_ptr == 'L' || *buf_ptr == 'l') buf_ptr++; } else while (chartype[*buf_ptr] == alphanum) { /* copy it over */ buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } token_end = buf_ptr; while (*buf_ptr == ' ' || *buf_ptr == '\t') { if (++buf_ptr >= buf_end) fill_buffer (); } parser_state_tos->its_a_keyword = false; parser_state_tos->sizeof_keyword = false; /* if last token was 'struct', then this token should be treated as a declaration */ if (l_struct) { l_struct = false; last_code = ident; parser_state_tos->last_u_d = true; return (decl); } /* Operator after indentifier is binary */ parser_state_tos->last_u_d = false; last_code = ident; /* Check whether the token is a reserved word. Use perfect hashing... */ p = is_reserved (token, token_end - token); if (!p && user_specials != 0) { for (p = &user_specials[0]; p < &user_specials[0] + user_specials_idx; p++) { char *q = token; char *r = p->rwd; /* This string compare is a little nonstandard because token ends at the character before token_end and p->rwd is null-terminated. */ while (1) { /* If we have come to the end of both the keyword in user_specials and the keyword in token they are equal. */ if (q >= token_end && !*r) goto found_keyword; /* If we have come to the end of just one, they are not equal. */ if (q >= token_end || !*r) break; /* If the characters in corresponding characters are not equal, the strings are not equal. */ if (*q++ != *r++) break; } } /* Didn't find anything in user_specials. */ p = 0; } if (p) { /* we have a keyword */ found_keyword: parser_state_tos->its_a_keyword = true; parser_state_tos->last_u_d = true; parser_state_tos->last_rw = p->rwcode; switch (p->rwcode) { case rw_switch: /* it is a switch */ return (swstmt); case rw_case: /* a case or default */ return (casestmt); case rw_struct_like: /* a "struct" */ if (parser_state_tos->p_l_follow && !(parser_state_tos->noncast_mask & 1 << parser_state_tos->p_l_follow)) /* inside parens: cast */ { parser_state_tos->cast_mask |= 1 << parser_state_tos->p_l_follow; break; } l_struct = true; /* Next time around, we will want to know that we have had a 'struct' */ case rw_decl: /* one of the declaration keywords */ if (parser_state_tos->p_l_follow && !(parser_state_tos->noncast_mask & 1 << parser_state_tos->p_l_follow)) /* inside parens: cast */ { parser_state_tos->cast_mask |= 1 << parser_state_tos->p_l_follow; break; } last_code = decl; return (decl); case rw_sp_paren: /* if, while, for */ return (sp_paren); case rw_sp_nparen: /* do, else */ return (sp_nparen); case rw_sizeof: parser_state_tos->sizeof_keyword = true; return (ident); case rw_return: case rw_break: default: /* all others are treated like any other identifier */ return (ident); } /* end of switch */ } /* end of if (found_it) */ if (*buf_ptr == '(' && parser_state_tos->tos <= 1 && parser_state_tos->ind_level == 0 && parser_state_tos->paren_depth == 0) { /* We have found something which might be the name in a function definition. */ register char *tp; int paren_count = 1; /* Skip to the matching ')'. */ for (tp = buf_ptr + 1; paren_count > 0 && tp < in_prog + in_prog_size; tp++) { if (*tp == '(') paren_count++; if (*tp == ')') paren_count--; /* Can't occur in parameter list; this way we don't search the whole file in the case of unbalanced parens. */ if (*tp == ';') goto not_proc; } if (paren_count == 0) { while (isspace (*tp)) tp++; /* If the next char is ';' or ',' or '(' we have a function declaration, not a definition. I've added '=' to this list to keep from breaking a non-valid C macro from libc. -jla */ if (*tp != ';' && *tp != ',' && *tp != '(' && *tp != '=') { parser_state_tos->procname = token; parser_state_tos->procname_end = token_end; parser_state_tos->in_parameter_declaration = 1; } } not_proc:; } /* The following hack attempts to guess whether or not the current token is in fact a declaration keyword -- one that has been typedef'd */ if (((*buf_ptr == '*' && buf_ptr[1] != '=') || isalpha (*buf_ptr) || *buf_ptr == '_') && !parser_state_tos->p_l_follow && !parser_state_tos->block_init && (parser_state_tos->last_token == rparen || parser_state_tos->last_token == semicolon || parser_state_tos->last_token == decl || parser_state_tos->last_token == lbrace || parser_state_tos->last_token == rbrace)) { parser_state_tos->its_a_keyword = true; parser_state_tos->last_u_d = true; last_code = decl; return decl; } if (last_code == decl) /* if this is a declared variable, then following sign is unary */ parser_state_tos->last_u_d = true; /* will make "int a -1" work */ last_code = ident; return (ident); /* the ident is not in the list */ } /* end of procesing for alpanum character */ /* Scan a non-alphanumeric token */ /* If it is not a one character token, token_end will get changed later. */ token_end = buf_ptr + 1; if (++buf_ptr >= buf_end) fill_buffer (); switch (*token) { case '\0': code = code_eof; break; case '\n': unary_delim = parser_state_tos->last_u_d; parser_state_tos->last_nl = true; code = newline; break; case '\'': /* start of quoted character */ case '"': /* start of string */ qchar = *token; /* Find out how big the literal is so we can set token_end. */ /* Invariant: before loop test buf_ptr points to the next */ /* character that we have not yet checked. */ while (*buf_ptr != qchar && *buf_ptr != 0 && *buf_ptr != '\n') { if (*buf_ptr == '\\') { buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '\n') ++line_no; if (*buf_ptr == 0) break; } buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } if (*buf_ptr == '\n' || *buf_ptr == 0) { diag (1, qchar == '\'' ? "Unterminated character constant" : "Unterminated string constant" ); } else { /* Advance over end quote char. */ buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } code = ident; break; case ('('): case ('['): unary_delim = true; code = lparen; break; case (')'): case (']'): code = rparen; break; case '#': unary_delim = parser_state_tos->last_u_d; code = preesc; break; case '?': unary_delim = true; code = question; break; case (':'): code = colon; unary_delim = true; break; case (';'): unary_delim = true; code = semicolon; break; case ('{'): unary_delim = true; /* This check is made in the code for '='. No one who writes initializers without '=' these days deserves to have indent work on their code (besides which, uncommenting this would screw up anything which assumes that parser_state_tos->block_init really means you are in an initializer. */ /* if (parser_state_tos->in_or_st) parser_state_tos->block_init = 1; */ /* The following neat hack causes the braces in structure initializations to be treated as parentheses, thus causing initializations to line up correctly, e.g. struct foo bar = {{a, b, c}, {1, 2}}; If lparen is returned, token can be used to distinguish between '{' and '(' where necessary. */ code = parser_state_tos->block_init ? lparen : lbrace; break; case ('}'): unary_delim = true; /* The following neat hack is explained under '{' above. */ code = parser_state_tos->block_init ? rparen : rbrace; break; case 014: /* a form feed */ unary_delim = parser_state_tos->last_u_d; parser_state_tos->last_nl = true; /* remember this so we can set 'parser_state_tos->col_1' right */ code = form_feed; break; case (','): unary_delim = true; code = comma; break; case '.': unary_delim = false; code = period; break; case '-': case '+': /* check for -, +, --, ++ */ code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; if (*buf_ptr == token[0]) { /* check for doubled character */ buf_ptr++; /* buffer overflow will be checked at end of loop */ if (last_code == ident || last_code == rparen) { code = (parser_state_tos->last_u_d ? unary_op : postop); /* check for following ++ or -- */ unary_delim = false; } } else if (*buf_ptr == '=') /* check for operator += */ buf_ptr++; else if (*buf_ptr == '>') { /* check for operator -> */ buf_ptr++; if (!pointer_as_binop) { unary_delim = false; code = unary_op; parser_state_tos->want_blank = false; } } break; /* buffer overflow will be checked at end of switch */ case '=': if (parser_state_tos->in_or_st) parser_state_tos->block_init = 1; if (*buf_ptr == '=') /* == */ buf_ptr++; else if (*buf_ptr == '-' || *buf_ptr == '+' || *buf_ptr == '*' || *buf_ptr == '&') { /* Something like x=-1, which can mean x -= 1 ("old style" in K&R1) or x = -1 (ANSI). Note that this is only an ambiguity if the character can also be a unary operator. If not, just produce output code that produces a syntax error (the theory being that people want to detect and eliminate old style assignments but they don't want indent to silently change the meaning of their code). */ diag (0, "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n", *buf_ptr, *buf_ptr); } code = binary_op; unary_delim = true; break; /* can drop thru!!! */ case '>': case '<': case '!': /* ops like <, <<, <=, !=, <<=, etc */ /* This will of course scan sequences like "<=>", "!=>", "<<>", etc. as one token, but I don't think that will cause any harm. */ while (*buf_ptr == '>' || *buf_ptr == '<' || *buf_ptr == '=') { if (++buf_ptr >= buf_end) fill_buffer (); if (*buf_ptr == '=') { if (++buf_ptr >= buf_end) fill_buffer (); } } code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; break; default: if (token[0] == '/' && *buf_ptr == '*') { /* it is start of comment */ if (++buf_ptr >= buf_end) fill_buffer (); code = comment; unary_delim = parser_state_tos->last_u_d; break; } while (*(buf_ptr - 1) == *buf_ptr || *buf_ptr == '=') { /* handle ||, &&, etc, and also things as in int *****i */ if (++buf_ptr >= buf_end) fill_buffer (); } code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; } /* end of switch */ if (code != newline) { l_struct = false; last_code = code; } token_end = buf_ptr; if (buf_ptr >= buf_end) /* check for input buffer empty */ fill_buffer (); parser_state_tos->last_u_d = unary_delim; return (code); } /* Add the given keyword to the keyword table, using val as the keyword type */ addkey (key, val) char *key; enum rwcodes val; { register struct templ *p; /* Check to see whether key is a reserved word or not. */ if (is_reserved (key, strlen (key)) != 0) return; if (user_specials == 0) { user_specials = (struct templ *) xmalloc (5 * sizeof (struct templ)); user_specials_max = 5; user_specials_idx = 0; } else if (user_specials_idx == user_specials_max) { user_specials_max += 5; user_specials = (struct templ *) xrealloc ((char *) user_specials, user_specials_max * sizeof (struct templ)); } p = &user_specials[user_specials_idx++]; p->rwd = key; p->rwcode = val; return; } indent-2.2.11/regression/input/ind-star.c0000644000177400010010000000007010775646104015205 00000000000000main () { int code; /* * Thang. */ code = 1; } indent-2.2.11/regression/input/struct_param.c0000644000177400010010000000002110775646104016164 00000000000000b(struct z *a){} indent-2.2.11/regression/input/brackets.c0000644000177400010010000000051410775646104015265 00000000000000void foo() { if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) mask = NULL; if ((acptr = FindUser(nick)) && ((!(bitsel & WHOSELECT_OPER)) || IsAnOper(acptr)) && Process(acptr) && SHOW_MORE(sptr, counter)) mask = NULL; } indent-2.2.11/regression/input/indent.c0000644000177400010010000014141411331271476014750 00000000000000 /* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" #include void usage () { fprintf (stderr, "usage: indent file [-o outfile ] [ options ]\n"); fprintf (stderr, " indent file1 file2 ... fileN [ options ]\n"); exit (1); } /* Stuff that needs to be shared with the rest of indent. Documented in indent.h. */ char *labbuf; char *s_lab; char *e_lab; char *l_lab; char *codebuf; char *s_code; char *e_code; char *l_code; char *combuf; char *s_com; char *e_com; char *l_com; struct buf save_com; char *bp_save; char *be_save; int code_lines; int line_no; struct fstate keywordf; struct fstate stringf; struct fstate boxcomf; struct fstate blkcomf; struct fstate scomf; struct fstate bodyf; int break_comma; /* Insure that BUFSTRUC has at least REQ more chars left, if not extend it. Note: This may change bufstruc.ptr. */ #define need_chars(bufstruc, req) \ if ((bufstruc.end - bufstruc.ptr + (req)) >= bufstruc.size) \ {\ int cur_chars = bufstruc.end - bufstruc.ptr;\ bufstruc.size *= 2;\ bufstruc.ptr = xrealloc(bufstruc.ptr,bufstruc.size);\ bufstruc.end = bufstruc.ptr + cur_chars;\ } int else_or_endif; /* true iff last keyword was an else */ int last_else; /* True if we have just encountered the end of an if (...), etc. (i.e. the ')' of the if (...) was the last token). The variable is set to 2 in the middle of the main token reading loop and is decremented at the beginning of the loop, so it will reach zero when the second token after the ')' is read. */ int last_token_ends_sp; /* current indentation for declarations */ int dec_ind; /* structure indentation levels */ int *di_stack; /* Currently allocated size of di_stack. */ int di_stack_alloc; /* used when buffering up comments to remember that a newline was passed over */ int flushed_nl; int force_nl; /* set to true when we see a case, so we will know what to do with the following colon */ int scase; /* when true, we are in the expressin of if(...), while(...), etc. */ int sp_sw; /* when this is positive, we have seen a ? without the matching : in a ?: construct */ int squest; static void indent (this_file) struct file_buffer *this_file; { register int i; enum codes hd_type; register char *t_ptr; enum codes type_code; int dec_ind; /* current indentation for declarations */ int flushed_nl; int force_nl; int scase; /* true when we've just see a case */ int sp_sw; /* when true, we are in the expressin of if(...), while(...), etc. */ /* True if we have just encountered the end of an if (...), etc. (i.e. the ')' of the if (...) was the last token). The variable is set to 2 in the middle of the main token reading loop and is decremented at the beginning of the loop, so it will reach zero when the second token after the ')' is read. */ int last_token_ends_sp; int squest; /* when this is positive, we have seen a ? without the matching : in a ?: construct */ int last_else; /* true iff last keyword was an else */ in_prog = in_prog_pos = this_file->data; in_prog_size = this_file->size; hd_type = code_eof; dec_ind = 0; last_token_ends_sp = false; last_else = false; sp_sw = force_nl = false; scase = false; if (com_ind <= 1) com_ind = 2; /* dont put normal comments before column 2 */ if (troff) { if (bodyf.font[0] == 0) parsefont (&bodyf, "R"); if (scomf.font[0] == 0) parsefont (&scomf, "I"); if (blkcomf.font[0] == 0) blkcomf = scomf, blkcomf.size += 2; if (boxcomf.font[0] == 0) boxcomf = blkcomf; if (stringf.font[0] == 0) parsefont (&stringf, "L"); if (keywordf.font[0] == 0) parsefont (&keywordf, "B"); writefdef (&bodyf, 'B'); writefdef (&scomf, 'C'); writefdef (&blkcomf, 'L'); writefdef (&boxcomf, 'X'); writefdef (&stringf, 'S'); writefdef (&keywordf, 'K'); } if (block_comment_max_col <= 0) block_comment_max_col = max_col; if (decl_com_ind <= 0) /* if not specified by user, set this */ decl_com_ind = ljust_decl ? (com_ind <= 10 ? 2 : com_ind - 8) : com_ind; if (continuation_indent == 0) continuation_indent = ind_size; fill_buffer (); /* get first batch of stuff into input buffer */ parse (semicolon); { register char *p = buf_ptr; register col = 1; while (1) { if (*p == ' ') col++; else if (*p == '\t') col = ((col - 1) & ~7) + 9; else break; p++; } if (col > ind_size) parser_state_tos->ind_level = parser_state_tos->i_l_follow = col; } if (troff) { register char *p = in_name, *beg = in_name; while (*p) if (*p++ == '/') beg = p; fprintf (output, ".Fn \"%s\"\n", beg); } /* START OF MAIN LOOP */ while (1) { /* this is the main loop. it will go until we reach eof */ int is_procname; type_code = lexi (); /* lexi reads one token. "token" points to the actual characters. lexi returns a code indicating the type of token */ if (last_token_ends_sp > 0) last_token_ends_sp--; is_procname = parser_state_tos->procname[0]; /* The following code moves everything following an if (), while (), else, etc. up to the start of the following stmt to a buffer. This allows proper handling of both kinds of brace placement. */ flushed_nl = false; while (parser_state_tos->search_brace) { /* After scanning an if(), while (), etc., it might be necessary to keep track of the text between the if() and the start of the statement which follows. Use save_com to do so. */ switch (type_code) { case newline: ++line_no; flushed_nl = true; case form_feed: break; /* form feeds and newlines found here will be ignored */ case lbrace: /* this is a brace that starts the compound stmt */ if (save_com.end == save_com.ptr) { /* ignore buffering if a comment wasnt stored up */ parser_state_tos->search_brace = false; goto check_type; } /* We need to put the '{' back into save_com somewhere. */ if (btype_2) /* Put it at the beginning, e.g. if (foo) { / * comment here * / */ save_com.ptr[0] = '{'; else { /* Put it at the end, e.g. if (foo) / * comment here * / { */ /* Putting in this newline causes a dump_line to occur right after the comment, thus insuring that it will be put in the correct column. */ *save_com.end++ = '\n'; *save_com.end++ = '{'; } /* Go to common code to get out of this loop. */ goto sw_buffer; case comment: /* we have a comment, so we must copy it into the buffer */ if (!flushed_nl || save_com.end != save_com.ptr) { need_chars (save_com, 10); if (save_com.end == save_com.ptr) { /* if this is the first comment, we must set up the buffer */ save_com.ptr[0] = save_com.ptr[1] = ' '; save_com.end = save_com.ptr + 2; } else { *save_com.end++ = '\n'; /* add newline between comments */ *save_com.end++ = ' '; --line_no; } *save_com.end++ = '/'; /* copy in start of comment */ *save_com.end++ = '*'; for (;;) { /* loop until we get to the end of the comment */ /* make sure there is room for this character and (while we're at it) the '/' we might add at the end of the loop. */ need_chars (save_com, 2); *save_com.end = *buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer (); if (had_eof) { diag (1, "Unclosed comment"); exit (1); } } if (*save_com.end++ == '*' && *buf_ptr == '/') break; /* we are at end of comment */ } *save_com.end++ = '/'; /* add ending slash */ if (++buf_ptr >= buf_end) /* get past / in buffer */ fill_buffer (); break; } default: /* it is the start of a normal statment */ if (flushed_nl) /* if we flushed a newline, make sure it is put back */ force_nl = true; if ((type_code == sp_paren && *token == 'i' && last_else && else_if) || (type_code == sp_nparen && *token == 'e' && e_code != s_code && e_code[-1] == '}')) force_nl = false; if (save_com.end == save_com.ptr) { /* ignore buffering if comment wasnt saved up */ parser_state_tos->search_brace = false; goto check_type; } if (force_nl) { /* if we should insert a nl here, put it into the buffer */ force_nl = false; --line_no; /* this will be re-increased when the nl is read from the buffer */ need_chars (save_com, 2); *save_com.end++ = '\n'; *save_com.end++ = ' '; if (verbose && !flushed_nl) /* print error msg if the line was not already broken */ diag (0, "Line broken"); flushed_nl = false; } for (t_ptr = token; t_ptr < token_end; ++t_ptr) { need_chars (save_com, 1); *save_com.end++ = *t_ptr; /* copy token into temp buffer */ } parser_state_tos->procname = "\0"; sw_buffer: parser_state_tos->search_brace = false; /* stop looking for start of stmt */ bp_save = buf_ptr;/* save current input buffer */ be_save = buf_end; buf_ptr = save_com.ptr; /* fix so that subsequent calls to lexi will take tokens out of save_com */ need_chars (save_com, 1); *save_com.end++ = ' '; /* add trailing blank, just in case */ buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ break; } /* end of switch */ /* we must make this check, just in case there was an unexpected EOF */ if (type_code != code_eof) type_code = lexi ();/* read another token */ /* if (parser_state_tos->search_brace) parser_state_tos->procname[0] = 0; */ if ((is_procname = parser_state_tos->procname[0]) && flushed_nl && !procnames_start_line && parser_state_tos->in_decl && type_code == ident) flushed_nl = 0; } /* end of while (search_brace) */ last_else = 0; check_type: if (type_code == code_eof) { /* we got eof */ if (s_lab != e_lab || s_code != e_code || s_com != e_com)/* must dump end of line */ dump_line (); if (parser_state_tos->tos > 1) /* check for balanced braces */ diag (1, "Stuff missing from end of file."); if (verbose) { printf ("There were %d output lines and %d comments\n", out_lines, out_coms); printf ("(Lines with comments)/(Lines with code): %6.3f\n", (1.0 * com_lines) / code_lines); } fflush (output); if (found_err) exit (found_err); return; } if ((type_code != comment) && (type_code != newline) && (type_code != preesc) && (type_code != form_feed)) { if (force_nl && (type_code != semicolon) && (type_code != lbrace || !btype_2)) { /* we should force a broken line here */ if (verbose && !flushed_nl) diag (0, "Line broken"); flushed_nl = false; dump_line (); parser_state_tos->want_blank = false; /* dont insert blank at line start */ force_nl = false; } parser_state_tos->in_stmt = true; /* turn on flag which causes an extra level of indentation. this is turned off by a ; or } */ if (s_com != e_com) { /* the turkey has embedded a comment in a line. Move it from the com buffer to the code buffer. */ /* Do not add a space before the comment if it is the first thing on the line. */ if (e_code != s_code) { *e_code++ = ' '; } for (t_ptr = s_com; *t_ptr; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } *e_code++ = ' '; *e_code = '\0'; /* null terminate code sect */ parser_state_tos->want_blank = false; e_com = s_com; } } else if (type_code != comment) /* preserve force_nl thru a comment */ force_nl = false; /* cancel forced newline after newline, form feed, etc */ /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ check_code_size; switch (type_code) { /* now, decide what to do with the token */ case form_feed: /* found a form feed in line */ parser_state_tos->use_ff = true; /* a form feed is treated much like a newline */ dump_line (); parser_state_tos->want_blank = false; break; case newline: if (parser_state_tos->last_token != comma || parser_state_tos->p_l_follow > 0 || !leave_comma || parser_state_tos->block_init || !break_comma || s_com != e_com) { dump_line (); parser_state_tos->want_blank = false; } /* If we were on the line with a #else or a #endif, we aren't anymore. */ else_or_endif = false; ++line_no; /* keep track of input line number */ break; case lparen: /* Braces in initializer lists should be put on new lines. This is necessary so that -gnu does not cause things like char *this_is_a_string_array[] = { "foo", "this_string_does_not_fit", "nor_does_this_rather_long_string" } which is what happens because we are trying to line the strings up with the parentheses, and those that are too long are moved to the right an ugly amount. However, if the current line is empty, the left brace is already on a new line, so don't molest it. */ if (token[0] == '{' && (s_code != e_code || s_com != e_com || s_lab != e_lab)) { dump_line (); /* Do not put a space before the '{'. */ parser_state_tos->want_blank = false; } /* Count parens so we know how deep we are. */ if (++parser_state_tos->p_l_follow >= parser_state_tos->paren_indents_size) { parser_state_tos->paren_indents_size *= 2; parser_state_tos->paren_indents = (short *) xrealloc (parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } parser_state_tos->paren_depth++; if (parser_state_tos->want_blank && *token != '[' && (parser_state_tos->last_token != ident || proc_calls_space || (parser_state_tos->its_a_keyword && (!parser_state_tos->sizeof_keyword || blank_after_sizeof)))) *e_code++ = ' '; if (parser_state_tos->in_decl && !parser_state_tos->block_init) if (troff && !parser_state_tos->dumped_decl_indent && !is_procname && parser_state_tos->last_token == decl) { parser_state_tos->dumped_decl_indent = 1; sprintf (e_code, "\n.Du %dp+\200p \"%.*s\"\n", dec_ind * 7, token_end - token, token); e_code += strlen (e_code); } else { while ((e_code - s_code) < dec_ind) { check_code_size; *e_code++ = ' '; } *e_code++ = token[0]; } else *e_code++ = token[0]; parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] = e_code - s_code; if (sp_sw && parser_state_tos->p_l_follow == 1 && extra_expression_indent && parser_state_tos->paren_indents[0] < 2 * ind_size) parser_state_tos->paren_indents[0] = 2 * ind_size; parser_state_tos->want_blank = false; if (parser_state_tos->in_or_st && *token == '(' && parser_state_tos->tos <= 2) { /* this is a kluge to make sure that declarations will be aligned right if proc decl has an explicit type on it, i.e. "int a(x) {..." */ parse_lparen_in_decl (); /* Turn off flag for structure decl or initialization. */ parser_state_tos->in_or_st = false; } if (parser_state_tos->sizeof_keyword) parser_state_tos->sizeof_mask |= 1 << parser_state_tos->p_l_follow; /* The '(' that starts a cast can never be preceeded by an indentifier or decl. */ if (parser_state_tos->last_token == decl || (parser_state_tos->last_token == ident && parser_state_tos->last_rw != rw_return)) parser_state_tos->noncast_mask |= 1 << parser_state_tos->p_l_follow; else parser_state_tos->noncast_mask &= ~(1 << parser_state_tos->p_l_follow); break; case rparen: if (parser_state_tos->cast_mask & (1 << parser_state_tos->p_l_follow) & ~parser_state_tos->sizeof_mask) { parser_state_tos->last_u_d = true; parser_state_tos->cast_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (!parser_state_tos->cast_mask && cast_space) parser_state_tos->want_blank = true; else parser_state_tos->want_blank = false; } parser_state_tos->sizeof_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (--parser_state_tos->p_l_follow < 0) { parser_state_tos->p_l_follow = 0; diag (0, "Extra %c", *token); } parser_state_tos->paren_depth--; /* if the paren starts the line, then indent it */ if (e_code == s_code) { int level = parser_state_tos->p_l_follow; parser_state_tos->paren_level = level; if (level > 0) paren_target = -parser_state_tos->paren_indents[level - 1]; else paren_target = 0; } else if (parser_state_tos->in_decl && parser_state_tos->paren_depth == 0) parser_state_tos->want_blank = true; *e_code++ = token[0]; #if 0 if (!parser_state_tos->cast_mask || cast_space) parser_state_tos->want_blank = true; #endif /* check for end of if (...), or some such */ if (sp_sw && (parser_state_tos->p_l_follow == 0)) { /* Indicate that we have just left the parenthesized expression of a while, if, or for, unless we are getting out of the parenthesized expression of the while of a do-while loop. (do-while is different because a semicolon immediately following this will not indicate a null loop body). */ if (parser_state_tos->p_stack[parser_state_tos->tos] != dohead) last_token_ends_sp = 2; sp_sw = false; force_nl = true; /* must force newline after if */ parser_state_tos->last_u_d = true; /* inform lexi that a following operator is unary */ parser_state_tos->in_stmt = false; /* dont use stmt continuation indentation */ parse (hd_type); /* let parser worry about if, or whatever */ } parser_state_tos->search_brace = btype_2; /* this should insure that constructs such as main(){...} and int[]{...} have their braces put in the right place */ break; case unary_op: /* this could be any unary operation */ if (parser_state_tos->want_blank) *e_code++ = ' '; if (troff && !parser_state_tos->dumped_decl_indent && parser_state_tos->in_decl && !is_procname) { sprintf (e_code, "\n.Du %dp+\200p \"%.*s\"\n", dec_ind * 7, token_end - token, token); parser_state_tos->dumped_decl_indent = 1; e_code += strlen (e_code); } else { char *res = token; char *res_end = token_end; /* if this is a unary op in a declaration, we should indent this token */ if (parser_state_tos->paren_depth == 0 && parser_state_tos->in_decl && !parser_state_tos->block_init) { while ((e_code - s_code) < (dec_ind - (token_end - token))) { check_code_size; *e_code++ = ' '; } } if (troff && token[0] == '-' && token[1] == '>') { static char resval[] = "\\(->"; res = resval; res_end = res + sizeof (resval); } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } } parser_state_tos->want_blank = false; break; case binary_op: /* any binary operation */ if (parser_state_tos->want_blank || (e_code > s_code && *e_code != ' ')) *e_code++ = ' '; { char *res = token; char *res_end = token_end; #define set_res(str) \ {\ static char resval[] = str;\ res = resval;\ res_end = res + sizeof(resval);\ } if (troff) switch (token[0]) { case '<': if (token[1] == '=') set_res ("\\(<="); break; case '>': if (token[1] == '=') set_res ("\\(>="); break; case '!': if (token[1] == '=') set_res ("\\(!="); break; case '|': if (token[1] == '|') { set_res ("\\(br\\(br"); } else if (token[1] == 0) set_res ("\\(br"); break; } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; /* move the operator */ } } parser_state_tos->want_blank = true; break; case postop: /* got a trailing ++ or -- */ *e_code++ = token[0]; *e_code++ = token[1]; parser_state_tos->want_blank = true; break; case question: /* got a ? */ squest++; /* this will be used when a later colon appears so we can distinguish the ?: construct */ if (parser_state_tos->want_blank) *e_code++ = ' '; *e_code++ = '?'; parser_state_tos->want_blank = true; break; case casestmt: /* got word 'case' or 'default' */ scase = true; /* so we can process the later colon properly */ goto copy_id; case colon: /* got a ':' */ if (squest > 0) { /* it is part of the ?: construct */ --squest; if (parser_state_tos->want_blank) *e_code++ = ' '; *e_code++ = ':'; parser_state_tos->want_blank = true; break; } if (parser_state_tos->in_decl) { *e_code++ = ':'; parser_state_tos->want_blank = false; break; } parser_state_tos->in_stmt = false; /* seeing a label does not imply we are in a stmt */ for (t_ptr = s_code; *t_ptr; ++t_ptr) *e_lab++ = *t_ptr; /* turn everything so far into a label */ e_code = s_code; *e_lab++ = ':'; *e_lab++ = ' '; *e_lab = '\0'; /* parser_state_tos->pcas e will be used by dump_line to decide how to indent the label. force_nl will force a case n: to be on a line by itself */ force_nl = parser_state_tos->pcase = scase; scase = false; parser_state_tos->want_blank = false; break; case semicolon: /* we are not in an initialization or structure declaration */ parser_state_tos->in_or_st = false; scase = false; squest = 0; /* The following code doesn't seem to do much good. Just because we've found something like extern int foo(); or int (*foo)(); doesn't mean we are out of a declaration. Now if it was serving some purpose we'll have to address that.... if (parser_state_tos->last_token == rparen) parser_state_tos->in_parameter_declaration = 0; */ parser_state_tos->cast_mask = 0; parser_state_tos->sizeof_mask = 0; parser_state_tos->block_init = 0; parser_state_tos->block_init_level = 0; parser_state_tos->just_saw_decl--; if (parser_state_tos->in_decl && s_code == e_code && !parser_state_tos->block_init) while ((e_code - s_code) < (dec_ind - 1)) { check_code_size; *e_code++ = ' '; } /* if we were in a first level structure declaration, we aren't any more */ parser_state_tos->in_decl = (parser_state_tos->dec_nest > 0); if ((!sp_sw || hd_type != forstmt) && parser_state_tos->p_l_follow > 0) { /* This should be true iff there were unbalanced parens in the stmt. It is a bit complicated, because the semicolon might be in a for stmt */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; if (sp_sw) { /* this is a check for a if, while, etc. with unbalanced parens */ sp_sw = false; parse (hd_type); /* dont lose the if, or whatever */ } } /* If we have a semicolon following an if, while, or for, and the user wants us to, we should insert a space (to show that there is a null statement there). */ if (last_token_ends_sp && space_sp_semicolon) { *e_code++ = ' '; } *e_code++ = ';'; parser_state_tos->want_blank = true; /* we are no longer in the middle of a stmt */ parser_state_tos->in_stmt = (parser_state_tos->p_l_follow > 0); if (!sp_sw) { /* if not if for (;;) */ parse (semicolon);/* let parser know about end of stmt */ force_nl = true; /* force newline after a end of stmt */ } break; case lbrace: /* got a '{' */ parser_state_tos->in_stmt = false; /* dont indent the {} */ if (!parser_state_tos->block_init) force_nl = true; /* force other stuff on same line as '{' onto new line */ else if (parser_state_tos->block_init_level <= 0) parser_state_tos->block_init_level = 1; else parser_state_tos->block_init_level++; if (s_code != e_code && !parser_state_tos->block_init) { if (!btype_2) { dump_line (); parser_state_tos->want_blank = false; } else { if (parser_state_tos->in_parameter_declaration && !parser_state_tos->in_or_st) { parser_state_tos->i_l_follow = 0; dump_line (); parser_state_tos->want_blank = false; } else parser_state_tos->want_blank = true; } } if (parser_state_tos->in_parameter_declaration) prefix_blankline_requested = 0; if (parser_state_tos->p_l_follow > 0) { /* check for preceeding unbalanced parens */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; if (sp_sw) { /* check for unclosed if, for, etc. */ sp_sw = false; parse (hd_type); parser_state_tos->ind_level = parser_state_tos->i_l_follow; } } if (s_code == e_code) parser_state_tos->ind_stmt = false; /* dont put extra indentation on line with '{' */ if (parser_state_tos->in_decl && parser_state_tos->in_or_st) { /* This is a structure declaration. */ if (parser_state_tos->dec_nest >= di_stack_alloc) { di_stack_alloc *= 2; di_stack = (int *) xrealloc (di_stack, di_stack_alloc * sizeof (*di_stack)); } di_stack[parser_state_tos->dec_nest++] = dec_ind; /* ? dec_ind = 0; */ } else { parser_state_tos->decl_on_line = false; /* we cant be in the middle of a declaration, so dont do special indentation of comments */ #if 0 /* Doesn't work currently. */ if (blanklines_after_declarations_at_proctop && parser_state_tos->in_parameter_declaration) postfix_blankline_requested = 1; #endif parser_state_tos->in_parameter_declaration = 0; } dec_ind = 0; /* We are no longer looking for an initializer or structure. Needed so that the '=' in "enum bar {a = 1" does not get interpreted as the start of an initializer. */ parser_state_tos->in_or_st = false; parse (lbrace); /* let parser know about this */ if (parser_state_tos->want_blank) /* put a blank before '{' if '{' is not at start of line */ *e_code++ = ' '; parser_state_tos->want_blank = false; *e_code++ = '{'; parser_state_tos->just_saw_decl = 0; break; case rbrace: /* got a '}' */ /* semicolons can be omitted in declarations */ if (parser_state_tos->p_stack[parser_state_tos->tos] == decl && !parser_state_tos->block_init) parse (semicolon); if (parser_state_tos->p_l_follow) { /* check for unclosed if, for, else. */ diag (1, "Unbalanced parens"); parser_state_tos->p_l_follow = 0; sp_sw = false; } parser_state_tos->just_saw_decl = 0; parser_state_tos->block_init_level--; if (s_code != e_code && !parser_state_tos->block_init) { /* '}' must be first on line */ if (verbose) diag (0, "Line broken"); dump_line (); } *e_code++ = '}'; parser_state_tos->want_blank = true; parser_state_tos->in_stmt = parser_state_tos->ind_stmt = false; if (parser_state_tos->dec_nest > 0) { /* we are in multi-level structure declaration */ dec_ind = di_stack[--parser_state_tos->dec_nest]; if (parser_state_tos->dec_nest == 0 && !parser_state_tos->in_parameter_declaration) parser_state_tos->just_saw_decl = 2; parser_state_tos->in_decl = true; } prefix_blankline_requested = 0; parse (rbrace); /* let parser know about this */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dohead && !btype_2) force_nl = true; parser_state_tos->search_brace = (cuddle_else && parser_state_tos->p_stack[parser_state_tos->tos] == ifhead); #if 0 parser_state_tos->search_brace = (cuddle_else && parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && (parser_state_tos->il[parser_state_tos->tos] >= parser_state_tos->ind_level)); #endif if (parser_state_tos->tos <= 1 && blanklines_after_procs && parser_state_tos->dec_nest <= 0) postfix_blankline_requested = 1; break; case swstmt: /* got keyword "switch" */ sp_sw = true; hd_type = swstmt; /* keep this for when we have seen the expression */ goto copy_id; /* go move the token into buffer */ case sp_paren: /* token is if, while, for */ sp_sw = true; /* the interesting stuff is done after the expression is scanned */ hd_type = (*token == 'i' ? ifstmt : (*token == 'w' ? whilestmt : forstmt)); /* remember the type of header for later use by parser */ goto copy_id; /* copy the token into line */ case sp_nparen: /* got else, do */ parser_state_tos->in_stmt = false; if (*token == 'e') { if (e_code != s_code && (!cuddle_else || e_code[-1] != '}')) { if (verbose) diag (0, "Line broken"); dump_line (); /* make sure this starts a line */ parser_state_tos->want_blank = false; } force_nl = true; /* also, following stuff must go onto new line */ last_else = 1; parse (elselit); } else { if (e_code != s_code) { /* make sure this starts a line */ if (verbose) diag (0, "Line broken"); dump_line (); parser_state_tos->want_blank = false; } force_nl = true; /* also, following stuff must go onto new line */ last_else = 0; parse (dolit); } goto copy_id; /* move the token into line */ case decl: /* we have a declaration type (int, register, etc.) */ parse (decl); /* let parser worry about indentation */ if (parser_state_tos->last_token == rparen && parser_state_tos->tos <= 1) { parser_state_tos->in_parameter_declaration = 1; if (s_code != e_code) { dump_line (); parser_state_tos->want_blank = false; } } if (parser_state_tos->in_parameter_declaration && indent_parameters && parser_state_tos->dec_nest == 0 && parser_state_tos->p_l_follow == 0) { parser_state_tos->ind_level = parser_state_tos->i_l_follow = indent_parameters; parser_state_tos->ind_stmt = 0; } /* in_or_st set for struct or initialization decl. Don't set it if we're in ansi prototype */ if (!parser_state_tos->paren_depth) parser_state_tos->in_or_st = true; parser_state_tos->in_decl = parser_state_tos->decl_on_line = true; #if 0 if (!parser_state_tos->in_or_st && parser_state_tos->dec_nest <= 0) #endif if (parser_state_tos->dec_nest <= 0) parser_state_tos->just_saw_decl = 2; if (prefix_blankline_requested && (parser_state_tos->block_init != 0 || parser_state_tos->block_init_level != -1 || parser_state_tos->last_token != rbrace || e_code != s_code || e_lab != s_lab || e_com != s_com)) prefix_blankline_requested = 0; i = token_end - token + 1; /* get length of token plus 1 */ /* dec_ind = e_code - s_code + (parser_state_tos->decl_indent>i ? parser_state_tos->decl_indent : i); */ dec_ind = decl_indent > 0 ? decl_indent : i; goto copy_id; case ident: /* got an identifier or constant */ /* If we are in a declaration, we must indent identifier. But not inside the parentheses of an ANSI function declaration. */ if (parser_state_tos->in_decl && parser_state_tos->p_l_follow == 0 && parser_state_tos->last_token != rbrace) { if (parser_state_tos->want_blank) *e_code++ = ' '; parser_state_tos->want_blank = false; if (is_procname == 0 || !procnames_start_line) { if (!parser_state_tos->block_init) if (troff && !parser_state_tos->dumped_decl_indent) { sprintf (e_code, "\n.De %dp+\200p\n", dec_ind * 7); parser_state_tos->dumped_decl_indent = 1; e_code += strlen (e_code); } else while ((e_code - s_code) < dec_ind) { check_code_size; *e_code++ = ' '; } } else { if (dec_ind && s_code != e_code) dump_line (); dec_ind = 0; parser_state_tos->want_blank = false; } } else if (sp_sw && parser_state_tos->p_l_follow == 0) { sp_sw = false; force_nl = true; parser_state_tos->last_u_d = true; parser_state_tos->in_stmt = false; parse (hd_type); } copy_id: if (parser_state_tos->want_blank) *e_code++ = ' '; if (troff && parser_state_tos->its_a_keyword) { e_code = chfont (&bodyf, &keywordf, e_code); for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size; *e_code++ = keywordf.allcaps && islower (*t_ptr) ? toupper (*t_ptr) : *t_ptr; } e_code = chfont (&keywordf, &bodyf, e_code); } else { /* Troff mode requires that strings be processed specially. */ if (troff && (*token == '"' || *token == '\'')) { char qchar; qchar = *token; *e_code++ = '`'; if (qchar == '"') *e_code++ = '`'; e_code = chfont (&bodyf, &stringf, e_code); t_ptr = token + 1; while (t_ptr < token_end) { *e_code = *t_ptr++; if (*e_code == '\\') { *++e_code = '\\'; if (*t_ptr == '\\') *++e_code = '\\'; /* Copy char after backslash. */ *++e_code = *t_ptr++; /* Point after the last char we copied. */ e_code++; } } e_code = chfont (&stringf, &bodyf, e_code - 1); if (qchar == '"') *e_code++ = '\''; } else for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size; *e_code++ = *t_ptr; } } parser_state_tos->want_blank = true; /* If the token is va_dcl, it appears without a semicolon, so we need to pretend that one was there. */ if ((token_end - token) == 6 && strncmp (token, "va_dcl", 6) == 0) { parser_state_tos->in_or_st = false; parser_state_tos->just_saw_decl--; parser_state_tos->in_decl = 0; parse (semicolon); force_nl = true; } break; case period: /* treat a period kind of like a binary operation */ *e_code++ = '.'; /* move the period into line */ parser_state_tos->want_blank = false; /* dont put a blank after a period */ break; case comma: /* only put blank after comma if comma does not start the line */ parser_state_tos->want_blank = (s_code != e_code); if (parser_state_tos->paren_depth == 0 && parser_state_tos->in_decl && is_procname == 0 && !parser_state_tos->block_init) while ((e_code - s_code) < (dec_ind - 1)) { check_code_size; *e_code++ = ' '; } *e_code++ = ','; if (parser_state_tos->p_l_follow == 0) { if (parser_state_tos->block_init_level <= 0) parser_state_tos->block_init = 0; /* If we are in a declaration, and either the user wants all comma'd declarations broken, or the line is getting too long, break the line. */ if (break_comma && (!leave_comma || (compute_code_target () + (e_code - s_code) > max_col - 8) )) force_nl = true; } break; case preesc: /* got the character '#' */ if ((s_com != e_com) || (s_lab != e_lab) || (s_code != e_code)) dump_line (); *e_lab++ = '#'; /* move whole line to 'label' buffer */ { int in_comment = 0; int com_start = 0; char quote = 0; int com_end = 0; /* ANSI allows spaces between '#' and preprocessor directives. Remove such spaces unless user has specified "-lpb". */ while (*buf_ptr == ' ' || *buf_ptr == '\t') { if (leave_preproc_space) *e_lab++ = *buf_ptr; buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } while (*buf_ptr != '\n' || (in_comment && !had_eof)) { check_lab_size; *e_lab = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); switch (*e_lab++) { case BACKSLASH: if (troff) *e_lab++ = BACKSLASH; if (!in_comment) { *e_lab++ = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer (); } break; case '/': if (*buf_ptr == '*' && !in_comment && !quote) { in_comment = 1; *e_lab++ = *buf_ptr++; com_start = e_lab - s_lab - 2; } break; case '"': if (quote == '"') quote = 0; break; case '\'': if (quote == '\'') quote = 0; break; case '*': if (*buf_ptr == '/' && in_comment) { in_comment = 0; *e_lab++ = *buf_ptr++; com_end = e_lab - s_lab; } break; } } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on preprocessor line */ if (save_com.end != save_com.ptr) { need_chars (save_com, 2); *save_com.end++ = '\n'; /* add newline between comments */ *save_com.end++ = ' '; --line_no; } need_chars (save_com, com_end - com_start); strncpy (save_com.end, s_lab + com_start, com_end - com_start); save_com.end += com_end - com_start; e_lab = s_lab + com_start; while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; bp_save = buf_ptr; /* save current input buffer */ be_save = buf_end; buf_ptr = save_com.ptr; /* fix so that subsequent calls to lexi will take tokens out of save_com */ need_chars (save_com, 1); *save_com.end++ = ' '; /* add trailing blank, just in case */ buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ } *e_lab = '\0'; /* null terminate line */ parser_state_tos->pcase = false; } if (strncmp (s_lab + 1, "if", 2) == 0) { if (blanklines_around_conditional_compilation) { register c; prefix_blankline_requested++; while ((c = *in_prog_pos++) == '\n'); in_prog_pos--; } { /* Push a copy of the parser_state onto the stack. All manipulations will use the copy at the top of stack, and then we can return to the previous state by popping the stack. */ struct parser_state *new; new = (struct parser_state *) xmalloc (sizeof (struct parser_state)); memcpy (new, parser_state_tos, sizeof (struct parser_state)); /* We need to copy the dynamically allocated arrays in the struct parser_state too. */ new->p_stack = (enum codes *) xmalloc (parser_state_tos->p_stack_size * sizeof (enum codes)); memcpy (new->p_stack, parser_state_tos->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); new->il = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); memcpy (new->il, parser_state_tos->il, parser_state_tos->p_stack_size * sizeof (int)); new->cstk = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); memcpy (new->cstk, parser_state_tos->cstk, parser_state_tos->p_stack_size * sizeof (int)); new->paren_indents = (short *) xmalloc (parser_state_tos->paren_indents_size * sizeof (short)); memcpy (new->paren_indents, parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); new->next = parser_state_tos; parser_state_tos = new; } } else if (strncmp (s_lab + 1, "else", 4) == 0) { /* When we get #else, we want to restore the parser state to what it was before the matching #if, so that things get lined up with the code before the #if. However, we do not want to pop the stack; we just want to copy the second to top elt of the stack because when we encounter the #endif, it will pop the stack. */ else_or_endif = true; if (parser_state_tos->next) { /* First save the addresses of the arrays for the top of stack. */ enum codes *tos_p_stack = parser_state_tos->p_stack; int *tos_il = parser_state_tos->il; int *tos_cstk = parser_state_tos->cstk; short *tos_paren_indents = parser_state_tos->paren_indents; struct parser_state *second = parser_state_tos->next; memcpy (parser_state_tos, second, sizeof (struct parser_state)); parser_state_tos->next = second; /* Now copy the arrays from the second to top of stack to the top of stack. */ /* Since the p_stack, etc. arrays only grow, never shrink, we know that they will be big enough to fit the array from the second to top of stack. */ parser_state_tos->p_stack = tos_p_stack; memcpy (parser_state_tos->p_stack, parser_state_tos->next->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); parser_state_tos->il = tos_il; memcpy (parser_state_tos->il, parser_state_tos->next->il, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->cstk = tos_cstk; memcpy (parser_state_tos->cstk, parser_state_tos->next->cstk, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->paren_indents = tos_paren_indents; memcpy (parser_state_tos->paren_indents, parser_state_tos->next->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } else diag (1, "Unmatched #else"); } else if (strncmp (s_lab + 1, "endif", 5) == 0) { else_or_endif = true; /* We want to remove the second to top elt on the stack, which was put there by #if and was used to restore the stack at the #else (if there was one). We want to leave the top of stack unmolested so that the state which we have been using is unchanged. */ if (parser_state_tos->next) { struct parser_state *second = parser_state_tos->next; parser_state_tos->next = second->next; free (second->p_stack); free (second->il); free (second->cstk); free (second->paren_indents); free (second); } else diag (1, "Unmatched #endif"); if (blanklines_around_conditional_compilation) { postfix_blankline_requested++; n_real_blanklines = 0; } } /* Normally, subsequent processing of the newline character causes the line to be printed. The following clause handles a special case (comma-separated declarations separated by the preprocessor lines) where this doesn't happen. */ if (parser_state_tos->last_token == comma && parser_state_tos->p_l_follow <= 0 && leave_comma && !parser_state_tos->block_init && break_comma && s_com == e_com) { dump_line (); parser_state_tos->want_blank = false; } break; case comment: /* we have gotten a /* this is a biggie */ if (flushed_nl) { /* we should force a broken line here */ flushed_nl = false; dump_line (); parser_state_tos->want_blank = false; /* dont insert blank at line start */ force_nl = false; } pr_comment (); break; } /* end of big switch stmt */ *e_code = '\0'; /* make sure code section is null terminated */ if (type_code != comment && type_code != newline && type_code != preesc && type_code != form_feed) parser_state_tos->last_token = type_code; } /* end of main while (1) loop */ } char *set_profile (); void set_defaults (); int set_option (); /* Points to current input file */ char *in_name = 0; /* Points to the name of the output file */ char *out_name = 0; /* How many input files were specified */ int input_files; /* Names of all input files */ char **in_file_names; /* Initial number of input filenames to allocate. */ int max_input_files = 128; #ifdef DEBUG int debug; #endif main (argc, argv) int argc; char **argv; { register int i; struct file_buffer *current_input; char *profile_pathname = 0; int using_stdin = false; #ifdef DEBUG if (debug) debug_init (); #endif init_parser (); initialize_backups (); output = 0; input_files = 0; in_file_names = (char **) xmalloc (max_input_files * sizeof (char *)); set_defaults (); for (i = 1; i < argc; ++i) if (strcmp (argv[i], "-npro") == 0 || strcmp (argv[i], "--ignore-profile") == 0 || strcmp (argv[i], "+ignore-profile") == 0) break; if (i >= argc) profile_pathname = set_profile (); for (i = 1; i < argc; ++i) { if (argv[i][0] != '-' && argv[i][0] != '+') /* Filename */ { if (expect_output_file == true) /* Last arg was "-o" */ { if (out_name != 0) { fprintf (stderr, "indent: only one output file (2nd was %s)\n", argv[i]); exit (1); } if (input_files > 1) { fprintf (stderr, "indent: only one input file when output file is specified\n"); exit (1); } out_name = argv[i]; expect_output_file = false; continue; } else { if (using_stdin) { fprintf (stderr, "indent: can't have filenames when specifying standard input\n"); exit (1); } input_files++; if (input_files > 1) { if (out_name != 0) { fprintf (stderr, "indent: only one input file when output file is specified\n"); exit (1); } if (use_stdout != 0) { fprintf (stderr, "indent: only one input file when stdout is used\n"); exit (1); } if (input_files > max_input_files) { max_input_files = 2 * max_input_files; in_file_names = (char **) xrealloc (in_file_names, (max_input_files * sizeof (char *))); } } in_file_names[input_files - 1] = argv[i]; } } else { /* '-' as filename means stdin. */ if (argv[i][0] == '-' && argv[i][1] == '\0') { if (input_files > 0) { fprintf (stderr, "indent: can't have filenames when specifying standard input\n"); exit (1); } using_stdin = true; } else i += set_option (argv[i], (i < argc ? argv[i + 1] : 0), 1); } } if (verbose && profile_pathname) fprintf (stderr, "Read profile %s\n", profile_pathname); if (input_files > 1) { /* When multiple input files are specified, make a backup copy and then output the indented code into the same filename. */ for (i = 0; input_files; i++, input_files--) { current_input = read_file (in_file_names[i]); in_name = out_name = in_file_names[i]; output = fopen (out_name, "w"); if (output == 0) { fprintf (stderr, "indent: can't create %s\n", out_name); exit (1); } make_backup (current_input); reset_parser (); indent (current_input); if (fclose (output) != 0) sys_error (out_name); } } else { /* One input stream -- specified file, or stdin */ if (input_files == 0 || using_stdin) { input_files = 1; in_file_names[0] = "Standard input"; current_input = read_stdin (); } else /* 1 input file */ { current_input = read_file (in_file_names[0]); if (!out_name && !use_stdout) { out_name = in_file_names[0]; make_backup (current_input); } } in_name = in_file_names[0]; /* Uset stdout if it was specified ("-st"), or neither input nor output file was specified, or we're doing troff. */ if (use_stdout || !out_name || troff) output = stdout; else { output = fopen (out_name, "w"); if (output == 0) { fprintf (stderr, "indent: can't create %s\n", out_name); exit (1); } } reset_parser (); indent (current_input); } exit (0); } indent-2.2.11/regression/input/embedded-cuddle1.c0000644000177400010010000000007610775646104016542 00000000000000void foo() { #ifdef foo if (1) { } /* if */ { a++; } #endif } indent-2.2.11/regression/input/box-comm.c0000644000177400010010000000051210775646104015206 00000000000000/*********************************************************************\ This is a test of my style of block comment Sometimes I like to do something like this. \*********************************************************************/ void Hello(void) { printf("Hello world.\n"); } indent-2.2.11/regression/input/wrapped-string.c0000644000177400010010000000161710775646104016442 00000000000000#include int main() { char *format = "\ %c %c %c %c %c %c %c %c %c\n"; printf(format, '1', '2', '3', '4', '5', '6', '7', '8', '9'); } static inline void __generic_memcpy_fromfs( void * to, const void * from, unsigned long n) { __asm__ volatile (" cld cmpl $3,%0 jbe 1f movl %%edi,%%ecx negl %%ecx andl $3,%%ecx subl %%ecx,%0 fs; rep; movsb movl %0,%%ecx shrl $2,%%ecx fs; rep; movsl andl $3,%0 1: movl %0,%%ecx fs; rep; movsb"); } static inline void __generic_memcpy_fromfs(void * to, const void * from, unsigned long n) { __asm__ volatile (" cld cmpl $3,%0 jbe 1f movl %%edi,%%ecx negl %%ecx andl $3,%%ecx subl %%ecx,%0 fs; rep; movsb movl %0,%%ecx shrl $2,%%ecx fs; rep; movsl andl $3,%0 1: movl %0,%%ecx fs; rep; movsb" :"=abd" (n) :"0" (n),"D" ((long) to),"S" ((long) from) :"cx","di","si", "memory"); } indent-2.2.11/regression/input/one-line-3.c0000644000177400010010000000007310775646104015335 00000000000000main (){ do { bar (33); grop (); } while (1); return -1; } indent-2.2.11/regression/input/typedef-bug.c0000644000177400010010000000012310775646104015676 00000000000000/* Try indent -st -ncs -TUNCH on this file */ void foo() { char c = (UNCH) 1; } indent-2.2.11/regression/input/newlined-parms.c0000644000177400010010000000005310775646104016412 00000000000000int foo(int a, int *b, char c) { } indent-2.2.11/regression/input/unknown-type.c0000644000177400010010000000012510775646104016143 00000000000000#include Error_t g (void) { return 0; } Error_t g (void) { return 0; } indent-2.2.11/regression/input/on-off-1.c0000644000177400010010000000050010775646104015004 00000000000000/* Testing *INDENT-ON* and *INDENT-OFF* controls comments */ // *INDENT-OFF* // *INDENT-ON* main(int argc, char **argv) { char *foo; puts(foo); } /* *INDENT-OFF* */ grunt(int argc, char **argv) { char *foo; puts(foo); } /* *INDENT-ON* */ frobp (int argc, char **argv) { char *foo; puts(foo); } indent-2.2.11/regression/input/bug-hp.c0000644000177400010010000000007610775646104014654 00000000000000void dblptr_main(void) { double (*valfnc) (const char *); } indent-2.2.11/regression/input/indent.h0000644000177400010010000003665110775646104014770 00000000000000 /* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #define BACKSLASH '\\' enum codes { code_eof = 0, /* end of file */ newline, lparen, /* '(' or '['. Also '{' in an initialization. */ rparen, /* ')' or ']'. Also '}' in an initialization. */ unary_op, binary_op, postop, question, casestmt, colon, semicolon, lbrace, rbrace, ident, /* string or char literal, identifier, number */ comma, comment, swstmt, preesc, /* '#'. */ form_feed, decl, sp_paren, /* if, for, or while token */ sp_nparen, ifstmt, whilestmt, forstmt, stmt, stmtl, elselit, dolit, dohead, dostmt, ifhead, elsehead, period }; enum rwcodes { rw_none, rw_break, rw_switch, rw_case, rw_struct_like, /* struct, enum, union */ rw_decl, rw_sp_paren, /* if, while, for */ rw_sp_nparen, /* do, else */ rw_sizeof, rw_return }; #define false 0 #define true 1 /* Name of input file. */ extern char *in_name; extern char *in_prog; /* pointer to the null-terminated input program */ /* Point to the position in the input program which we are currently looking at. */ extern char *in_prog_pos; /* Point to the start of the current line. */ extern char *cur_line; /* Size of the input program, not including the ' \n\0' we add at the end */ extern unsigned int in_prog_size; extern FILE *output; /* the output file */ #define check_code_size \ if (e_code >= l_code) { \ register nsize = l_code-s_code+400; \ codebuf = (char *) realloc(codebuf, nsize); \ e_code = codebuf + (e_code-s_code) + 1; \ l_code = codebuf + nsize - 5; \ s_code = codebuf + 1; \ } #define check_com_size \ if (e_com >= l_com) { \ register nsize = l_com-s_com+400; \ combuf = (char *) realloc(combuf, nsize); \ e_com = combuf + (e_com-s_com) + 1; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ } #define check_lab_size \ if (e_lab >= l_lab) { \ register nsize = l_lab-s_lab+400; \ labbuf = (char *) realloc(labbuf, nsize); \ e_lab = labbuf + (e_lab-s_lab) + 1; \ l_lab = labbuf + nsize - 5; \ s_lab = labbuf + 1; \ } extern char *labbuf; /* buffer for label */ extern char *s_lab; /* start ... */ extern char *e_lab; /* .. and end of stored label */ extern char *l_lab; /* limit of label buffer */ extern char *codebuf; /* buffer for code section */ extern char *s_code; /* start ... */ extern char *e_code; /* .. and end of stored code */ extern char *l_code; /* limit of code section */ extern char *combuf; /* buffer for comments */ extern char *s_com; /* start ... */ extern char *e_com; /* ... and end of stored comments */ extern char *l_com; /* limit of comment buffer */ extern char *buf_ptr; /* ptr to next character to be taken from in_buffer */ extern char *buf_end; /* ptr to first after last char in in_buffer */ /* pointer to the token that lexi() has just found */ extern char *token; /* points to the first char after the end of token */ extern char *token_end; /* Functions from lexi.c */ enum codes lexi (); /* Used to keep track of buffers. */ struct buf { char *ptr; /* points to the start of the buffer */ char *end; /* points to the character beyond the last one (e.g. is equal to ptr if the buffer is empty). */ int size; /* how many chars are currently allocated. */ }; /* Buffer in which to save a comment which occurs between an if(), while(), etc., and the statement following it. Note: the fact that we point into this buffer, and that we might realloc() it (via the need_chars macro) is a bad thing (since when the buffer is realloc'd its address might change, making any pointers into it point to garbage), but since the filling of the buffer (hence the need_chars) and the using of the buffer (where buf_ptr points into it) occur at different times, we can get away with it (it would not be trivial to fix). */ extern struct buf save_com; extern char *bp_save; /* saved value of buf_ptr when taking input from save_com */ extern char *be_save; /* similarly saved value of buf_end */ extern int use_stdout; extern int pointer_as_binop; extern int blanklines_after_declarations; extern int blanklines_before_blockcomments; extern int blanklines_after_procs; extern int blanklines_around_conditional_compilation; extern int swallow_optional_blanklines; extern int n_real_blanklines; extern int prefix_blankline_requested; extern int postfix_blankline_requested; extern int break_comma; /* when true and not in parens, break after a comma */ extern int found_err; /* flag set in diag() on error */ extern int else_or_endif; extern int di_stack_alloc; extern int *di_stack; /* number of spaces to indent braces from the suround if, while, etc. in -bl (bype_2 == 0) code */ extern int brace_indent; extern int btype_2; /* when true, brace should be on same line as if, while, etc */ /* If true, a space is inserted between if, while, or for, and a semicolon for example while (*p++ == ' ') ; */ extern int space_sp_semicolon; /* True if a #else or #endif has been encountered. */ extern int else_or_endif; extern int case_ind; /* indentation level to be used for a "case n:" in spaces */ extern int code_lines; /* count of lines with code */ /* the number of comments processed, set by pr_comment. */ extern int out_coms; extern int out_lines; /* the number of lines written, set by dump_line */ extern int com_lines; /* the number of lines with comments, set by dump_line */ extern int had_eof; /* set to true when input is exhausted */ extern int line_no; /* the current line number. */ extern int max_col; /* the maximum allowable line length */ extern int verbose; /* when true, non-essential error messages are printed */ extern int cuddle_else; /* true if else should cuddle up to '}' */ extern int star_comment_cont; /* true iff comment continuation lines should have stars at the beginning of each line. */ extern int comment_delimiter_on_blankline; extern int troff; /* true iff were generating troff input */ extern int procnames_start_line;/* if true, the names of procedures being defined get placed in column 1 (ie. a newline is placed between the type of the procedure and its name) */ extern int expect_output_file; /* Means "-o" was specified. */ extern int proc_calls_space; /* If true, procedure calls look like: foo (bar) rather than foo(bar) */ extern int cast_space; /* If true, casts look like: r * (char *) bar rather than (char *)bar */ /* If comments which start in column 1 are to be magically reformatted */ extern int format_col1_comments; /* If any comments are to be reformatted */ extern int format_comments; extern int suppress_blanklines; /* set iff following blanklines should be suppressed */ extern int continuation_indent; /* set to the indentation between the edge of code and continuation lines in spaces */ extern int lineup_to_parens; /* if true, continued code within parens will be lined up to the open paren */ extern int leave_preproc_space; /* if true, leave the spaces between '#' and preprocessor commands. */ /* The position that we will line the current line up with when it comes time to print it (if we are lining up to parentheses). */ extern int paren_target; /* true iff a blank should always be inserted after sizeof */ extern int blank_after_sizeof; extern int blanklines_after_declarations_at_proctop; /* This is vaguely similar to blanklines_after_decla rations except that it only applies to the first set of declarations in a procedure (just after the first '{') and it causes a blank line to be generated even if there are no declarations */ extern int block_comment_max_col; extern int extra_expression_indent; /* True if continuation lines from the expression part of "if(e)", "while(e)", "for(e;e;e)" should be indented an extra tab stop so that they don't conflict with the code that follows */ /* The following are all controlled by command line switches (as are some of the things above). */ extern int leave_comma; /* if true, never break declarations after commas */ extern int decl_com_ind; /* the column in which comments after declarations should be put */ extern int case_indent; /* The distance to indent case labels from the switch statement */ extern int com_ind; /* the column in which comments to the right of code should start */ extern int decl_indent; /* column to indent declared identifiers to */ extern int ljust_decl; /* true if declarations should be left justified */ extern int unindent_displace; /* comments not to the right of code will be placed this many indentation levels to the left of code */ extern int else_if; /* True iff else if pairs should be handled specially */ /* Number of spaces to indent parameters. */ extern int indent_parameters; /* The size of one indentation level in spaces. */ extern int ind_size; /* The number of columns a tab character generates. */ extern int tabsize; /* Nonzero if we should use standard input/output when files are not explicitly specified. */ extern int use_stdinout; /* -troff font state information */ struct fstate { char font[4]; char size; int allcaps:1; }; char *chfont (); extern struct fstate keywordf, /* keyword font */ stringf, /* string font */ boxcomf, /* Box comment font */ blkcomf, /* Block comment font */ scomf, /* Same line comment font */ bodyf; /* major body font */ /* This structure contains information relating to the state of parsing the code. The difference is that the state is saved on #if and restored on #else. */ struct parser_state { struct parser_state *next; enum codes last_token; struct fstate cfont; /* Current font */ /* This is the parsers stack, and the current allocated size. */ enum codes *p_stack; int p_stack_size; /* This stack stores indentation levels */ /* Currently allocated size is stored in p_stack_size. */ int *il; /* If the last token was an ident and is a reserved word, remember the type. */ enum rwcodes last_rw; /* Used to store case stmt indentation levels. */ /* Currently allocated size is stored in p_stack_size. */ int *cstk; /* Pointer to the top of stack of the p_stack, il and cstk arrays. */ int tos; int box_com; /* set to true when we are in a "boxed" comment. In that case, the first non-blank char should be lined up with the / in /* */ /* Shift comments by this many columns. */ int comment_delta; /* Value of comment_delta for the following line. */ int n_comment_delta; int cast_mask; /* indicates which close parens close off casts */ /* A bit for each paren level, set if the open paren was in a context which indicates that this pair of parentheses is not a cast. */ int noncast_mask; int sizeof_mask; /* indicates which close parens close off sizeof''s */ int block_init; /* true iff inside a block initialization */ int block_init_level; /* The level of brace nesting in an initialization */ int last_nl; /* this is true if the last thing scanned was a newline */ int in_or_st; /* Will be true iff there has been a declarator (e.g. int or char) and no left paren since the last semicolon. When true, a '{' is starting a structure definition or an initialization list */ int bl_line; /* set to 1 by dump_line if the line is blank */ int col_1; /* set to true if the last token started in column 1 */ int com_col; /* this is the column in which the current coment should start */ int dec_nest; /* current nesting level for structure or init */ int decl_on_line; /* set to true if this line of code has part of a declaration on it */ int i_l_follow; /* the level in spaces to which ind_level should be set after the current line is printed */ int in_decl; /* set to true when we are in a declaration stmt. The processing of braces is then slightly different */ int in_stmt; /* set to 1 while in a stmt */ int ind_level; /* the current indentation level in spaces */ int ind_stmt; /* set to 1 if next line should have an extra indentation level because we are in the middle of a stmt */ int last_u_d; /* set to true after scanning a token which forces a following operator to be unary */ int p_l_follow; /* used to remember how to indent following statement */ int paren_level; /* parenthesization level. used to indent within stmts */ int paren_depth; /* Depth of paren nesting anywhere. */ /* Column positions of paren at each level. If positive, it contains just the number of characters of code on the line up to and including the right parenthesis character. If negative, it contains the opposite of the actual level of indentation in characters (that is, the indentation of the line has been added to the number of characters and the sign has been reversed to indicate that this has been done). */ short *paren_indents; /* column positions of each paren */ int paren_indents_size; /* Currently allocated size. */ int pcase; /* set to 1 if the current line label is a case. It is printed differently from a regular label */ int search_brace; /* set to true by parse when it is necessary to buffer up all info up to the start of a stmt after an if, while, etc */ int use_ff; /* set to one if the current line should be terminated with a form feed */ int want_blank; /* set to true when the following token should be prefixed by a blank. (Said prefixing is ignored in some cases.) */ int its_a_keyword; int sizeof_keyword; int dumped_decl_indent; int in_parameter_declaration; char *procname; /* The name of the current procedure */ char *procname_end; /* One char past the last one in procname */ int just_saw_decl; }; /* All manipulations of the parser state occur at the top of stack (tos). A stack is kept for conditional compilation (unrelated to the p_stack, il, & cstk stacks)--it is implemented as a linked list via the next field. */ extern struct parser_state *parser_state_tos; /* The column in which comments to the right of #else and #endif should start. */ extern int else_endif_col; indent-2.2.11/regression/input/bug-npsl.c0000644000177400010010000000311110775646104015212 00000000000000void foo() /* */ /* This */ /* is in */ /* the same */ /* column */ /* */ /* */ { } void bar() /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ { } indent-2.2.11/regression/input/comments3.c0000644000177400010010000000076510775646104015407 00000000000000void foo() { if (( #if 1 /* * REMOVE THIS after all servers upgraded to 2.10.01 and * Uworld uses a numeric too */ (strlen(parv[1]) != 1 && !(acptr = FindClient(parv[1])))) || (strlen(parv[1]) == 1 && #endif 1)) { } if ((!IsServer(cptr)) && isNickJuped(nick)) { sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* parv[0] is empty when connecting */ BadPtr(parv[0]) ? "*" : parv[0], nick); return 0; /* NICK message ignored */ } } indent-2.2.11/regression/input/func-def.c0000644000177400010010000000010510775646104015152 00000000000000void a (int x, int y, int z); void b (int x, int y, int z); indent-2.2.11/regression/input/backup.c0000644000177400010010000002071610775646104014742 00000000000000 /* backup.c -- make Emacs style backup file names Copyright (C) 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it without restriction. 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. GNU/Emacs style backups -- This behaviour is controlled by two environment variables, VERSION_CONTROL and SIMPLE_BACKUP_SUFFIX. VERSION_CONTROL determines what kinds of backups are made. If it's value is "numbered", then the first modification of some file "eraserhead.c" will yield a backup file "eraserhead.c.~1~", the second modification will yield "eraserhead.c.~2~", and so on. It does not matter if the version numbers are not a sequence; the next version will be one greater than the highest in that directory. If the value of VERSION_CONTROL is "numbered_existing", then such numbered backups will be made if there are already numbered backup versions of the file. Otherwise, the backup name will be that of the original file with "~" (tilde) appended. E.g., "eraserhead.c~". If the value of VERSION_CONTROL is "simple", then the backup name will be that of the original file with "~" appended, regardless of whether or not there exist numbered versions in the directory. For simple backups, the value of SIMPLE_BACKUP_SUFFIX will be used rather than "~" if it is set. If VERSION_CONTROL is unset, "numbered_existing" is assumed. For Emacs lovers, "nil" is equivalent to "numbered_existing" and "t" is equivalent to "numbered". Finally, if VERSION_CONTROL is "none" or "never", backups are not made. I suggest you avoid this behaviour. */ /* Written by jla, based on code from djm (see `patch') */ #include "backup.h" #include "sys.h" #include #ifndef isascii #define ISDIGIT(c) (isdigit ((unsigned char) (c))) #else #define ISDIGIT(c) (isascii (c) && isdigit (c)) #endif #ifndef NODIR #include #ifdef DIRENT #include #ifdef direct #undef direct #endif #define direct dirent #define NLENGTH(direct) (strlen((direct)->d_name)) #else /* !DIRENT */ #define NLENGTH(direct) ((direct)->d_namlen) #ifdef USG #ifdef SYSNDIR #include #else /* !SYSNDIR */ #include #endif /* !SYSNDIR */ #else /* !USG */ #include #endif /* !USG */ #endif /* !DIRENT */ #if defined (HAVE_UNISTD_H) #include #endif #if defined (_POSIX_VERSION) /* Might be defined in unistd.h. */ /* POSIX does not require that the d_ino field be present, and some systems do not provide it. */ #define REAL_DIR_ENTRY(dp) 1 #else #define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0) #endif #else /* NODIR */ #define generate_backup_filename(v,f) simple_backup_name((f)) #endif /* NODIR */ /* Default backup file suffix to use */ char *simple_backup_suffix = "~"; /* What kinds of backup files to make -- see table `version_control_values' below. */ enum backup_mode version_control = unknown; /* Construct a simple backup name for PATHNAME by appending the value of `simple_backup_suffix'. */ static char * simple_backup_name (pathname) char *pathname; { char *backup_name; backup_name = xmalloc (strlen (pathname) + strlen (simple_backup_suffix) + 2); sprintf (backup_name, "%s%s", pathname, simple_backup_suffix); return backup_name; } #ifndef NODIR /* If DIRENTRY is a numbered backup version of file BASE, return that number. BASE_LENGTH is the string length of BASE. */ static int version_number (base, direntry, base_length) char *base; char *direntry; int base_length; { int version; char *p; version = 0; if (!strncmp (base, direntry, base_length) && ISDIGIT (direntry[base_length + 2])) { for (p = &direntry[base_length + 2]; ISDIGIT (*p); ++p) version = version * 10 + *p - '0'; if (p[0] != '~' || p[1]) version = 0; } return version; } /* Return the highest version of file FILENAME in directory DIRNAME. Return 0 if there are no numbered versions. */ static int highest_version (filename, dirname) char *filename, *dirname; { DIR *dirp; struct direct *dp; int highest_version; int this_version; int file_name_length; dirp = opendir (dirname); if (!dirp) return 0; highest_version = 0; file_name_length = strlen (filename); while ((dp = readdir (dirp)) != 0) { if (!REAL_DIR_ENTRY (dp) || NLENGTH (dp) <= file_name_length + 2) continue; this_version = version_number (filename, dp->d_name, file_name_length); if (this_version > highest_version) highest_version = this_version; } closedir (dirp); return highest_version; } /* Return the highest version number for file PATHNAME. If there are no backups, or only a simple backup, return 0. */ static int max_version (pathname) char *pathname; { register char *p; register char *filename; int pathlen = strlen (pathname); int version; p = pathname + pathlen - 1; while (p > pathname && *p != '/') p--; if (*p == '/') { int dirlen = p - pathname; register char *dirname; filename = p + 1; dirname = xmalloc (dirlen + 1); strncpy (dirname, pathname, (dirlen)); dirname[dirlen] = '\0'; version = highest_version (filename, dirname); free (dirname); return version; } filename = pathname; version = highest_version (filename, "."); return version; } /* Generate a backup filename for PATHNAME, dependent on the value of VERSION_CONTROL. */ static char * generate_backup_filename (version_control, pathname) enum backup_mode version_control; char *pathname; { int last_numbered_version; char *backup_name; if (version_control == none) return 0; if (version_control == simple) return simple_backup_name (pathname); last_numbered_version = max_version (pathname); if (version_control == numbered_existing && last_numbered_version == 0) return simple_backup_name (pathname); last_numbered_version++; backup_name = xmalloc (strlen (pathname) + 16); if (!backup_name) return 0; sprintf (backup_name, "%s.~%d~", pathname, last_numbered_version); return backup_name; } #endif /* !NODIR */ static struct version_control_values values[] = { {none, "never"}, /* Don't make backups. */ {simple, "simple"}, /* Only simple backups */ {numbered_existing, "existing"}, /* Numbered if they already exist */ {numbered_existing, "nil"}, /* Ditto */ {numbered, "numbered"}, /* Numbered backups */ {numbered, "t"}, /* Ditto */ {unknown, 0} /* Initial, undefined value. */ }; extern char *getenv (); /* Determine the value of `version_control' by looking in the environment variable "VERSION_CONTROL". Defaults to numbered_existing. */ enum backup_mode version_control_value () { char *version; struct version_control_values *v; version = getenv ("VERSION_CONTROL"); if (version == 0 || *version == 0) return numbered_existing; v = &values[0]; while (v->name) { if (strcmp (version, v->name) == 0) return v->value; v++; } return unknown; } /* Initialize information used in determining backup filenames. */ void initialize_backups () { char *v = getenv ("SIMPLE_BACKUP_SUFFIX"); if (v && *v) simple_backup_suffix = v; #ifdef NODIR version_control = simple; #else /* !NODIR */ version_control = version_control_value (); if (version_control == unknown) { fprintf (stderr, "indent: Strange version-control value\n"); fprintf (stderr, "indent: Using numbered-existing\n"); version_control = numbered_existing; } #endif /* !NODIR */ } /* Prints an error message using `perror' */ extern void sys_error (); /* Make a backup copy of FILE, taking into account version-control. See the description at the beginning of the file for details. */ void make_backup (file) struct file_buffer *file; { int fd; register char *p = file->name + strlen (file->name) - 1; char *backup_filename; char *new_backup_name; backup_filename = generate_backup_filename (version_control, file->name); if (!backup_filename) { fprintf (stderr, "indent: Can't make backup filename of %s", file->name); exit (1); } fd = creat (backup_filename, 0666); if (fd < 0) sys_error (backup_filename); if (write (fd, file->data, file->size) != file->size) sys_error (backup_filename); close (fd); free (backup_filename); } indent-2.2.11/regression/input/kr.c0000644000177400010010000000016310775646104014103 00000000000000#include struct { int x; int y; } z; main() { struct {int x;int y;} z; z.x=1; z.y=2; } indent-2.2.11/regression/input/do-cdw.c0000644000177400010010000000016010775646104014641 00000000000000foo ( ) { do { b = getchar (); } while (b != 0xff); do b = getchar (); while (b != 0xff); } indent-2.2.11/regression/input/right-margin-comment.c0000644000177400010010000000010110775646104017507 00000000000000int i; /* this comment is just too long for one line */ indent-2.2.11/regression/input/fp.c0000644000177400010010000000041710775646104014076 00000000000000int (*fp ())(); register void (*GCForward) () asm ("r16"); /* GC Forwarding code */ main () { switch (fork ()) { default : break; } } int * function_2 (var) int var; { int * var_1_0; var_1_0 = (int *) make_shape_1d (var); return (var_1_0); } indent-2.2.11/regression/input/args.c0000644000177400010010000006135210775646104014432 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Argument scanning and profile reading code. Default parameters are set here as well. */ #include "sys.h" #include "indent.h" #include #include "version.h" int else_endif_col; extern char *in_name; char *getenv (); /* profile types */ enum profile { PRO_BOOL, /* boolean */ PRO_INT, /* integer */ PRO_FONT, /* troff font */ PRO_IGN, /* ignore it */ PRO_KEY, /* -T switch */ PRO_SETTINGS, /* bundled set of settings */ PRO_PRSTRING /* Print string and exit */ }; /* profile specials for booleans */ enum on_or_off { ONOFF_NA, /* Not applicable. Used in table for non-booleans. */ OFF, /* This option turns on the boolean variable in question. */ ON /* it turns it off */ }; /* Explicit flags for each option. */ static int exp_T = 0; static int exp_bacc = 0; static int exp_badp = 0; static int exp_bad = 0; static int exp_bap = 0; static int exp_bbb = 0; static int exp_bc = 0; static int exp_bli = 0; static int exp_bl = 0; static int exp_bs = 0; static int exp_cdb = 0; static int exp_cd = 0; static int exp_ce = 0; static int exp_ci = 0; static int exp_cli = 0; static int exp_cp = 0; static int exp_cs = 0; static int exp_c = 0; static int exp_di = 0; static int exp_dj = 0; static int exp_d = 0; static int exp_eei = 0; static int exp_ei = 0; static int exp_fbc = 0; static int exp_fbx = 0; static int exp_fb = 0; static int exp_fc1 = 0; static int exp_fca = 0; static int exp_fc = 0; static int exp_fk = 0; static int exp_fs = 0; static int exp_gnu = 0; static int exp_orig = 0; static int exp_ip = 0; static int exp_nip = 0; static int exp_i = 0; static int exp_lc = 0; static int exp_lp = 0; static int exp_l = 0; static int exp_lps = 0; static int exp_pcs = 0; static int exp_psl = 0; static int exp_pro = 0; static int exp_ps = 0; static int exp_kr = 0; static int exp_sc = 0; static int exp_sob = 0; static int exp_ss = 0; static int exp_st = 0; static int exp_troff = 0; static int exp_ts = 0; static int exp_v = 0; static int exp_version = 0; /* The following variables are controlled by command line parameters and their meaning is explained in indent.h. */ int leave_comma; int decl_com_ind; int case_indent; int com_ind; int decl_indent; int ljust_decl; int unindent_displace; int else_if; int indent_parameters; int ind_size; int tabsize; int blanklines_after_procs; int use_stdout; int pointer_as_binop; int blanklines_after_declarations; int blanklines_before_blockcomments; int blanklines_around_conditional_compilation; int swallow_optional_blanklines; int n_real_blanklines; int prefix_blankline_requested; int postfix_blankline_requested; int brace_indent; int btype_2; int space_sp_semicolon; int case_ind; int max_col; int verbose; int cuddle_else; int star_comment_cont; int comment_delimiter_on_blankline; int troff; int procnames_start_line; int proc_calls_space; int cast_space; int format_col1_comments; int format_comments; int continuation_indent; int lineup_to_parens; int leave_preproc_space; int blank_after_sizeof; int blanklines_after_declarations_at_proctop; int block_comment_max_col; int extra_expression_indent; int expect_output_file; /* N.B.: because of the way the table here is scanned, options whose names are substrings of other options must occur later; that is, with -lp vs -l, -lp must be first. Also, while (most) booleans occur more than once, the last default value is the one actually assigned. */ struct pro { char *p_name; /* name, eg -bl, -cli */ enum profile p_type; int p_default; /* the default value (if int) */ /* If p_type == PRO_BOOL, ON or OFF to tell how this switch affects the variable. Not used for other p_type's. */ enum on_or_off p_special; /* if p_type == PRO_SETTINGS, a (char *) pointing to a list of the switches to set, separated by NULs, terminated by 2 NULs. if p_type == PRO_BOOL, PRO_INT, or PRO_FONT, address of the variable that gets set by the option. if p_type == PRO_PRSTRING, a (char *) pointing to the string. */ int *p_obj; /* Points to a nonzero value (allocated statically for all options) if the option has been specified explicitly. This is necessary because for boolean options, the options to set and reset the variable must share the explicit flag. */ int *p_explicit; }; #ifdef BERKELEY_DEFAULTS /* Settings for original defaults */ struct pro pro[] = { {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation, &exp_bacc}, {"badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop, &exp_badp}, {"bad", PRO_BOOL, false, ON, &blanklines_after_declarations, &exp_bad}, {"bap", PRO_BOOL, false, ON, &blanklines_after_procs, &exp_bap}, {"bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments, &exp_bbb}, {"bc", PRO_BOOL, true, OFF, &leave_comma, &exp_bc}, {"bli", PRO_INT, 0, ONOFF_NA, &brace_indent, &exp_bli}, {"bl", PRO_BOOL, true, OFF, &btype_2, &exp_bl}, {"br", PRO_BOOL, true, ON, &btype_2, &exp_bl}, {"bs", PRO_BOOL, false, ON, &blank_after_sizeof, &exp_bs}, {"cdb", PRO_BOOL, true, ON, &comment_delimiter_on_blankline, &exp_cdb}, {"cd", PRO_INT, 33, ONOFF_NA, &decl_com_ind, &exp_cd}, {"ce", PRO_BOOL, true, ON, &cuddle_else, &exp_ce}, {"ci", PRO_INT, 4, ONOFF_NA, &continuation_indent, &exp_ci}, {"cli", PRO_INT, 0, ONOFF_NA, &case_indent, &exp_cli}, {"cp", PRO_INT, 33, ONOFF_NA, &else_endif_col, &exp_cp}, {"cs", PRO_BOOL, true, ON, &cast_space, &exp_cs}, {"c", PRO_INT, 33, ONOFF_NA, &com_ind, &exp_c}, {"di", PRO_INT, 16, ONOFF_NA, &decl_indent, &exp_di}, {"dj", PRO_BOOL, false, ON, &ljust_decl, &exp_dj}, {"d", PRO_INT, 0, ONOFF_NA, &unindent_displace, &exp_d}, {"eei", PRO_BOOL, false, ON, &extra_expression_indent, &exp_eei}, {"ei", PRO_BOOL, true, ON, &else_if, &exp_ei}, {"fbc", PRO_FONT, 0, ONOFF_NA, (int *) &blkcomf, &exp_fbc}, {"fbx", PRO_FONT, 0, ONOFF_NA, (int *) &boxcomf, &exp_fbx}, {"fb", PRO_FONT, 0, ONOFF_NA, (int *) &bodyf, &exp_fb}, {"fc1", PRO_BOOL, true, ON, &format_col1_comments, &exp_fc1}, {"fca", PRO_BOOL, true, ON, &format_comments, &exp_fca}, {"fc", PRO_FONT, 0, ONOFF_NA, (int *) &scomf, &exp_fc}, {"fk", PRO_FONT, 0, ONOFF_NA, (int *) &keywordf, &exp_fk}, {"fs", PRO_FONT, 0, ONOFF_NA, (int *) &stringf, &exp_fs}, {"gnu", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-bl\0-ncdb\0-cs\0-nce\0-di2\0-ndj\0\ -ei\0-nfc1\0-i2\0-ip5\0-lp\0-pcs\0-nps\0-psl\0-nsc\0-nsob\0-bli2\0\ -cp1\0-nfca\0", &exp_gnu}, {"ip", PRO_INT, 4, ON, &indent_parameters, &exp_ip}, {"i", PRO_INT, 4, ONOFF_NA, &ind_size, &exp_i}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-br\0-c33\0-cd33\0-ncdb\0-ce\0\ -ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i4\0-ip0\0-l75\0-lp\0-npcs\0-npsl\0-cs\0\ -nsc\0-nsc\0-nsob\0-nfca\0-cp33\0-nss\0", &exp_kr}, {"lc", PRO_INT, 0, ONOFF_NA, &block_comment_max_col, &exp_lc}, {"lps", PRO_BOOL, true, ON, &leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens, &exp_lp}, {"l", PRO_INT, 78, ONOFF_NA, &max_col, &exp_l}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation, &exp_bacc}, {"nbadp", PRO_BOOL, false, OFF, &blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations, &exp_bad}, {"nbap", PRO_BOOL, false, OFF, &blanklines_after_procs, &exp_bap}, {"nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments, &exp_bbb}, {"nbc", PRO_BOOL, true, ON, &leave_comma, &exp_bc}, {"nbs", PRO_BOOL, false, OFF, &blank_after_sizeof, &exp_bs}, {"ncdb", PRO_BOOL, true, OFF, &comment_delimiter_on_blankline, &exp_cdb}, {"nce", PRO_BOOL, true, OFF, &cuddle_else, &exp_ce}, {"ncs", PRO_BOOL, true, OFF, &cast_space, &exp_cs}, {"ndj", PRO_BOOL, false, OFF, &ljust_decl, &exp_dj}, {"neei", PRO_BOOL, false, OFF, &extra_expression_indent, &exp_eei}, {"nei", PRO_BOOL, true, OFF, &else_if, &exp_ei}, {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments, &exp_fc1}, {"nfca", PRO_BOOL, true, OFF, &format_comments, &exp_fca}, {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0", &exp_nip}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens, &exp_lp}, {"npcs", PRO_BOOL, false, OFF, &proc_calls_space, &exp_pcs}, {"npro", PRO_IGN, 0, ONOFF_NA, 0, &exp_pro}, {"npsl", PRO_BOOL, true, OFF, &procnames_start_line, &exp_psl}, {"nps", PRO_BOOL, false, OFF, &pointer_as_binop, &exp_ps}, {"nsc", PRO_BOOL, true, OFF, &star_comment_cont, &exp_sc}, {"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines, &exp_sob}, {"nss", PRO_BOOL, false, OFF, &space_sp_semicolon, &exp_ss}, {"nv", PRO_BOOL, false, OFF, &verbose, &exp_v}, {"o", PRO_BOOL, false, ON, &expect_output_file, &expect_output_file}, {"pcs", PRO_BOOL, false, ON, &proc_calls_space, &exp_pcs}, {"psl", PRO_BOOL, true, ON, &procnames_start_line, &exp_psl}, {"ps", PRO_BOOL, false, ON, &pointer_as_binop, &exp_ps}, {"sc", PRO_BOOL, true, ON, &star_comment_cont, &exp_sc}, {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines, &exp_sob}, {"ss", PRO_BOOL, false, ON, &space_sp_semicolon, &exp_ss}, {"st", PRO_BOOL, false, ON, &use_stdout, &exp_st}, {"troff", PRO_BOOL, false, ON, &troff, &exp_troff}, {"ts", PRO_INT, 8, ONOFF_NA, &tabsize, &exp_ts}, {"version", PRO_PRSTRING, 0, ONOFF_NA, (int *) VERSION_STRING, &exp_version}, {"v", PRO_BOOL, false, ON, &verbose, &exp_v}, /* Signify end of structure. */ {0, PRO_IGN, 0, ONOFF_NA, 0, 0} }; #else /* Default to GNU style */ /* Changed to make GNU style the default. */ struct pro pro[] = { {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation, &exp_bacc}, {"badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop, &exp_badp}, {"bad", PRO_BOOL, false, ON, &blanklines_after_declarations, &exp_bad}, {"bap", PRO_BOOL, true, ON, &blanklines_after_procs, &exp_bap}, {"bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments, &exp_bbb}, {"bc", PRO_BOOL, true, OFF, &leave_comma, &exp_bc}, {"bli", PRO_INT, 2, ONOFF_NA, &brace_indent, &exp_bli}, {"bl", PRO_BOOL, true, OFF, &btype_2, &exp_bl}, {"br", PRO_BOOL, false, ON, &btype_2, &exp_bl}, {"bs", PRO_BOOL, false, ON, &blank_after_sizeof, &exp_bs}, {"cdb", PRO_BOOL, false, ON, &comment_delimiter_on_blankline, &exp_cdb}, {"cd", PRO_INT, 33, ONOFF_NA, &decl_com_ind, &exp_cd}, {"ce", PRO_BOOL, false, ON, &cuddle_else, &exp_ce}, {"ci", PRO_INT, 0, ONOFF_NA, &continuation_indent, &exp_ci}, {"cli", PRO_INT, 0, ONOFF_NA, &case_indent, &exp_cli}, {"cp", PRO_INT, 1, ONOFF_NA, &else_endif_col, &exp_cp}, {"cs", PRO_BOOL, true, ON, &cast_space, &exp_cs}, {"c", PRO_INT, 33, ONOFF_NA, &com_ind, &exp_c}, {"di", PRO_INT, 2, ONOFF_NA, &decl_indent, &exp_di}, {"dj", PRO_BOOL, false, ON, &ljust_decl, &exp_dj}, {"d", PRO_INT, 0, ONOFF_NA, &unindent_displace, &exp_d}, {"eei", PRO_BOOL, false, ON, &extra_expression_indent, &exp_eei}, {"ei", PRO_BOOL, true, ON, &else_if, &exp_ei}, {"fbc", PRO_FONT, 0, ONOFF_NA, (int *) &blkcomf, &exp_fbc}, {"fbx", PRO_FONT, 0, ONOFF_NA, (int *) &boxcomf, &exp_fbx}, {"fb", PRO_FONT, 0, ONOFF_NA, (int *) &bodyf, &exp_fb}, {"fc1", PRO_BOOL, true, ON, &format_col1_comments, &exp_fc1}, {"fca", PRO_BOOL, false, ON, &format_comments, &exp_fca}, {"fc", PRO_FONT, 0, ONOFF_NA, (int *) &scomf, &exp_fc}, {"fk", PRO_FONT, 0, ONOFF_NA, (int *) &keywordf, &exp_fk}, {"fs", PRO_FONT, 0, ONOFF_NA, (int *) &stringf, &exp_fs}, /* This is now the default. */ {"gnu", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-bl\0-ncdb\0-cs\0-nce\0-di2\0-ndj\0\ -ei\0-nfc1\0-i2\0-ip5\0-lp\0-pcs\0-nps\0-psl\0-nsc\0-nsob\0-bli4\0\ -cp1\0-nfca\0", &exp_gnu}, {"ip", PRO_INT, 5, ON, &indent_parameters, &exp_ip}, {"i", PRO_INT, 2, ONOFF_NA, &ind_size, &exp_i}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbad\0-bap\0-nbbb\0-nbc\0-br\0-c33\0-cd33\0-ncdb\0-ce\0\ -ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i4\0-ip0\0-l75\0-lp\0-npcs\0-npsl\0-cs\0\ -nsc\0-nsc\0-nsob\0-nfca\0-cp33\0-nss\0", &exp_kr}, {"lc", PRO_INT, 0, ONOFF_NA, &block_comment_max_col, &exp_lc}, {"lps", PRO_BOOL, true, ON, &leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens, &exp_lp}, {"l", PRO_INT, 78, ONOFF_NA, &max_col, &exp_l}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation, &exp_bacc}, {"nbadp", PRO_BOOL, false, OFF, &blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations, &exp_bad}, {"nbap", PRO_BOOL, true, OFF, &blanklines_after_procs, &exp_bap}, {"nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments, &exp_bbb}, {"nbc", PRO_BOOL, true, ON, &leave_comma, &exp_bc}, {"nbs", PRO_BOOL, false, OFF, &blank_after_sizeof, &exp_bs}, {"ncdb", PRO_BOOL, false, OFF, &comment_delimiter_on_blankline, &exp_cdb}, {"nce", PRO_BOOL, false, OFF, &cuddle_else, &exp_ce}, {"ncs", PRO_BOOL, true, OFF, &cast_space, &exp_cs}, {"ndj", PRO_BOOL, false, OFF, &ljust_decl, &exp_dj}, {"neei", PRO_BOOL, false, OFF, &extra_expression_indent, &exp_eei}, {"nei", PRO_BOOL, true, OFF, &else_if, &exp_ei}, {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments, &exp_fc1}, {"nfca", PRO_BOOL, false, OFF, &format_comments, &exp_fca}, {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0\0", &exp_nip}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens, &exp_lp}, {"npcs", PRO_BOOL, true, OFF, &proc_calls_space, &exp_pcs}, {"npro", PRO_IGN, 0, ONOFF_NA, 0, &exp_pro}, {"npsl", PRO_BOOL, true, OFF, &procnames_start_line, &exp_psl}, {"nps", PRO_BOOL, false, OFF, &pointer_as_binop, &exp_ps}, {"nsc", PRO_BOOL, false, OFF, &star_comment_cont, &exp_sc}, {"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines, &exp_sob}, {"nss", PRO_BOOL, false, OFF, &space_sp_semicolon, &exp_ss}, {"nv", PRO_BOOL, false, OFF, &verbose, &exp_v}, {"orig", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-nbap\0-nbad\0-nbbb\0-bc\0-br\0-c33\0-cd33\0-cdb\0-ce\0-ci4\0\ -cli0\0-cp33\0-di16\0-fc1\0-fca\0-i4\0-ip4\0-l75\0-lp\0\ -npcs\0-psl\0-sc\0-nsob\0-nss\0-ts8\0", &exp_orig}, {"o", PRO_BOOL, false, ON, &expect_output_file, &expect_output_file}, {"pcs", PRO_BOOL, true, ON, &proc_calls_space, &exp_pcs}, {"psl", PRO_BOOL, true, ON, &procnames_start_line, &exp_psl}, {"ps", PRO_BOOL, false, ON, &pointer_as_binop, &exp_ps}, {"sc", PRO_BOOL, false, ON, &star_comment_cont, &exp_sc}, {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines, &exp_sob}, {"ss", PRO_BOOL, false, ON, &space_sp_semicolon, &exp_ss}, {"st", PRO_BOOL, false, ON, &use_stdout, &exp_st}, {"troff", PRO_BOOL, false, ON, &troff, &exp_troff}, {"ts", PRO_INT, 8, ONOFF_NA, &tabsize, &exp_ts}, {"version", PRO_PRSTRING, 0, ONOFF_NA, (int *) VERSION_STRING, &exp_version}, {"v", PRO_BOOL, false, ON, &verbose, &exp_v}, /* Signify end of structure. */ {0, PRO_IGN, 0, ONOFF_NA, 0, 0} }; #endif /* GNU defaults */ struct long_option_conversion { char *long_name; char *short_name; }; struct long_option_conversion option_conversions[] = { {"blank-lines-after-ifdefs", "bacc"}, {"blank-lines-after-procedure-declarations", "badp"}, {"blank-lines-after-declarations", "bad"}, {"blank-lines-after-procedures", "bap"}, {"blank-lines-after-block-comments", "bbb"}, {"blank-lines-after-commas", "bc"}, {"brace-indent", "bli"}, {"braces-after-if-line", "bl"}, {"braces-on-if-line", "br"}, {"Bill-Shannon", "bs"}, {"blank-before-sizeof", "bs"}, {"comment-delimiters-on-blank-lines", "cdb"}, {"declaration-comment-column", "cd"}, {"cuddle-else", "ce"}, {"continuation-indentation", "ci"}, {"case-indentation", "cli"}, {"else-endif-column", "cp"}, {"space-after-cast", "cs"}, {"comment-indentation", "c"}, {"declaration-indentation", "di"}, {"left-justify-declarations", "dj"}, {"line-comments-indentation", "d"}, {"extra-expression-indentation", "eei"}, {"else-if", "ei"}, {"*", "fbc"}, {"*", "fbx"}, {"*", "fb"}, {"format-first-column-comments", "fc1"}, {"format-all-comments", "fca"}, {"*", "fc"}, {"*", "fk"}, {"*", "fs"}, {"gnu-style", "gnu"}, {"parameter-indentation", "ip"}, {"indentation-level", "i"}, {"indent-level", "i"}, {"k-and-r-style", "kr"}, {"kernighan-and-ritchie-style", "kr"}, {"kernighan-and-ritchie", "kr"}, {"*", "lc"}, {"continue-at-parentheses", "lp"}, {"leave-preprocessor-space", "lps"}, {"line-length", "l"}, {"no-blank-lines-after-ifdefs", "nbacc"}, {"no-blank-lines-after-procedure-declarations", "nbadp"}, {"no-blank-lines-after-declarations", "nbad"}, {"no-blank-lines-after-procedures", "nbap"}, {"no-blank-lines-after-block-comments", "nbbb"}, {"no-blank-lines-after-commas", "nbc"}, {"no-Bill-Shannon", "nbs"}, {"no-blank-before-sizeof", "nbs"}, {"no-comment-delimiters-on-blank-lines", "ncdb"}, {"dont-cuddle-else", "nce"}, {"no-space-after-casts", "ncs"}, {"dont-left-justify-declarations", "ndj"}, {"no-extra-expression-indentation", "neei"}, {"no-else-if", "nei"}, {"dont-format-first-column-comments", "nfc1"}, {"dont-format-comments", "nfca"}, {"no-parameter-indentation", "nip"}, {"dont-indent-parameters", "nip"}, {"dont-line-up-parentheses", "nlp"}, {"no-space-after-function-call-names", "npcs"}, {"ignore-profile", "npro"}, {"dont-break-procedure-type", "npsl"}, {"*", "nps"}, {"dont-star-comments", "nsc"}, {"leave-optional-blank-lines", "nsob"}, {"dont-space-special-semicolon", "nss"}, {"no-verbosity", "nv"}, {"output", "o"}, {"output-file", "o"}, {"original", "orig"}, {"original-style", "orig"}, {"berkeley-style", "orig"}, {"berkeley", "orig"}, {"space-after-procedure-calls", "pcs"}, {"procnames-start-lines", "psl"}, {"pointer-as-binary-op", "ps"}, {"start-left-side-of-comments", "sc"}, {"swallow-optional-blank-lines", "sob"}, {"space-special-semicolon", "ss"}, {"standard-output", "st"}, {"troff-formatting", "troff"}, {"tab-size", "ts"}, {"version", "version"}, {"verbose", "v"}, {0, 0}, }; /* S1 should be a string. S2 should be a string, perhaps followed by an argument. Compare the two, returning true if they are equal, and if they are equal set *START_PARAM to point to the argument in S2. */ static int eqin (s1, s2, start_param) register char *s1; register char *s2; char **start_param; { while (*s1) { if (*s1++ != *s2++) return (false); } *start_param = s2; return (true); } /* Set the defaults. */ void set_defaults () { register struct pro *p; for (p = pro; p->p_name; p++) if (p->p_type == PRO_BOOL || p->p_type == PRO_INT) *p->p_obj = p->p_default; } /* Stings which can prefix an option, longest first. */ static char *option_prefixes[] = { "--", "-", "+", 0 }; static int option_prefix (arg) char *arg; { register char **prefixes = option_prefixes; register char *this_prefix, *argp; do { this_prefix = *prefixes; argp = arg; while (*this_prefix == *argp) { this_prefix++; argp++; } if (*this_prefix == '\0') return this_prefix - *prefixes; } while (*++prefixes); return 0; } /* Process an option ARG (e.g. "-l60"). EXPLICIT should be nonzero iff the argument is being explicitly specified (as opposed to being taken from a PRO_SETTINGS group of settings). */ int set_option (option, param, explicit) char *option, *param; int explicit; { struct pro *p = pro; char *param_start; register int option_length, val; val = 0; option_length = option_prefix (option); if (option_length > 0) { if (option_length == 1 && *option == '-') /* Short option prefix */ { option++; for (p = pro; p->p_name; p++) if (*p->p_name == *option && eqin (p->p_name, option, ¶m_start)) goto found; } else /* Long prefix */ { register struct long_option_conversion *o = option_conversions; option += option_length; while (o->short_name) { if (eqin (o->long_name, option, ¶m_start)) break; o++; } /* Searching twice means we don't have to keep the two tables in sync. */ if (o->short_name) for (p = pro; p->p_name; p++) if (!strcmp (p->p_name, o->short_name)) goto found; } } fprintf (stderr, "indent: unknown option \"%s\"\n", option - 1); exit (1); arg_missing: fprintf (stderr, "indent: missing argument to parameter %s\n", option); exit (1); found: /* If the parameter has been explicitly specified, we don't want a group of bundled settings to override the explicit setting. */ if (verbose) fprintf (stderr, "option: %s\n", p->p_name); if (explicit || !*(p->p_explicit)) { if (explicit) *(p->p_explicit) = 1; switch (p->p_type) { case PRO_PRSTRING: puts ((char *) p->p_obj); exit (0); case PRO_SETTINGS: { char *t; /* current position */ t = (char *) p->p_obj; do { set_option (t, 0); /* advance to character following next NUL */ while (*t++); } while (*t); } case PRO_IGN: break; case PRO_KEY: { register char *str; if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; str = (char *) xmalloc (strlen (param_start) + 1); strcpy (str, param_start); addkey (str, rw_decl); } break; case PRO_BOOL: if (p->p_special == OFF) *p->p_obj = false; else *p->p_obj = true; break; case PRO_INT: if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; if (!isdigit (*param_start)) { fprintf (stderr, "indent: option ``%s'' requires a numeric parameter\n", option - 1); exit (1); } *p->p_obj = atoi (param_start); break; case PRO_FONT: if (*param_start == 0) if (!(param_start = param)) goto arg_missing; else val = 1; parsefont ((struct fstate *) p->p_obj, param_start); break; default: fprintf (stderr, "indent: set_option: internal error: p_type %d\n", p->p_type); exit (1); } } return val; } /* Scan the options in the file F. */ static void scan_profile (f) register FILE *f; { register int i; register char *p, *this, *next, *temp; char b0[BUFSIZ]; char b1[BUFSIZ]; next = b0; this = 0; while (1) { for (p = next; (i = getc (f)) != EOF && (*p = i) > ' '; ++p); if (p != next) { *p++ = 0; if (!this) { this = b0; next = b1; continue; } if (set_option (this, next, 1)) { this = 0; next = b0; continue; } temp = this; this = next; next = temp; } else if (i == EOF) { if (this) set_option (this, 0, 1); return; } } } /* Some operating systems don't allow more than one dot in a filename. */ #if defined (ONE_DOT_PER_FILENAME) #define INDENT_PROFILE "indent.pro" #else #define INDENT_PROFILE ".indent.pro" #endif /* set_profile looks for ./.indent.pro or $HOME/.indent.pro, in that order, and reads the options given in that file. Return the path of the file read. Note that as of version 1.3, indent only reads one file. */ char * set_profile () { register FILE *f; char *fname; static char prof[] = INDENT_PROFILE; char *homedir; if ((f = fopen (INDENT_PROFILE, "r")) != NULL) { int len = strlen (INDENT_PROFILE) + 3; scan_profile (f); (void) fclose (f); fname = xmalloc (len); fname[0] = '.'; fname[1] = '/'; memcpy (&fname[2], INDENT_PROFILE, len - 3); fname[len - 1] = '\0'; return fname; } homedir = getenv ("HOME"); if (homedir) { fname = xmalloc (strlen (homedir) + 10 + sizeof prof); sprintf (fname, "%s/%s", homedir, prof); if ((f = fopen (fname, "r")) != NULL) { scan_profile (f); (void) fclose (f); return fname; } free (fname); } return 0; } indent-2.2.11/regression/input/newlines.c0000644000177400010010000000201410775646104015310 00000000000000/* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR Now here are some blank lines: IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ int some_global; /* Redistribution and use in source and binary forms are permitted permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ main () { var1 = 33; while (grop ()) { foob (); turds (); } exit (); } indent-2.2.11/regression/input/sys.h0000644000177400010010000000142210775646104014311 00000000000000/* Copyright (C) 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it without restriction. 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. */ #include #ifdef DEBUG extern int debug; #endif #ifdef __STDC__ #define INLINE inline #else #define INLINE #endif struct file_buffer { char *name; int size; char *data; }; extern struct file_buffer *read_file (), *read_stdin (); /* Standard memory allocation routines. */ char *malloc (); char *realloc (); /* Similar, but abort with an error if out of memory (see globs.c). */ char *xmalloc (); char *xrealloc (); indent-2.2.11/regression/input/initializers.c0000644000177400010010000000061310775646104016175 00000000000000void foo() { char c[8] = { 0, 0, 0, 0, 1, 1, 1, 1 }; char c[8] = { /* comment */ 0, 0, 0, 0, 1, 1, 1, 1 }; char c[8] = { /* mult-line comment */ 0, 0, 0, 0, 1, 1, 1, 1 }; static unsigned int current_flags[4] = {0, 0, 1, 2 }; static unsigned int current_flags[4] = {0, CHFL_CHANOP | CHFL_VOICE, CHFL_VOICE, CHFL_CHANOP }; } indent-2.2.11/regression/input/already-starred.c0000644000177400010010000000066310775646104016557 00000000000000 /* * Instance XV_KEY_DATA key. An instance is a set of related * user interface objects. A pointer to an object's instance * is stored under this key in every object. This must be a * global variable. */ /* * Another comment. */ main(int argc, char **argv) { /* * Initialize XView. */ xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); INSTANCE = xv_unique_key(); } indent-2.2.11/regression/input/no-newline3.c0000644000177400010010000000011610775646104015623 00000000000000#if 0 main () { /* first comment */ } #endif /* Does this break indent? */indent-2.2.11/regression/input/unary.c0000644000177400010010000000003610775646104014624 00000000000000foo () { return (int) -1; } indent-2.2.11/regression/input/long-comm.c0000644000177400010010000000024610775646104015361 00000000000000/** this is a test where the text goes over many lines, but where also there is some formatted ascii text, which should NOT b e indented at all. */ indent-2.2.11/regression/input/elipsis-attribute.c0000644000177400010010000000032610775646104017141 00000000000000extern void sendto_one(aClient *to, char *pattern, ...) __attribute__ ((format(printf, 2, 3))); int f(char *m, ...) __attribute__ ((format(printf, 1, 2))); void sendto_one(aClient *to, char *pattern, ...) { } indent-2.2.11/regression/input/braces.c0000644000177400010010000000034410775646104014727 00000000000000 static int func(int i, int j) { int i; i = 10; if (i == 6) { i++; } else { i--; } } struct xyz { int i; int j; } iii; typdef struct { int i; int j; } iii_st; indent-2.2.11/regression/input/tabs.c0000644000177400010010000000041310775646104014416 00000000000000 /* Here is a column 1 comment with tab tab and tab In the columns: ^ ^ ^ those */ main () { int i = 33; /* Here there everywhere here.. and that's it tab ^--------^------------^-----------^------------- */ foo (i); } indent-2.2.11/regression/input/cp-indent.c0000644000177400010010000000026310775646104015351 00000000000000int foo() { if (long_function_name(a, #if FOO /* comment1 */ b)) #else /* comment2 */ c, d)) #endif /* comment3 */ ++i; return 0; } indent-2.2.11/regression/input/backup.h0000644000177400010010000000256510775646104014751 00000000000000 /* backup.h -- declarations for making Emacs style backup file names Copyright (C) 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it without restriction. 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. */ /* When to make backup files. Analagous to 'version-control' in Emacs. */ enum backup_mode { /* Uninitialized or indeterminate value */ unknown, /* Never make backups. */ none, /* Make simple backups of every file. */ simple, /* Make numbered backups of files that already have numbered backups, and simple backups of the others. */ numbered_existing, /* Make numbered backups of every file. */ numbered }; struct version_control_values { enum backup_mode value; char *name; }; /* Determine the value of `version_control' by looking in the environment variable "VERSION_CONTROL". Defaults to numbered_existing. */ extern enum backup_mode version_control_value (); /* Initialize information used in determining backup filenames. */ extern void initialize_backups (); /* Make a backup copy of FILE, taking into account version-control. See the description at the beginning of the file for details. */ extern void make_backup (); indent-2.2.11/regression/input/cplus-one.c0000644000177400010010000000004510775646104015373 00000000000000// One line cplus comment, no newlineindent-2.2.11/regression/input/ncs-on-return.c0000644000177400010010000000011411041665106016163 00000000000000unsigned char *cp = (unsigned char *) ptr; int foo() { return (int) n; } indent-2.2.11/regression/input/elif.c0000644000177400010010000000057610775646104014416 00000000000000void Fnc() { int i, j, k; int Sum = 0; #ifdef t1 for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) for (k = 0; k < 10; k++) Sum += i * 100 + j * 10 + k; #elif defined(t2) for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) Sum += i * 10 + j; #else for (i = 0; i < 10; i++) { Sum += i; #endif } printf("%d\n", Sum); } indent-2.2.11/regression/input/method.c0000644000177400010010000000003610775646104014746 00000000000000int q::s () { int i; } indent-2.2.11/regression/input/ncs.c0000644000177400010010000000002311041664626014241 00000000000000char c = (char) 1; indent-2.2.11/regression/input/macro.c0000644000177400010010000000011410775646104014564 00000000000000int i = MACRO(int); struct X x = { MACRO(int) }; void foo() { MACRO(int); } indent-2.2.11/regression/input/cdb.c0000644000177400010010000000020610775646104014215 00000000000000int foo; /* This is a single line comment */ /* this is a column zero real single line comment */ /* this is elgible for cdb. */ indent-2.2.11/regression/input/indent_globs.h0000644000177400010010000004106210775646104016146 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. @(#)indent_globs.h 5.7 (Berkeley) 9/15/88 */ #ifdef DEBUG extern int debug; #endif #include #if 0 /* Some systems don't have string.h. If there are any places where indent depends on the return type of strcpy and friends, declare the return type (e.g. "char *strcpy();"). */ #include #endif /* 0 */ struct file_buffer { char *name; int size; char *data; }; extern struct file_buffer *read_file (), *read_stdin (); extern void make_backup (); /* Standard memory allocation routines. */ char *malloc (); char *realloc (); /* Do the same thing, but abort with an error if out of memory (see globs.c). */ char *xmalloc (); char *xrealloc (); char *memcpy (); #define BACKSLASH '\\' #define label_offset 2 /* number of levels a label is placed to left of code */ /* Initial size of internal buffers (they are extended as necessary). */ #define bufsize 1000 enum codes { code_eof = 0, /* end of file */ newline, lparen, /* '(' or '['. Also '{' in an initialization. */ rparen, /* ')' or ']'. Also '}' in an initialization. */ unary_op, binary_op, postop, question, casestmt, colon, semicolon, lbrace, rbrace, ident, /* string or char literal, identifier, number */ comma, comment, swstmt, preesc, /* '#'. */ form_feed, decl, sp_paren, /* if, for, or while token */ sp_nparen, ifstmt, whilestmt, forstmt, stmt, stmtl, elselit, dolit, dohead, dostmt, ifhead, elsehead, period }; enum rwcodes { rw_none, rw_break, rw_switch, rw_case, rw_struct_like, /* struct, enum, union */ rw_decl, rw_sp_paren, /* if, while, for */ rw_sp_nparen, /* do, else */ rw_sizeof, rw_return }; #define false 0 #define true 1 /* Name of input file. */ extern char *in_name; extern char *in_prog; /* pointer to the null-terminated input program */ /* Point to the position in the input program which we are currently looking at. */ extern char *in_prog_pos; /* Point to the start of the current line. */ extern char *cur_line; /* Size of the input program, not including the ' \n\0' we add at the end */ extern unsigned int in_prog_size; extern FILE *output; /* the output file */ #define check_code_size \ if (e_code >= l_code) { \ register nsize = l_code-s_code+400; \ codebuf = (char *) realloc(codebuf, nsize); \ e_code = codebuf + (e_code-s_code) + 1; \ l_code = codebuf + nsize - 5; \ s_code = codebuf + 1; \ } #define check_com_size \ if (e_com >= l_com) { \ register nsize = l_com-s_com+400; \ combuf = (char *) realloc(combuf, nsize); \ e_com = combuf + (e_com-s_com) + 1; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ } #define check_lab_size \ if (e_lab >= l_lab) { \ register nsize = l_lab-s_lab+400; \ labbuf = (char *) realloc(labbuf, nsize); \ e_lab = labbuf + (e_lab-s_lab) + 1; \ l_lab = labbuf + nsize - 5; \ s_lab = labbuf + 1; \ } extern char *labbuf; /* buffer for label */ extern char *s_lab; /* start ... */ extern char *e_lab; /* .. and end of stored label */ extern char *l_lab; /* limit of label buffer */ extern char *codebuf; /* buffer for code section */ extern char *s_code; /* start ... */ extern char *e_code; /* .. and end of stored code */ extern char *l_code; /* limit of code section */ extern char *combuf; /* buffer for comments */ extern char *s_com; /* start ... */ extern char *e_com; /* ... and end of stored comments */ extern char *l_com; /* limit of comment buffer */ extern char *buf_ptr; /* ptr to next character to be taken from in_buffer */ extern char *buf_end; /* ptr to first after last char in in_buffer */ /* pointer to the token that lexi() has just found */ extern char *token; /* points to the first char after the end of token */ extern char *token_end; /* Functions from lexi.c */ enum codes lexi (); /* Used to keep track of buffers. */ struct buf { char *ptr; /* points to the start of the buffer */ char *end; /* points to the character beyond the last one (e.g. is equal to ptr if the buffer is empty). */ int size; /* how many chars are currently allocated. */ }; /* Insure that BUFSTRUC has at least REQ more chars left, if not extend it. Note: This may change bufstruc.ptr. */ #define need_chars(bufstruc, req) \ if ((bufstruc.end - bufstruc.ptr + (req)) >= bufstruc.size) \ {\ int cur_chars = bufstruc.end - bufstruc.ptr;\ bufstruc.size *= 2;\ bufstruc.ptr = xrealloc(bufstruc.ptr,bufstruc.size);\ bufstruc.end = bufstruc.ptr + cur_chars;\ } /* Buffer in which to save a comment which occurs between an if(), while(), etc., and the statement following it. Note: the fact that we point into this buffer, and that we might realloc() it (via the need_chars macro) is a bad thing (since when the buffer is realloc'd its address might change, making any pointers into it point to garbage), but since the filling of the buffer (hence the need_chars) and the using of the buffer (where buf_ptr points into it) occur at different times, we can get away with it (it would not be trivial to fix). */ extern struct buf save_com; extern char *bp_save; /* saved value of buf_ptr when taking input from save_com */ extern char *be_save; /* similarly saved value of buf_end */ extern int pointer_as_binop; extern int blanklines_after_declarations; extern int blanklines_before_blockcomments; extern int blanklines_after_procs; extern int blanklines_around_conditional_compilation; extern int swallow_optional_blanklines; extern int n_real_blanklines; extern int prefix_blankline_requested; extern int postfix_blankline_requested; extern int break_comma; /* when true and not in parens, break after a comma */ extern int found_err; /* flag set in diag() on error */ extern int else_or_endif; extern int di_stack_alloc; extern int *di_stack; /* number of spaces to indent braces from the suround if, while, etc. in -bl (bype_2 == 0) code */ extern int brace_indent; extern int btype_2; /* when true, brace should be on same line as if, while, etc */ /* If true, a space is inserted between if, while, or for, and a semicolon for example while (*p++ == ' ') ; */ extern int space_sp_semicolon; /* True if a #else or #endif has been encountered. */ extern int else_or_endif; extern int case_ind; /* indentation level to be used for a "case n:" in spaces */ extern int code_lines; /* count of lines with code */ /* the number of comments processed, set by pr_comment. */ extern int out_coms; extern int out_lines; /* the number of lines written, set by dump_line */ extern int com_lines; /* the number of lines with comments, set by dump_line */ extern int had_eof; /* set to true when input is exhausted */ extern int line_no; /* the current line number. */ extern int max_col; /* the maximum allowable line length */ extern int verbose; /* when true, non-essential error messages are printed */ extern int cuddle_else; /* true if else should cuddle up to '}' */ extern int star_comment_cont; /* true iff comment continuation lines should have stars at the beginning of each line. */ extern int comment_delimiter_on_blankline; extern int troff; /* true iff were generating troff input */ extern int procnames_start_line;/* if true, the names of procedures being defined get placed in column 1 (ie. a newline is placed between the type of the procedure and its name) */ extern int expect_output_file; /* Means "-o" was specified. */ extern int proc_calls_space; /* If true, procedure calls look like: foo (bar) rather than foo(bar) */ extern int cast_space; /* If true, casts look like: r * (char *) bar rather than (char *)bar */ /* If comments which start in column 1 are to be magically reformatted */ extern int format_col1_comments; /* If any comments are to be reformatted */ extern int format_comments; extern int suppress_blanklines; /* set iff following blanklines should be suppressed */ extern int continuation_indent; /* set to the indentation between the edge of code and continuation lines in spaces */ extern int lineup_to_parens; /* if true, continued code within parens will be lined up to the open paren */ /* The position that we will line the current line up with when it comes time to print it (if we are lining up to parentheses). */ extern int paren_target; /* true iff a blank should always be inserted after sizeof */ extern int Bill_Shannon; extern int blanklines_after_declarations_at_proctop; /* This is vaguely similar to blanklines_after_decla rations except that it only applies to the first set of declarations in a procedure (just after the first '{') and it causes a blank line to be generated even if there are no declarations */ extern int block_comment_max_col; extern int extra_expression_indent; /* True if continuation lines from the expression part of "if(e)", "while(e)", "for(e;e;e)" should be indented an extra tab stop so that they don't conflict with the code that follows */ /* The following are all controlled by command line switches (as are some of the things above). */ extern int leave_comma; /* if true, never break declarations after commas */ extern int decl_com_ind; /* the column in which comments after declarations should be put */ extern int case_indent; /* The distance to indent case labels from the switch statement */ extern int com_ind; /* the column in which comments to the right of code should start */ extern int decl_indent; /* column to indent declared identifiers to */ extern int ljust_decl; /* true if declarations should be left justified */ extern int unindent_displace; /* comments not to the right of code will be placed this many indentation levels to the left of code */ extern int else_if; /* True iff else if pairs should be handled specially */ /* Number of spaces to indent parameters. */ extern int indent_parameters; /* The size of one indentation level in spaces. */ extern int ind_size; /* The number of columns a tab character generates. */ extern int tabsize; /* Nonzero if we should use standard input/output when files are not explicitly specified. */ extern int use_stdinout; /* -troff font state information */ struct fstate { char font[4]; char size; int allcaps:1; }; char *chfont (); extern struct fstate keywordf, /* keyword font */ stringf, /* string font */ boxcomf, /* Box comment font */ blkcomf, /* Block comment font */ scomf, /* Same line comment font */ bodyf; /* major body font */ /* This structure contains information relating to the state of parsing the code. The difference is that the state is saved on #if and restored on #else. */ struct parser_state { struct parser_state *next; enum codes last_token; struct fstate cfont; /* Current font */ /* This is the parsers stack, and the current allocated size. */ enum codes *p_stack; int p_stack_size; /* This stack stores indentation levels */ /* Currently allocated size is stored in p_stack_size. */ int *il; /* If the last token was an ident and is a reserved word, remember the type. */ enum rwcodes last_rw; /* Used to store case stmt indentation levels. */ /* Currently allocated size is stored in p_stack_size. */ int *cstk; /* Pointer to the top of stack of the p_stack, il and cstk arrays. */ int tos; int box_com; /* set to true when we are in a "boxed" comment. In that case, the first non-blank char should be lined up with the / in /* */ /* Shift comments by this many columns. */ int comment_delta; /* Value of comment_delta for the following line. */ int n_comment_delta; int cast_mask; /* indicates which close parens close off casts */ /* A bit for each paren level, set if the open paren was in a context which indicates that this pair of parentheses is not a cast. */ int noncast_mask; int sizeof_mask; /* indicates which close parens close off sizeof''s */ int block_init; /* true iff inside a block initialization */ int block_init_level; /* The level of brace nesting in an initialization */ int last_nl; /* this is true if the last thing scanned was a newline */ int in_or_st; /* Will be true iff there has been a declarator (e.g. int or char) and no left paren since the last semicolon. When true, a '{' is starting a structure definition or an initialization list */ int bl_line; /* set to 1 by dump_line if the line is blank */ int col_1; /* set to true if the last token started in column 1 */ int com_col; /* this is the column in which the current coment should start */ int dec_nest; /* current nesting level for structure or init */ int decl_on_line; /* set to true if this line of code has part of a declaration on it */ int i_l_follow; /* the level in spaces to which ind_level should be set after the current line is printed */ int in_decl; /* set to true when we are in a declaration stmt. The processing of braces is then slightly different */ int in_stmt; /* set to 1 while in a stmt */ int ind_level; /* the current indentation level in spaces */ int ind_stmt; /* set to 1 if next line should have an extra indentation level because we are in the middle of a stmt */ int last_u_d; /* set to true after scanning a token which forces a following operator to be unary */ int p_l_follow; /* used to remember how to indent following statement */ int paren_level; /* parenthesization level. used to indent within stmts */ int paren_depth; /* Depth of paren nesting anywhere. */ /* Column positions of paren at each level. If positive, it contains just the number of characters of code on the line up to and including the right parenthesis character. If negative, it contains the opposite of the actual level of indentation in characters (that is, the indentation of the line has been added to the number of characters and the sign has been reversed to indicate that this has been done). */ short *paren_indents; /* column positions of each paren */ int paren_indents_size; /* Currently allocated size. */ int pcase; /* set to 1 if the current line label is a case. It is printed differently from a regular label */ int search_brace; /* set to true by parse when it is necessary to buffer up all info up to the start of a stmt after an if, while, etc */ int use_ff; /* set to one if the current line should be terminated with a form feed */ int want_blank; /* set to true when the following token should be prefixed by a blank. (Said prefixing is ignored in some cases.) */ int its_a_keyword; int sizeof_keyword; int dumped_decl_indent; int in_parameter_declaration; char *procname; /* The name of the current procedure */ char *procname_end; /* One char past the last one in procname */ int just_saw_decl; }; /* All manipulations of the parser state occur at the top of stack (tos). A stack is kept for conditional compilation (unrelated to the p_stack, il, & cstk stacks)--it is implemented as a linked list via the next field. */ extern struct parser_state *parser_state_tos; /* The column in which comments to the right of #else and #endif should start. */ extern int else_endif_col; indent-2.2.11/regression/input/no-newline2.c0000644000177400010010000000006510775646104015625 00000000000000#if 0 main () {} #endif /* Does this break indent? */indent-2.2.11/regression/input/if-decl-else-decl.c0000644000177400010010000000010010775646104016614 00000000000000#if 1 void f(some_t s, int b) #else void f(some_t s) #endif { } indent-2.2.11/regression/input/version.h0000644000177400010010000000066410775646104015167 00000000000000/* Originally based on Berkeley indent 5.11 (9/15/88). */ /* kingdon merged in a bunch of changes from the BSD version of Sep 89, but it wouldn't really be correct to say that GNU indent is based on the new BSD stuff either. */ /* Despite the continued presence of the original copyright, I think this version is sufficiently different to simply call it GNU indent. jla 11/91 */ #define VERSION_STRING "GNU indent 1.5" indent-2.2.11/regression/input/bbreak.c0000644000177400010010000000020710775646104014714 00000000000000void main (void) { if ( (foofoofoo.barbarbar.bazbazbazbaz->foobar.foobaz.bazzbar->foobar.barbaz. bazfoo)) a = 1; } indent-2.2.11/regression/input/comments4.c0000644000177400010010000000026410775646104015402 00000000000000void foo() { /* first comment */ /* second comment */ /* third comment */ /* * fourth comment */ /* ** fifth comment * */ /* * sixth comment * */ } indent-2.2.11/regression/input/minus_predecrement.c0000644000177400010010000000004511212731270017340 00000000000000int foo(int a) { return - --a; } indent-2.2.11/regression/input/one-line-1.c0000644000177400010010000000006610775646104015335 00000000000000main (){ if (foo) { bar (33); grop (); } return -1; } indent-2.2.11/regression/input/meta-indent.c0000644000177400010010000000031410775646104015672 00000000000000lw5100_add_to_field_list(object, node, row) GCH_Object *object; CMM_NODE *node; int row; { Node_data *data; /* a000345 */ /* strcpy_fill(field_name_string, data->name, ' ', 43, NULL, TRUE); */ } indent-2.2.11/regression/input/kr-proc-decls.c0000644000177400010010000000015610775646104016136 00000000000000 int toome(); int metoo(); void *bar(); void * rab (); char * foo() { a++; } char eatme() { foo(); } indent-2.2.11/regression/input/one-line-2.c0000644000177400010010000000007110775646104015332 00000000000000main (){ while (foo) { bar (33); grop (); } return -1; } indent-2.2.11/regression/input/case-label.c0000644000177400010010000000024510775646104015460 00000000000000 void bar (int foo) { switch (foo) { case 0: abort (); break; case 1: fuckme (); break; default: abort (); } } indent-2.2.11/regression/input/on-off-2.c0000644000177400010010000000057510775646104015021 00000000000000/* Testing *INDENT-ON* and *INDENT-OFF* controls comments */ // *INDENT-ON* // *INDENT-OFF* main(int argc, char **argv) { char *foo; puts(foo); } grunt(int argc, char **argv { char *foo; puts(foo); } /* *INDENT-ON* */ /* shouldn *INDENT-ON* */ frobp (int argc, char **argv) { char *foo; while (barl) { printf ("marglefrosh"); } puts(foo); } indent-2.2.11/regression/input/boxed.c0000644000177400010010000000450610775646104014575 00000000000000/****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ /*-------------------------------------------------------------------------. | For a given SIDE, turn original input file in another one, in which each | | word is on one line. | `-------------------------------------------------------------------------*/ int global; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ int barof; /****************************************************************** * * * Here is a nice big boxed comment. Enjoy it!! file fill fil * * * ******************************************************************/ main () { printf ("Eat me\n"); } /* Les boites de Francois */ /*====================================================================\ | Note that Standard Input must be associated to a virtual terminal. | | Further, it must be currently displayed for any sound to occur. | \====================================================================*/ /* Note that Standard Input must be associated to a virtual terminal. */ /* Further, it must be currently displayed for any sound to occur. */ /* ------------------------------------------------------------------- */ sfou () { while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } /************************************** * Another woeird boxed comment * * * **************************************/ i = 33; while (foo) { printf ("Save me from indent"); printf ("What idiot wrote this program?"); } } indent-2.2.11/regression/input/parse.c0000644000177400010010000004327110775646104014610 00000000000000/* Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sys.h" #include "indent.h" struct parser_state *parser_state_tos; #define INITIAL_BUFFER_SIZE 1000 #define INITIAL_STACK_SIZE 2 void init_parser () { parser_state_tos = (struct parser_state *) xmalloc (sizeof (struct parser_state)); parser_state_tos->p_stack_size = INITIAL_STACK_SIZE; parser_state_tos->p_stack = (enum codes *) xmalloc (INITIAL_STACK_SIZE * sizeof (enum codes)); parser_state_tos->il = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int)); parser_state_tos->cstk = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int)); parser_state_tos->paren_indents = (short *) xmalloc (sizeof (short)); /* Although these are supposed to grow if we reach the end, I can find no place in the code which does this. */ combuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); labbuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); codebuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); save_com.size = INITIAL_BUFFER_SIZE; save_com.end = save_com.ptr = xmalloc (save_com.size); di_stack_alloc = 2; di_stack = (int *) xmalloc (di_stack_alloc * sizeof (*di_stack)); } void reset_parser () { parser_state_tos->next = 0; parser_state_tos->tos = 0; parser_state_tos->paren_indents_size = 1; parser_state_tos->p_stack[0] = stmt; /* this is the parser's stack */ parser_state_tos->last_nl = true; /* this is true if the last thing scanned was a newline */ parser_state_tos->last_token = semicolon; parser_state_tos->box_com = false; parser_state_tos->comment_delta = 0; parser_state_tos->n_comment_delta = 0; parser_state_tos->cast_mask = 0; parser_state_tos->noncast_mask = 0; parser_state_tos->sizeof_mask = 0; parser_state_tos->block_init = false; parser_state_tos->block_init_level = 0; parser_state_tos->col_1 = false; parser_state_tos->com_col = 0; parser_state_tos->dec_nest = 0; parser_state_tos->i_l_follow = 0; parser_state_tos->ind_level = 0; parser_state_tos->last_u_d = false; parser_state_tos->p_l_follow = 0; parser_state_tos->paren_level = 0; parser_state_tos->paren_depth = 0; parser_state_tos->search_brace = false; parser_state_tos->use_ff = false; parser_state_tos->its_a_keyword = false; parser_state_tos->sizeof_keyword = false; parser_state_tos->dumped_decl_indent = false; parser_state_tos->in_parameter_declaration = false; parser_state_tos->just_saw_decl = false; parser_state_tos->in_decl = false; parser_state_tos->decl_on_line = false; parser_state_tos->in_or_st = false; parser_state_tos->bl_line = true; parser_state_tos->want_blank = false; parser_state_tos->in_stmt = false; parser_state_tos->ind_stmt = false; parser_state_tos->procname = "\0"; parser_state_tos->procname_end = "\0"; parser_state_tos->pcase = false; parser_state_tos->dec_nest = 0; di_stack[parser_state_tos->dec_nest] = 0; l_com = combuf + INITIAL_BUFFER_SIZE - 5; l_lab = labbuf + INITIAL_BUFFER_SIZE - 5; l_code = codebuf + INITIAL_BUFFER_SIZE - 5; combuf[0] = codebuf[0] = labbuf[0] = ' '; combuf[1] = codebuf[1] = labbuf[1] = '\0'; else_if = 1; else_or_endif = false; s_lab = e_lab = labbuf + 1; s_code = e_code = codebuf + 1; s_com = e_com = combuf + 1; line_no = 1; had_eof = false; break_comma = false; bp_save = 0; be_save = 0; } /* like ++parser_state_tos->tos but checks for stack overflow and extends stack if necessary. */ static int inc_pstack () { if (++parser_state_tos->tos >= parser_state_tos->p_stack_size) { parser_state_tos->p_stack_size *= 2; parser_state_tos->p_stack = (enum codes *) xrealloc (parser_state_tos->p_stack, parser_state_tos->p_stack_size * sizeof (enum codes)); parser_state_tos->il = (int *) xrealloc (parser_state_tos->il, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->cstk = (int *) xrealloc (parser_state_tos->cstk, parser_state_tos->p_stack_size * sizeof (int)); } return parser_state_tos->tos; } #ifdef DEBUG static char **debug_symbol_strings; void debug_init () { int size = ((int) period + 4) * sizeof (char *); debug_symbol_strings = (char **) xmalloc (size); debug_symbol_strings[code_eof] = "code_eof"; debug_symbol_strings[newline] = "newline"; debug_symbol_strings[lparen] = "lparen"; debug_symbol_strings[rparen] = "rparen"; debug_symbol_strings[unary_op] = "unary_op"; debug_symbol_strings[binary_op] = "binary_op"; debug_symbol_strings[postop] = "postop"; debug_symbol_strings[question] = "question"; debug_symbol_strings[casestmt] = "casestmt"; debug_symbol_strings[colon] = "colon"; debug_symbol_strings[semicolon] = "semicolon"; debug_symbol_strings[lbrace] = "lbrace"; debug_symbol_strings[rbrace] = "rbrace"; debug_symbol_strings[ident] = "ident"; debug_symbol_strings[comma] = "comma"; debug_symbol_strings[comment] = "comment"; debug_symbol_strings[swstmt] = "swstmt"; debug_symbol_strings[preesc] = "preesc"; debug_symbol_strings[form_feed] = "form_feed"; debug_symbol_strings[decl] = "decl"; debug_symbol_strings[sp_paren] = "sp_paren"; debug_symbol_strings[sp_nparen] = "sp_nparen"; debug_symbol_strings[ifstmt] = "ifstmt"; debug_symbol_strings[whilestmt] = "whilestmt"; debug_symbol_strings[forstmt] = "forstmt"; debug_symbol_strings[stmt] = "stmt"; debug_symbol_strings[stmtl] = "stmtl"; debug_symbol_strings[elselit] = "elselit"; debug_symbol_strings[dolit] = "dolit"; debug_symbol_strings[dohead] = "dohead"; debug_symbol_strings[dostmt] = "dostmt"; debug_symbol_strings[ifhead] = "ifhead"; debug_symbol_strings[elsehead] = "elsehead"; debug_symbol_strings[period] = "period"; } #endif void parse (tk) enum codes tk; /* the code for the construct scanned */ { int i; #ifdef DEBUG if (debug) { if (tk >= code_eof && tk <= period) printf ("Parse: %s\n", debug_symbol_strings[tk]); else printf ("Parse: Unknown code: %d for %s\n", tk, token ? token : "NULL"); } #endif while (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && tk != elselit) { /* true if we have an if without an else */ /* apply the if(..) stmt ::= stmt reduction */ parser_state_tos->p_stack[parser_state_tos->tos] = stmt; reduce (); /* see if this allows any reduction */ } switch (tk) { /* go on and figure out what to do with the input */ case decl: /* scanned a declaration word */ parser_state_tos->search_brace = btype_2; /* indicate that following brace should be on same line */ if (parser_state_tos->p_stack[parser_state_tos->tos] != decl) { /* only put one declaration onto stack */ break_comma = true; /* while in declaration, newline should be forced after comma */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = decl; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; if (ljust_decl) { /* only do if we want left justified declarations */ parser_state_tos->ind_level = 0; for (i = parser_state_tos->tos - 1; i > 0; --i) if (parser_state_tos->p_stack[i] == decl) /* indentation is number of declaration levels deep we are times spaces per level */ parser_state_tos->ind_level += ind_size; parser_state_tos->i_l_follow = parser_state_tos->ind_level; } } break; case ifstmt: /* scanned if (...) */ if (parser_state_tos->p_stack[parser_state_tos->tos] == elsehead && else_if) /* "else if ..." */ parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; case dolit: /* 'do' */ case forstmt: /* for (...) */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = tk; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->i_l_follow += ind_size; /* subsequent statements should be indented 1 */ parser_state_tos->search_brace = btype_2; break; case lbrace: /* scanned { */ break_comma = false; /* don't break comma in an initial list */ if (parser_state_tos->p_stack[parser_state_tos->tos] == stmt || parser_state_tos->p_stack[parser_state_tos->tos] == stmtl) /* it is a random, isolated stmt group or a declaration */ parser_state_tos->i_l_follow += ind_size; else if (parser_state_tos->p_stack[parser_state_tos->tos] == decl) { parser_state_tos->i_l_follow += ind_size; if (parser_state_tos->last_rw == rw_struct_like && !btype_2 && !parser_state_tos->col_1) { parser_state_tos->ind_level += brace_indent; parser_state_tos->i_l_follow += brace_indent; } } else { if (s_code == e_code) { /* only do this if there is nothing on the line */ parser_state_tos->ind_level -= ind_size; /* it is a group as part of a while, for, etc. */ /* For -bl formatting, indent by brace_indent additional spaces e.g. if (foo == bar) { <--> brace_indent spaces (in this example, 4) */ if (!btype_2) { parser_state_tos->ind_level += brace_indent; parser_state_tos->i_l_follow += brace_indent; if (parser_state_tos->p_stack[parser_state_tos->tos] == swstmt) case_ind += brace_indent; } if (parser_state_tos->p_stack[parser_state_tos->tos] == swstmt && case_indent >= ind_size) parser_state_tos->ind_level -= ind_size; /* for a switch, brace should be two levels out from the code */ } } inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = lbrace; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; /* allow null stmt between braces */ parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; break; case whilestmt: /* scanned while (...) */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dohead) { /* it is matched with do stmt */ parser_state_tos->ind_level = parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = whilestmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level = parser_state_tos->i_l_follow; } else { /* it is a while loop */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = whilestmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; parser_state_tos->i_l_follow += ind_size; parser_state_tos->search_brace = btype_2; } break; case elselit: /* scanned an else */ if (parser_state_tos->p_stack[parser_state_tos->tos] != ifhead) diag (1, "Unmatched 'else'"); else { /* indentation for else should be same as for if */ parser_state_tos->ind_level = parser_state_tos->il[parser_state_tos->tos]; /* everything following should be in 1 level */ parser_state_tos->i_l_follow = (parser_state_tos->ind_level + ind_size); parser_state_tos->p_stack[parser_state_tos->tos] = elsehead; /* remember if with else */ parser_state_tos->search_brace = btype_2 | else_if; } break; case rbrace: /* scanned a } */ /* stack should have or */ if (parser_state_tos->p_stack[parser_state_tos->tos - 1] == lbrace) { parser_state_tos->ind_level = parser_state_tos->i_l_follow = parser_state_tos->il[--parser_state_tos->tos]; parser_state_tos->p_stack[parser_state_tos->tos] = stmt; } else diag (1, "Stmt nesting error."); break; case swstmt: /* had switch (...) */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = swstmt; parser_state_tos->cstk[parser_state_tos->tos] = case_ind; /* save current case indent level */ parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; case_ind = parser_state_tos->i_l_follow + case_indent; /* cases should be one level down from switch */ /* statements should be two levels in */ parser_state_tos->i_l_follow += case_indent + ind_size; parser_state_tos->search_brace = btype_2; break; case semicolon: /* this indicates a simple stmt */ break_comma = false; /* turn off flag to break after commas in a declaration */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dostmt) { parser_state_tos->p_stack[parser_state_tos->tos] = stmt; } else { inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; } break; default: /* this is an error */ diag (1, "Unknown code to parser"); return; } /* end of switch */ reduce (); /* see if any reduction can be done */ #ifdef DEBUG if (debug) { printf ("\nParseStack [%d]:\n", parser_state_tos->p_stack_size); for (i = 1; i <= parser_state_tos->tos; ++i) printf (" stack[%d] => stack: %d ind_level: %d\n", i, parser_state_tos->p_stack[i], parser_state_tos->il[i]); printf ("\n"); } #endif return; } /* NAME: reduce FUNCTION: Implements the reduce part of the parsing algorithm ALGORITHM: The following reductions are done. Reductions are repeated until no more are possible. Old TOS New TOS do dohead if "ifstmt" switch decl "ifelse" for while "dostmt" while On each reduction, parser_state_tos->i_l_follow (the indentation for the following line) is set to the indentation level associated with the old TOS. PARAMETERS: None RETURNS: Nothing GLOBALS: parser_state_tos->cstk parser_state_tos->i_l_follow = parser_state_tos->il parser_state_tos->p_stack = parser_state_tos->tos = CALLS: None CALLED BY: parse HISTORY: initial coding November 1976 D A Willcox of CAC */ /*----------------------------------------------*\ | REDUCTION PHASE | \*----------------------------------------------*/ reduce () { register int i; for (;;) { /* keep looping until there is nothing left to reduce */ switch (parser_state_tos->p_stack[parser_state_tos->tos]) { case stmt: switch (parser_state_tos->p_stack[parser_state_tos->tos - 1]) { case stmt: case stmtl: /* stmtl stmt or stmt stmt */ parser_state_tos->p_stack[--parser_state_tos->tos] = stmtl; break; case dolit: /* */ parser_state_tos->p_stack[--parser_state_tos->tos] = dohead; parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; break; case ifstmt: /* */ parser_state_tos->p_stack[--parser_state_tos->tos] = ifhead; for (i = parser_state_tos->tos - 1; (parser_state_tos->p_stack[i] != stmt && parser_state_tos->p_stack[i] != stmtl && parser_state_tos->p_stack[i] != lbrace); --i); parser_state_tos->i_l_follow = parser_state_tos->il[i]; /* for the time being, we will assume that there is no else on this if, and set the indentation level accordingly. If an else is scanned, it will be fixed up later */ break; case swstmt: /* */ case_ind = parser_state_tos->cstk[parser_state_tos->tos - 1]; case decl: /* finish of a declaration */ case elsehead: /* < else> */ case forstmt: /* */ case whilestmt: /* */ parser_state_tos->p_stack[--parser_state_tos->tos] = stmt; parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; break; default: /* */ return; } /* end of section for on top of stack */ break; case whilestmt: /* while (...) on top */ if (parser_state_tos->p_stack[parser_state_tos->tos - 1] == dohead) { /* it is termination of a do while */ #if 0 parser_state_tos->p_stack[--parser_state_tos->tos] = stmt; #endif parser_state_tos->p_stack[--parser_state_tos->tos] = dostmt; break; } else return; default: /* anything else on top */ return; } } } /* This kludge is called from main. It is just like parse(semicolon) except that it does not clear break_comma. Leaving break_comma alone is necessary to make sure that "int foo(), bar()" gets formatted correctly under -bc. */ INLINE void parse_lparen_in_decl () { inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; reduce (); } indent-2.2.11/regression/input/label.c0000644000177400010010000000034210775646104014545 00000000000000function() { if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; } indent-2.2.11/regression/input/lshift.c0000644000177400010010000000010510775646104014754 00000000000000main () { int size; for (size_ = 32; size_ < n; size_ <<= 1); } indent-2.2.11/regression/input/dont-line-up-parentheses.c0000644000177400010010000000040210775646104020315 00000000000000void t() { if ((really_long_variable_name_like_this = some_funct_group_create (mixer, SND_MIXER_GRP_IGAIN, igain_group_control, parameter5, parameter6, parameter7)) == NULL) error++; } indent-2.2.11/regression/input/line-count.c0000644000177400010010000000032310775646104015542 00000000000000/* 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 */ func() { /* Hello world * this is an * extra long * * multi-line * comment */ /* */ } } /* deliberate mistake to provoke error */ indent-2.2.11/regression/input/line-break-comment.c0000644000177400010010000000024210775646104017136 00000000000000void foo() { if (0) ; else if (acptr->from == one || /* ...was the one I should skip */ (lp->flags & CHFL_ZOMBIE) || IsDeaf(acptr)) continue; } indent-2.2.11/regression/input/scope.c0000644000177400010010000000007110775646104014576 00000000000000int foo(void) { if (0) { ++i; } { ++i; } } indent-2.2.11/regression/input/comments1.c0000644000177400010010000000530210775646104015375 00000000000000/* Copyright (c) 1992, Free Software Foundation, Inc. All rights reserved. Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #define label_offset 2 /* number of levels a label is placed to left of code */ int c; /* And here is another comment which occupies more than two lines. */ /* profile types */ enum profile { PRO_BOOL, /* boolean */ PRO_INT, /* integer */ PRO_FONT, /* troff font */ PRO_IGN, /* ignore it */ PRO_KEY, /* -T switch */ PRO_SETTINGS, /* bundled set of settings */ PRO_PRSTRING /* Print string and exit */ }; /* profile specials for booleans */ enum on_or_off { ONOFF_NA, /* Not applicable. Used in table for non-booleans. */ OFF, /* This option turns on the boolean variable in question. */ ON /* it turns it off */ }; void parse (tk) enum codes tk; /* the code for the construct scanned */ { int i; while (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead && tk != elselit) { /* true if we have an if without an else */ /* apply the if(..) stmt ::= stmt reduction */ parser_state_tos->p_stack[parser_state_tos->tos] = stmt; reduce (); /* see if this allows any reduction */ } switch (tk) { /* go on and figure out what to do with the input */ case decl: /* scanned a declaration word */ parser_state_tos->search_brace = btype_2; /* indicate that following brace should be on same line */ if (parser_state_tos->p_stack[parser_state_tos->tos] != decl) { /* only put one declaration onto stack */ break_comma = true; /* while in declaration, newline should be forced after comma */ inc_pstack (); } default: break; } } indent-2.2.11/regression/TEST~0000755000177400010010000003265211212746114013064 00000000000000#/bin/sh # Compare the output of ../src/indent to correct output # generated by earlier versions INDENT=../src/indent # First, make sure the executable exists if test -x $INDENT; then if test -d ./output; then echo '****' echo 'Errors remain; output directory still exists' echo '****' ls -ld ./output exit 1 fi echo -n "Regression testing " $INDENT --version echo else echo '****' echo First, you must make $INDENT echo '****' echo exit 1 fi # Code to be tested with default options EXAMPLES="do.c else.c for.c func-def.c lshift.c ncs.c \ proto.c typedef.h no-newline.c emacs-compatible.h fp.c unary.c \ struct_param.c no-newline2.c no-newline3.c wide.c goto.c" BUGS="case-label.c one-line-1.c one-line-2.c one-line-3.c \ one-line-4.c struct-decl.c sizeof-in-while.c line-break-comment.c \ macro.c enum.c elif.c nested.c wrapped-string.c minus_predecrement.c" INDENTSRC="args.c backup.h backup.c dirent_def.h globs.c indent.h \ indent.c indent_globs.h io.c lexi.c memcpy.c parse.c pr_comment.c \ sys.h version.h" mkdir output echo -n "Generating indent et al with default settings..." for i in $EXAMPLES $INDENTSRC $BUGS do $INDENT -npro input/$i -o output/$i done echo "Done." # Cases testing certain options echo -n "Generating special option examples..." SPECIALS="typedef-bug.c bug-hp.c bug-di.c newlined-parms.c indent.pro.c \ comments1.c comments1-fca.c ncs-on-return.c cs-on-return.c sob.c continue.c continue-lp.c \ kr.c struct-decl-kr.c embedded-cuddle1.c embedded-cuddle2.c kr-proc-decls.c \ bbb-test.c preesc-comment.c if-decl-else-decl.c cp-indent.c comments.c \ elipsis-attribute.c comments2.c comments3.c comments4.c brackets.c brackets33.c \ brackets34.c brackets35.c brackets36.c brackets37.c brackets38.c \ initializers.c else-if.c else-comment-br.c else-comment-bl.c \ else-comment-br-ce.c const.c case.c case-br.c scope.c scope-br.c \ comment-break.c cdb.c bbreak.c bad-break.c pre.c dont-line-up-parentheses.c \ bad-comment.c unknown-type.c unknown-type-npsl.c bug-npsl.c bug-psl.c do-cdw.c \ label.c goto-1.c goto-2.c line-count.c" ARGS="-bad" $INDENT -npro $ARGS input/bad-break.c -o output/bad-break.c $INDENT -npro $ARGS input/bad-comment.c -o output/bad-comment.c ARGS="-cdb" $INDENT -npro $ARGS input/cdb.c -o output/cdb.c ARGS="-kr" $INDENT -npro $ARGS input/kr.c -o output/kr.c $INDENT -npro $ARGS input/struct-decl.c -o output/struct-decl-kr.c $INDENT -npro $ARGS input/embedded-cuddle1.c -o output/embedded-cuddle1.c $INDENT -npro $ARGS input/embedded-cuddle2.c -o output/embedded-cuddle2.c $INDENT -npro $ARGS input/kr-proc-decls.c -o output/kr-proc-decls.c ARGS="-cli23 -bli8 -di50 -cbi1 -ci7 -i5" $INDENT -npro $ARGS input/case.c -o output/case.c $INDENT -npro $ARGS -br input/case.c -o output/case-br.c $INDENT -npro $ARGS input/scope.c -o output/scope.c $INDENT -npro $ARGS -br input/scope.c -o output/scope-br.c ARGS="-nlp -ci3 -fca" $INDENT -npro $ARGS input/continue.c -o output/continue.c ARGS="-lp" $INDENT -npro $ARGS input/continue.c -o output/continue-lp.c ARGS="-sob" $INDENT -npro $ARGS input/sob.c -o output/sob.c ARGS="-ncs -TUNCH" $INDENT -npro $ARGS input/typedef-bug.c -o output/typedef-bug.c $INDENT -npro $ARGS input/ncs-on-return.c -o output/ncs-on-return.c ARGS="-cs" $INDENT -npro $ARGS input/ncs-on-return.c -o output/cs-on-return.c ARGS="-kr -i2" $INDENT -npro $ARGS input/bug-hp.c -o output/bug-hp.c ARGS="-orig" $INDENT -npro $ARGS input/bug-di.c -o output/bug-di.c $INDENT -npro $ARGS input/newlined-parms.c -o output/newlined-parms.c ARGS="-bad -bap -nbc -bl -c36 -cd36 -ncdb -nce -ci8 -cli0 -cs -d0 \ -di1 -nfca -i2 -ip0 -l80 -nlp -npcs -npsl -nsc -nsob -ss -nv" $INDENT -npro $ARGS input/indent.pro.c -o output/indent.pro.c ARGS="-fca" $INDENT -npro $ARGS input/comments1.c -o output/comments1-fca.c ARGS="-bbb" $INDENT -npro $ARGS input/bbb-test.c -o output/bbb-test.c $INDENT -npro input/comments1.c -o output/comments1.c $INDENT -npro input/unknown-type.c -o output/unknown-type.c $INDENT -npro input/preesc-comment.c -o output/preesc-comment.c ARGS="-npsl" $INDENT -npro $ARGS input/if-decl-else-decl.c -o output/if-decl-else-decl.c $INDENT -npro $ARGS input/unknown-type.c -o output/unknown-type-npsl.c $INDENT -npro $ARGS input/bug-npsl.c -o output/bug-npsl.c $INDENT -npro input/bug-npsl.c -o output/bug-psl.c ARGS="-cp9" $INDENT -npro $ARGS input/cp-indent.c -o output/cp-indent.c ARGS="-di7" $INDENT -npro $ARGS input/comments.c -o output/comments.c ARGS="-ci5 -T aClient" $INDENT -npro $ARGS input/elipsis-attribute.c -o output/elipsis-attribute.c ARGS="-npsl -npcs -di3" $INDENT -npro $ARGS input/comments2.c -o output/comments2.c $INDENT -npro $ARGS input/comments3.c -o output/comments3.c ARGS="-cdb -sc" $INDENT -npro $ARGS input/comments4.c -o output/comments4.c $INDENT -npro input/brackets.c -o output/brackets.c $INDENT -npro --line-length33 input/brackets.c -o output/brackets33.c $INDENT -npro --line-length34 input/brackets.c -o output/brackets34.c $INDENT -npro --line-length35 input/brackets.c -o output/brackets35.c $INDENT -npro --line-length36 input/brackets.c -o output/brackets36.c $INDENT -npro --line-length37 input/brackets.c -o output/brackets37.c $INDENT -npro --line-length38 input/brackets.c -o output/brackets38.c $INDENT -npro --line-length40 input/bbreak.c -o output/bbreak.c ARGS="-ci5" $INDENT -npro $ARGS input/initializers.c -o output/initializers.c ARGS="-nhnl --brace-indent0 --indent-level2 --dont-line-up-parentheses --continuation-indentation4 --paren-indentation0 --line-length80" $INDENT -npro $ARGS input/else-if.c -o output/else-if.c ARGS="" $INDENT -npro -bl input/else-comment.c -o output/else-comment-bl.c $INDENT -npro -br input/else-comment.c -o output/else-comment-br.c $INDENT -npro -br -ce input/else-comment.c -o output/else-comment-br-ce.c ARGS="-kr -cp0 -l132 -lps -br -psl" $INDENT -npro $ARGS input/const.c -o output/const.c ARGS="--dont-break-procedure-type --ignore-newlines" $INDENT -npro $ARGS input/comment-break.c -o output/comment-break.c ARGS="-ppi 5" $INDENT -npro $ARGS input/pre.c -o output/pre.c ARGS="-i4 -l100 -nlp" $INDENT -npro $ARGS input/dont-line-up-parentheses.c -o output/dont-line-up-parentheses.c # Check line counting of input file $INDENT -npro input/line-count.c -o /dev/null 2>&1 | cut -d: -f3 > output/line-count.c ARGS="-cdw -bli0" $INDENT -npro input/do-cdw.c $ARGS -o output/do-cdw.c ARGS="-il2 -linux" $INDENT -npro input/label.c $ARGS -o output/label.c ARGS="-il1" $INDENT -npro input/goto.c $ARGS -o output/goto-1.c ARGS="-il-4" $INDENT -npro input/goto.c $ARGS -o output/goto-2.c echo "Done." ERR=output/errors # Now diff all the new files with the old standard echo echo "Diffing generated code against standard..." for i in $EXAMPLES $INDENTSRC $SPECIALS $BUGS do echo -n ...$i... if [ ! -f standard/$i ] then echo ERROR: standard/$i missing fi if [ ! -f output/$i ] then echo ERROR: output/$i missing fi diff --initial-tab standard/$i output/$i > output/$i-diffs 2>&1 if [ -s output/$i-diffs ] then echo ERROR: $i failed | tee -a $ERR else rm output/$i-diffs rm output/$i echo fi done echo "Diffing generated code against standard...Done." # Testing indent (x) == indent (indent (x)) echo echo -n "Testing meta-indent..." ARGS="-bacc -nbad -nbap -nbc -br -cdb -nce -ci4 -cli4 -cs -nfc1 \ -fca -i4 -ip0 -l78 -lp -npcs -psl -sc -ss -ts4" $INDENT -npro $ARGS input/meta-indent.c -o output/meta-indent.c diff --initial-tab output/meta-indent.c standard/meta-indent.c > output/meta-diffs if [ -s output/meta-diffs ] then echo ERROR: 1st Meta test failed | tee -a $ERR else rm output/meta-diffs fi for j in 1 2 3 4 5 do echo -n " $j" $INDENT -npro $ARGS output/meta-indent.c -o output/meta-indent.c-o diff --initial-tab output/meta-indent.c-o standard/meta-indent.c > output/meta-diffs-$j if [ -s output/meta-diffs-$j ] then echo ERROR: Meta test $i failed | tee -a $ERR else rm output/meta-diffs-$j mv output/meta-indent.c-o output/meta-indent.c if [ $j -eq 5 ] then rm output/meta-indent.c fi fi done echo " Done" # This section was added when `pr_comment.c' was rewritten, to test # the new comment-handling code. echo echo Testing new comment stuff... A1="-fca" A2="-fc1" A3="-fca -fc1" A4="-fca -fc1 -cdb" A5="-fca -fc1 -cdb -sc" A6="-fca -fc1 -sc" A7="-sc -fc1" A8="-cdb -fc1" A9="-sc -cdb -fc1" A10="-sc -cdb" $INDENT -npro -st input/boxed.c > output/boxed.c-0 $INDENT -npro -st $A1 input/boxed.c > output/boxed.c-1 $INDENT -npro -st $A2 input/boxed.c > output/boxed.c-2 $INDENT -npro -st $A3 input/boxed.c > output/boxed.c-3 $INDENT -npro -st $A4 input/boxed.c > output/boxed.c-4 $INDENT -npro -st $A5 input/boxed.c > output/boxed.c-5 $INDENT -npro -st $A6 input/boxed.c > output/boxed.c-6 $INDENT -npro -st $A7 input/boxed.c > output/boxed.c-7 $INDENT -npro -st $A8 input/boxed.c > output/boxed.c-8 $INDENT -npro -st $A9 input/boxed.c > output/boxed.c-9 $INDENT -npro input/outer.c -o output/outer.c-0 $INDENT -npro $A1 input/outer.c -o output/outer.c-1 $INDENT -npro $A2 input/outer.c -o output/outer.c-2 $INDENT -npro $A3 input/outer.c -o output/outer.c-3 $INDENT -npro $A4 input/outer.c -o output/outer.c-4 $INDENT -npro $A5 input/outer.c -o output/outer.c-5 $INDENT -npro $A6 input/outer.c -o output/outer.c-6 $INDENT -npro $A7 input/outer.c -o output/outer.c-7 $INDENT -npro $A8 input/outer.c -o output/outer.c-8 $INDENT -npro $A9 input/outer.c -o output/outer.c-9 A1="-fc1 -fca" A2="-fc1 -fca -cdb" A3="-fc1 -fca -cdb -sc" A4="-fc1 -fca -sc" A5="-fc1 -fca -l 50 -lc 50" A6="-fc1 -fca -l 50 -lc 50 -cdb" A7="-fc1 -fca -l 50 -lc 50 -sc" A8="-fc1 -fca -l 50 -lc 50 -sc -cdb" $INDENT -npro input/newlines.c -o output/newlines.c-0 $INDENT -npro $A1 input/newlines.c -o output/newlines.c-1 $INDENT -npro $A2 input/newlines.c -o output/newlines.c-2 $INDENT -npro $A3 input/newlines.c -o output/newlines.c-3 $INDENT -npro $A4 input/newlines.c -o output/newlines.c-4 $INDENT -npro $A5 input/newlines.c -o output/newlines.c-5 $INDENT -npro $A6 input/newlines.c -o output/newlines.c-6 $INDENT -npro $A7 input/newlines.c -o output/newlines.c-7 $INDENT -npro $A8 input/newlines.c -o output/newlines.c-8 A1="-l 50 -lc 50" A2="-l 50 -lc 50 -c 20" A3="-l 50 -lc 50 -cd 30" A4="-c 20 -cd 30" A5="-fc1 -fca" A6="-l 50 -lc 50 -fc1 -fca" A7="-cp 10" A8="-fc1 -fca -l50 -lc50 -c 30 -cd 20 -cp 8" A9="-cdb -sc -l 50 -lc 50 -fca -fc1" $INDENT -npro input/cplus.c -o output/cplus.c-0 $INDENT -npro $A1 input/cplus.c -o output/cplus.c-1 $INDENT -npro $A2 input/cplus.c -o output/cplus.c-2 $INDENT -npro $A3 input/cplus.c -o output/cplus.c-3 $INDENT -npro $A4 input/cplus.c -o output/cplus.c-4 $INDENT -npro $A5 input/cplus.c -o output/cplus.c-5 $INDENT -npro $A6 input/cplus.c -o output/cplus.c-6 $INDENT -npro $A7 input/cplus.c -o output/cplus.c-7 $INDENT -npro $A8 input/cplus.c -o output/cplus.c-8 $INDENT -npro $A9 input/cplus.c -o output/cplus.c-9 A1="-sc -cdb -fc1" A2="-i 10 -fc1" $INDENT -npro input/tabs.c -o -fc1 output/tabs.c-0 $INDENT -npro $A1 input/tabs.c -o output/tabs.c-1 $INDENT -npro $A2 input/tabs.c -o output/tabs.c-2 $INDENT -npro input/cplus-one.c -o output/cplus-one.c $INDENT -npro input/class-func.cc -o output/class-func.cc $INDENT -npro input/empty.c -o output/empty.c $INDENT -npro input/already-starred.c -o output/already-starred.c $INDENT -npro input/box-comm.c -o output/box-comm.c $INDENT -npro input/long-comm.c -o output/long-comm.c $INDENT -npro input/ind-star.c -o output/ind-star.c $INDENT -npro input/first-in-block.c -o output/first-in-block.c # currently fails $INDENT -npro input/two-on-line.c -o output/two-on-line.c $INDENT -npro input/method.c -o output/method.c A1="-fca" $INDENT -npro input/right-margin-comment.c $A1 -o output/right-margin-comment.c # These aren't really comment testing, they test the indent control # statements '*INDENT-ON*' and '*INDENT-OFF*' $INDENT -npro input/on-off-1.c -o output/on-off-1.c $INDENT -npro input/on-off-2.c -o output/on-off-2.c cd output ERR=errors # currently fails: two-on-line.c for i in boxed.c-* outer.c-* newlines.c-* cplus.c-* tabs.c-* cplus-one.c class-func.cc \ empty.c already-starred.c box-comm.c long-comm.c ind-star.c first-in-block.c \ on-off-1.c on-off-2.c \ method.c right-margin-comment.c do echo -n ...$i... diff --initial-tab ../standard/$i $i > $i-diffs 2>&1 if [ -s $i-diffs ] then echo -n ERROR: $i failed | tee -a $ERR echo >> $ERR else rm $i-diffs $i fi echo done cd .. echo Testing new comment stuff...Done. echo Testing bad code handling.... # This ends in a error from indent but it shouldn't coredump. $INDENT input/bug206785.c -o output/bug206785.c 2>output/bug206785.err if [ $? -ne 2 ] then echo -n ERROR: bad return status from indent. | tee -a $ERR echo >> $ERR fi cd output for i in bug206785.c bug206785.err do echo -n ...$i... diff --initial-tab ../standard/$i $i > $i-diffs 2>&1 if [ -s $i-diffs ] then echo -n ERROR: $i failed | tee -a $ERR echo >> $ERR else rm $i-diffs rm $i fi echo done echo Testing bad code handling...Done. # Now see if any errors occured. If so, bitch and moan, otherwise, # remove the output directory. # if test -s $ERR then echo '**** Errors occured:' cat $ERR echo '**** Errors occured: ./output not removed' echo else cd .. ls -l output rm -rf output echo echo Regression test successfully completed. echo fi indent-2.2.11/regression/outstanding-problems/0000777000177400010010000000000010775646104016430 500000000000000indent-2.2.11/regression/outstanding-problems/two-on-line.c0000644000177400010010000000014710775646104020662 00000000000000void main (int argc, char *argv[]) { /*lint -save */ /* test of comment in column 1 */ farlj (); } indent-2.2.11/AUTHORS0000644000177400010010000000024710775646104011057 000000000000002001 - .... : David Ingamells 1999 - 2001 : Carlo Wood 1991 - 1994 : Joseph Arceneaux 1989 - 1991 : Jim Kingdon 2001 John Bridges for vc++ updates (e.g. wildcards.c) indent-2.2.11/intl/0000777000177400010010000000000011331331065011020 500000000000000indent-2.2.11/intl/gettext.c0000644000177400010010000000357311041664102012573 00000000000000/* Implementation of gettext(3) function. Copyright (C) 1995, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define GETTEXT __gettext # define DCGETTEXT INTUSE(__dcgettext) #else # define GETTEXT libintl_gettext # define DCGETTEXT libintl_dcgettext #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * GETTEXT (msgid) const char *msgid; { return DCGETTEXT (NULL, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__gettext, gettext); #endif indent-2.2.11/intl/ChangeLog0000644000177400010010000000011111041664102012476 000000000000002002-08-06 GNU * Version 0.11.5 released. indent-2.2.11/intl/ngettext.c0000644000177400010010000000375111041664102012747 00000000000000/* Implementation of ngettext(3) function. Copyright (C) 1995, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define NGETTEXT __ngettext # define DCNGETTEXT INTUSE(__dcngettext) #else # define NGETTEXT libintl_ngettext # define DCNGETTEXT libintl_dcngettext #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * NGETTEXT (msgid1, msgid2, n) const char *msgid1; const char *msgid2; unsigned long int n; { return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__ngettext, ngettext); #endif indent-2.2.11/intl/plural.c0000644000177400010010000014242311331327560012412 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse __gettextparse #define yylex __gettextlex #define yyerror __gettexterror #define yylval __gettextlval #define yychar __gettextchar #define yydebug __gettextdebug #define yynerrs __gettextnerrs /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { EQUOP2 = 258, CMPOP2 = 259, ADDOP2 = 260, MULOP2 = 261, NUMBER = 262 }; #endif /* Tokens. */ #define EQUOP2 258 #define CMPOP2 259 #define ADDOP2 260 #define MULOP2 261 #define NUMBER 262 /* Copy the first part of user declarations. */ #line 1 "plural.y" /* Expression parsing for plural form selection. Copyright (C) 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* The bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include "plural-exp.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ #ifndef _LIBC # define __gettextparse PLURAL_PARSE #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 49 "plural.y" { unsigned long int num; enum operator op; struct expression *exp; } /* Line 187 of yacc.c. */ #line 170 "plural.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ #line 55 "plural.y" /* Prototypes for local functions. */ static struct expression *new_exp PARAMS ((int nargs, enum operator op, struct expression * const *args)); static inline struct expression *new_exp_0 PARAMS ((enum operator op)); static inline struct expression *new_exp_1 PARAMS ((enum operator op, struct expression *right)); static struct expression *new_exp_2 PARAMS ((enum operator op, struct expression *left, struct expression *right)); static inline struct expression *new_exp_3 PARAMS ((enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch)); static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); static void yyerror PARAMS ((const char *str)); /* Allocation of expressions. */ static struct expression * new_exp (nargs, op, args) int nargs; enum operator op; struct expression * const *args; { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (op) enum operator op; { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (op, right) enum operator op; struct expression *right; { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (op, left, right) enum operator op; struct expression *left; struct expression *right; { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (op, bexp, tbranch, fbranch) enum operator op; struct expression *bexp; struct expression *tbranch; struct expression *fbranch; { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } /* Line 216 of yacc.c. */ #line 281 "plural.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 9 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 54 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 16 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 3 /* YYNRULES -- Number of rules. */ #define YYNRULES 13 /* YYNRULES -- Number of states. */ #define YYNSTATES 27 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 262 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2, 2, 2, 2, 5, 2, 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 6, 7, 8, 9, 11 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 11, 15, 19, 23, 27, 31, 35, 38, 40, 42 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 17, 0, -1, 18, -1, 18, 3, 18, 12, 18, -1, 18, 4, 18, -1, 18, 5, 18, -1, 18, 6, 18, -1, 18, 7, 18, -1, 18, 8, 18, -1, 18, 9, 18, -1, 10, 18, -1, 13, -1, 11, -1, 14, 18, 15, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 174, 174, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 223 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", "$accept", "start", "exp", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 63, 124, 38, 258, 259, 260, 261, 33, 262, 58, 110, 40, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 5, 3, 3, 3, 3, 3, 3, 2, 1, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 0, 12, 11, 0, 0, 2, 10, 0, 1, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 5, 6, 7, 8, 9, 0, 3 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 5, 6 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -10 static const yytype_int8 yypact[] = { -9, -9, -10, -10, -9, 8, 36, -10, 13, -10, -9, -9, -9, -9, -9, -9, -9, -10, 26, 41, 45, 18, -2, 14, -10, -9, 36 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -10, -10, -1 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 7, 1, 2, 8, 3, 4, 15, 16, 9, 18, 19, 20, 21, 22, 23, 24, 10, 11, 12, 13, 14, 15, 16, 16, 26, 14, 15, 16, 17, 10, 11, 12, 13, 14, 15, 16, 0, 0, 25, 10, 11, 12, 13, 14, 15, 16, 12, 13, 14, 15, 16, 13, 14, 15, 16 }; static const yytype_int8 yycheck[] = { 1, 10, 11, 4, 13, 14, 8, 9, 0, 10, 11, 12, 13, 14, 15, 16, 3, 4, 5, 6, 7, 8, 9, 9, 25, 7, 8, 9, 15, 3, 4, 5, 6, 7, 8, 9, -1, -1, 12, 3, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, 8, 9 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 10, 11, 13, 14, 17, 18, 18, 18, 0, 3, 4, 5, 6, 7, 8, 9, 15, 18, 18, 18, 18, 18, 18, 18, 12, 18 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) #else # define YYLEX yylex (&yylval) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) yytype_int16 *bottom; yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 175 "plural.y" { if ((yyvsp[(1) - (1)].exp) == NULL) YYABORT; ((struct parse_args *) arg)->res = (yyvsp[(1) - (1)].exp); } break; case 3: #line 183 "plural.y" { (yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp)); } break; case 4: #line 187 "plural.y" { (yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 5: #line 191 "plural.y" { (yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 6: #line 195 "plural.y" { (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 7: #line 199 "plural.y" { (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 8: #line 203 "plural.y" { (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 9: #line 207 "plural.y" { (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 10: #line 211 "plural.y" { (yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp)); } break; case 11: #line 215 "plural.y" { (yyval.exp) = new_exp_0 (var); } break; case 12: #line 219 "plural.y" { if (((yyval.exp) = new_exp_0 (num)) != NULL) (yyval.exp)->val.num = (yyvsp[(1) - (1)].num); } break; case 13: #line 224 "plural.y" { (yyval.exp) = (yyvsp[(2) - (3)].exp); } break; /* Line 1267 of yacc.c. */ #line 1574 "plural.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } #line 229 "plural.y" void internal_function FREE_EXPRESSION (exp) struct expression *exp; { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (lval, pexp) YYSTYPE *lval; const char **pexp; { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (str) const char *str; { /* Do nothing. We don't print error messages here. */ } indent-2.2.11/intl/l10nflist.c0000644000177400010010000003052011041664102012713 00000000000000/* Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Tell glibc's to provide a prototype for stpcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #if defined _LIBC || defined HAVE_ARGZ_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # ifndef stpcpy # define stpcpy(dest, src) __stpcpy(dest, src) # endif #else # ifndef HAVE_STPCPY static char *stpcpy PARAMS ((char *dest, const char *src)); # endif #endif /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) #endif /* Define function which are usually not available. */ #if !defined _LIBC && !defined HAVE___ARGZ_COUNT /* Returns the number of strings in ARGZ. */ static size_t argz_count__ PARAMS ((const char *argz, size_t len)); static size_t argz_count__ (argz, len) const char *argz; size_t len; { size_t count = 0; while (len > 0) { size_t part_len = strlen (argz); argz += part_len + 1; len -= part_len + 1; count++; } return count; } # undef __argz_count # define __argz_count(argz, len) argz_count__ (argz, len) #else # ifdef _LIBC # define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) # endif #endif /* !_LIBC && !HAVE___ARGZ_COUNT */ #if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's except the last into the character SEP. */ static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep)); static void argz_stringify__ (argz, len, sep) char *argz; size_t len; int sep; { while (len > 0) { size_t part_len = strlen (argz); argz += part_len; len -= part_len + 1; if (len > 0) *argz++ = sep; } } # undef __argz_stringify # define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) #else # ifdef _LIBC # define __argz_stringify(argz, len, sep) \ INTUSE(__argz_stringify) (argz, len, sep) # endif #endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ #if !defined _LIBC && !defined HAVE___ARGZ_NEXT static char *argz_next__ PARAMS ((char *argz, size_t argz_len, const char *entry)); static char * argz_next__ (argz, argz_len, entry) char *argz; size_t argz_len; const char *entry; { if (entry) { if (entry < argz + argz_len) entry = strchr (entry, '\0') + 1; return entry >= argz + argz_len ? NULL : (char *) entry; } else if (argz_len > 0) return argz; else return 0; } # undef __argz_next # define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) #endif /* !_LIBC && !HAVE___ARGZ_NEXT */ /* Return number of bits set in X. */ static int pop PARAMS ((int x)); static inline int pop (x) int x; { /* We assume that no more than 16 bits are used. */ x = ((x & ~0x5555) >> 1) + (x & 0x5555); x = ((x & ~0x3333) >> 2) + (x & 0x3333); x = ((x >> 4) + x) & 0x0f0f; x = ((x >> 8) + x) & 0xff; return x; } struct loaded_l10nfile * _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, filename, do_allocate) struct loaded_l10nfile **l10nfile_list; const char *dirlist; size_t dirlist_len; int mask; const char *language; const char *territory; const char *codeset; const char *normalized_codeset; const char *modifier; const char *special; const char *sponsor; const char *revision; const char *filename; int do_allocate; { char *abs_filename; struct loaded_l10nfile **lastp; struct loaded_l10nfile *retval; char *cp; size_t dirlist_count; size_t entries; int cnt; /* If LANGUAGE contains an absolute directory specification, we ignore DIRLIST. */ if (IS_ABSOLUTE_PATH (language)) dirlist_len = 0; /* Allocate room for the full file name. */ abs_filename = (char *) malloc (dirlist_len + strlen (language) + ((mask & TERRITORY) != 0 ? strlen (territory) + 1 : 0) + ((mask & XPG_CODESET) != 0 ? strlen (codeset) + 1 : 0) + ((mask & XPG_NORM_CODESET) != 0 ? strlen (normalized_codeset) + 1 : 0) + (((mask & XPG_MODIFIER) != 0 || (mask & CEN_AUDIENCE) != 0) ? strlen (modifier) + 1 : 0) + ((mask & CEN_SPECIAL) != 0 ? strlen (special) + 1 : 0) + (((mask & CEN_SPONSOR) != 0 || (mask & CEN_REVISION) != 0) ? (1 + ((mask & CEN_SPONSOR) != 0 ? strlen (sponsor) : 0) + ((mask & CEN_REVISION) != 0 ? strlen (revision) + 1 : 0)) : 0) + 1 + strlen (filename) + 1); if (abs_filename == NULL) return NULL; /* Construct file name. */ cp = abs_filename; if (dirlist_len > 0) { memcpy (cp, dirlist, dirlist_len); __argz_stringify (cp, dirlist_len, PATH_SEPARATOR); cp += dirlist_len; cp[-1] = '/'; } cp = stpcpy (cp, language); if ((mask & TERRITORY) != 0) { *cp++ = '_'; cp = stpcpy (cp, territory); } if ((mask & XPG_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, codeset); } if ((mask & XPG_NORM_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, normalized_codeset); } if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0) { /* This component can be part of both syntaces but has different leading characters. For CEN we use `+', else `@'. */ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; cp = stpcpy (cp, modifier); } if ((mask & CEN_SPECIAL) != 0) { *cp++ = '+'; cp = stpcpy (cp, special); } if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0) { *cp++ = ','; if ((mask & CEN_SPONSOR) != 0) cp = stpcpy (cp, sponsor); if ((mask & CEN_REVISION) != 0) { *cp++ = '_'; cp = stpcpy (cp, revision); } } *cp++ = '/'; stpcpy (cp, filename); /* Look in list of already loaded domains whether it is already available. */ lastp = l10nfile_list; for (retval = *l10nfile_list; retval != NULL; retval = retval->next) if (retval->filename != NULL) { int compare = strcmp (retval->filename, abs_filename); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It's not in the list. */ retval = NULL; break; } lastp = &retval->next; } if (retval != NULL || do_allocate == 0) { free (abs_filename); return retval; } dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1); /* Allocate a new loaded_l10nfile. */ retval = (struct loaded_l10nfile *) malloc (sizeof (*retval) + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0)) * sizeof (struct loaded_l10nfile *))); if (retval == NULL) return NULL; retval->filename = abs_filename; /* We set retval->data to NULL here; it is filled in later. Setting retval->decided to 1 here means that retval does not correspond to a real file (dirlist_count > 1) or is not worth looking up (if an unnormalized codeset was specified). */ retval->decided = (dirlist_count > 1 || ((mask & XPG_CODESET) != 0 && (mask & XPG_NORM_CODESET) != 0)); retval->data = NULL; retval->next = *lastp; *lastp = retval; entries = 0; /* Recurse to fill the inheritance list of RETVAL. If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL entry does not correspond to a real file; retval->filename contains colons. In this case we loop across all elements of DIRLIST and across all bit patterns dominated by MASK. If the DIRLIST is a single directory or entirely redundant (i.e. DIRLIST_COUNT == 1), we loop across all bit patterns dominated by MASK, excluding MASK itself. In either case, we loop down from MASK to 0. This has the effect that the extra bits in the locale name are dropped in this order: first the modifier, then the territory, then the codeset, then the normalized_codeset. */ for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt) if ((cnt & ~mask) == 0 && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0) && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0)) { if (dirlist_count > 1) { /* Iterate over all elements of the DIRLIST. */ char *dir = NULL; while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir)) != NULL) retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, filename, 1); } else retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, cnt, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, filename, 1); } retval->successor[entries] = NULL; return retval; } /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ const char * _nl_normalize_codeset (codeset, name_len) const char *codeset; size_t name_len; { int len = 0; int only_digit = 1; char *retval; char *wp; size_t cnt; for (cnt = 0; cnt < name_len; ++cnt) if (isalnum ((unsigned char) codeset[cnt])) { ++len; if (isalpha ((unsigned char) codeset[cnt])) only_digit = 0; } retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); if (retval != NULL) { if (only_digit) wp = stpcpy (retval, "iso"); else wp = retval; for (cnt = 0; cnt < name_len; ++cnt) if (isalpha ((unsigned char) codeset[cnt])) *wp++ = tolower ((unsigned char) codeset[cnt]); else if (isdigit ((unsigned char) codeset[cnt])) *wp++ = codeset[cnt]; *wp = '\0'; } return (const char *) retval; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (dest, src) char *dest; const char *src; { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif indent-2.2.11/intl/VERSION0000644000177400010010000000005011041664102011776 00000000000000GNU gettext library from gettext-0.11.5 indent-2.2.11/intl/loadmsgcat.c0000644000177400010010000010322211041664102013215 00000000000000/* Load needed message catalogs. Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif #endif #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #ifdef _LIBC # include # include #endif #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || (defined _LIBC && defined _POSIX_MAPPED_FILES) # include # undef HAVE_MMAP # define HAVE_MMAP 1 #else # undef HAVE_MMAP #endif #if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC # include #endif #if defined HAVE_INTTYPES_H || defined _LIBC # include #endif #include "gmo.h" #include "gettextP.h" #include "hash-string.h" #include "plural-exp.h" #ifdef _LIBC # include "../locale/localeinfo.h" #endif /* Provide fallback values for macros that ought to be defined in . Note that our fallback values need not be literal strings, because we don't use them with preprocessor string concatenation. */ #if !defined PRId8 || PRI_MACROS_BROKEN # undef PRId8 # define PRId8 "d" #endif #if !defined PRIi8 || PRI_MACROS_BROKEN # undef PRIi8 # define PRIi8 "i" #endif #if !defined PRIo8 || PRI_MACROS_BROKEN # undef PRIo8 # define PRIo8 "o" #endif #if !defined PRIu8 || PRI_MACROS_BROKEN # undef PRIu8 # define PRIu8 "u" #endif #if !defined PRIx8 || PRI_MACROS_BROKEN # undef PRIx8 # define PRIx8 "x" #endif #if !defined PRIX8 || PRI_MACROS_BROKEN # undef PRIX8 # define PRIX8 "X" #endif #if !defined PRId16 || PRI_MACROS_BROKEN # undef PRId16 # define PRId16 "d" #endif #if !defined PRIi16 || PRI_MACROS_BROKEN # undef PRIi16 # define PRIi16 "i" #endif #if !defined PRIo16 || PRI_MACROS_BROKEN # undef PRIo16 # define PRIo16 "o" #endif #if !defined PRIu16 || PRI_MACROS_BROKEN # undef PRIu16 # define PRIu16 "u" #endif #if !defined PRIx16 || PRI_MACROS_BROKEN # undef PRIx16 # define PRIx16 "x" #endif #if !defined PRIX16 || PRI_MACROS_BROKEN # undef PRIX16 # define PRIX16 "X" #endif #if !defined PRId32 || PRI_MACROS_BROKEN # undef PRId32 # define PRId32 "d" #endif #if !defined PRIi32 || PRI_MACROS_BROKEN # undef PRIi32 # define PRIi32 "i" #endif #if !defined PRIo32 || PRI_MACROS_BROKEN # undef PRIo32 # define PRIo32 "o" #endif #if !defined PRIu32 || PRI_MACROS_BROKEN # undef PRIu32 # define PRIu32 "u" #endif #if !defined PRIx32 || PRI_MACROS_BROKEN # undef PRIx32 # define PRIx32 "x" #endif #if !defined PRIX32 || PRI_MACROS_BROKEN # undef PRIX32 # define PRIX32 "X" #endif #if !defined PRId64 || PRI_MACROS_BROKEN # undef PRId64 # define PRId64 (sizeof (long) == 8 ? "ld" : "lld") #endif #if !defined PRIi64 || PRI_MACROS_BROKEN # undef PRIi64 # define PRIi64 (sizeof (long) == 8 ? "li" : "lli") #endif #if !defined PRIo64 || PRI_MACROS_BROKEN # undef PRIo64 # define PRIo64 (sizeof (long) == 8 ? "lo" : "llo") #endif #if !defined PRIu64 || PRI_MACROS_BROKEN # undef PRIu64 # define PRIu64 (sizeof (long) == 8 ? "lu" : "llu") #endif #if !defined PRIx64 || PRI_MACROS_BROKEN # undef PRIx64 # define PRIx64 (sizeof (long) == 8 ? "lx" : "llx") #endif #if !defined PRIX64 || PRI_MACROS_BROKEN # undef PRIX64 # define PRIX64 (sizeof (long) == 8 ? "lX" : "llX") #endif #if !defined PRIdLEAST8 || PRI_MACROS_BROKEN # undef PRIdLEAST8 # define PRIdLEAST8 "d" #endif #if !defined PRIiLEAST8 || PRI_MACROS_BROKEN # undef PRIiLEAST8 # define PRIiLEAST8 "i" #endif #if !defined PRIoLEAST8 || PRI_MACROS_BROKEN # undef PRIoLEAST8 # define PRIoLEAST8 "o" #endif #if !defined PRIuLEAST8 || PRI_MACROS_BROKEN # undef PRIuLEAST8 # define PRIuLEAST8 "u" #endif #if !defined PRIxLEAST8 || PRI_MACROS_BROKEN # undef PRIxLEAST8 # define PRIxLEAST8 "x" #endif #if !defined PRIXLEAST8 || PRI_MACROS_BROKEN # undef PRIXLEAST8 # define PRIXLEAST8 "X" #endif #if !defined PRIdLEAST16 || PRI_MACROS_BROKEN # undef PRIdLEAST16 # define PRIdLEAST16 "d" #endif #if !defined PRIiLEAST16 || PRI_MACROS_BROKEN # undef PRIiLEAST16 # define PRIiLEAST16 "i" #endif #if !defined PRIoLEAST16 || PRI_MACROS_BROKEN # undef PRIoLEAST16 # define PRIoLEAST16 "o" #endif #if !defined PRIuLEAST16 || PRI_MACROS_BROKEN # undef PRIuLEAST16 # define PRIuLEAST16 "u" #endif #if !defined PRIxLEAST16 || PRI_MACROS_BROKEN # undef PRIxLEAST16 # define PRIxLEAST16 "x" #endif #if !defined PRIXLEAST16 || PRI_MACROS_BROKEN # undef PRIXLEAST16 # define PRIXLEAST16 "X" #endif #if !defined PRIdLEAST32 || PRI_MACROS_BROKEN # undef PRIdLEAST32 # define PRIdLEAST32 "d" #endif #if !defined PRIiLEAST32 || PRI_MACROS_BROKEN # undef PRIiLEAST32 # define PRIiLEAST32 "i" #endif #if !defined PRIoLEAST32 || PRI_MACROS_BROKEN # undef PRIoLEAST32 # define PRIoLEAST32 "o" #endif #if !defined PRIuLEAST32 || PRI_MACROS_BROKEN # undef PRIuLEAST32 # define PRIuLEAST32 "u" #endif #if !defined PRIxLEAST32 || PRI_MACROS_BROKEN # undef PRIxLEAST32 # define PRIxLEAST32 "x" #endif #if !defined PRIXLEAST32 || PRI_MACROS_BROKEN # undef PRIXLEAST32 # define PRIXLEAST32 "X" #endif #if !defined PRIdLEAST64 || PRI_MACROS_BROKEN # undef PRIdLEAST64 # define PRIdLEAST64 PRId64 #endif #if !defined PRIiLEAST64 || PRI_MACROS_BROKEN # undef PRIiLEAST64 # define PRIiLEAST64 PRIi64 #endif #if !defined PRIoLEAST64 || PRI_MACROS_BROKEN # undef PRIoLEAST64 # define PRIoLEAST64 PRIo64 #endif #if !defined PRIuLEAST64 || PRI_MACROS_BROKEN # undef PRIuLEAST64 # define PRIuLEAST64 PRIu64 #endif #if !defined PRIxLEAST64 || PRI_MACROS_BROKEN # undef PRIxLEAST64 # define PRIxLEAST64 PRIx64 #endif #if !defined PRIXLEAST64 || PRI_MACROS_BROKEN # undef PRIXLEAST64 # define PRIXLEAST64 PRIX64 #endif #if !defined PRIdFAST8 || PRI_MACROS_BROKEN # undef PRIdFAST8 # define PRIdFAST8 "d" #endif #if !defined PRIiFAST8 || PRI_MACROS_BROKEN # undef PRIiFAST8 # define PRIiFAST8 "i" #endif #if !defined PRIoFAST8 || PRI_MACROS_BROKEN # undef PRIoFAST8 # define PRIoFAST8 "o" #endif #if !defined PRIuFAST8 || PRI_MACROS_BROKEN # undef PRIuFAST8 # define PRIuFAST8 "u" #endif #if !defined PRIxFAST8 || PRI_MACROS_BROKEN # undef PRIxFAST8 # define PRIxFAST8 "x" #endif #if !defined PRIXFAST8 || PRI_MACROS_BROKEN # undef PRIXFAST8 # define PRIXFAST8 "X" #endif #if !defined PRIdFAST16 || PRI_MACROS_BROKEN # undef PRIdFAST16 # define PRIdFAST16 "d" #endif #if !defined PRIiFAST16 || PRI_MACROS_BROKEN # undef PRIiFAST16 # define PRIiFAST16 "i" #endif #if !defined PRIoFAST16 || PRI_MACROS_BROKEN # undef PRIoFAST16 # define PRIoFAST16 "o" #endif #if !defined PRIuFAST16 || PRI_MACROS_BROKEN # undef PRIuFAST16 # define PRIuFAST16 "u" #endif #if !defined PRIxFAST16 || PRI_MACROS_BROKEN # undef PRIxFAST16 # define PRIxFAST16 "x" #endif #if !defined PRIXFAST16 || PRI_MACROS_BROKEN # undef PRIXFAST16 # define PRIXFAST16 "X" #endif #if !defined PRIdFAST32 || PRI_MACROS_BROKEN # undef PRIdFAST32 # define PRIdFAST32 "d" #endif #if !defined PRIiFAST32 || PRI_MACROS_BROKEN # undef PRIiFAST32 # define PRIiFAST32 "i" #endif #if !defined PRIoFAST32 || PRI_MACROS_BROKEN # undef PRIoFAST32 # define PRIoFAST32 "o" #endif #if !defined PRIuFAST32 || PRI_MACROS_BROKEN # undef PRIuFAST32 # define PRIuFAST32 "u" #endif #if !defined PRIxFAST32 || PRI_MACROS_BROKEN # undef PRIxFAST32 # define PRIxFAST32 "x" #endif #if !defined PRIXFAST32 || PRI_MACROS_BROKEN # undef PRIXFAST32 # define PRIXFAST32 "X" #endif #if !defined PRIdFAST64 || PRI_MACROS_BROKEN # undef PRIdFAST64 # define PRIdFAST64 PRId64 #endif #if !defined PRIiFAST64 || PRI_MACROS_BROKEN # undef PRIiFAST64 # define PRIiFAST64 PRIi64 #endif #if !defined PRIoFAST64 || PRI_MACROS_BROKEN # undef PRIoFAST64 # define PRIoFAST64 PRIo64 #endif #if !defined PRIuFAST64 || PRI_MACROS_BROKEN # undef PRIuFAST64 # define PRIuFAST64 PRIu64 #endif #if !defined PRIxFAST64 || PRI_MACROS_BROKEN # undef PRIxFAST64 # define PRIxFAST64 PRIx64 #endif #if !defined PRIXFAST64 || PRI_MACROS_BROKEN # undef PRIXFAST64 # define PRIXFAST64 PRIX64 #endif #if !defined PRIdMAX || PRI_MACROS_BROKEN # undef PRIdMAX # define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld") #endif #if !defined PRIiMAX || PRI_MACROS_BROKEN # undef PRIiMAX # define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli") #endif #if !defined PRIoMAX || PRI_MACROS_BROKEN # undef PRIoMAX # define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo") #endif #if !defined PRIuMAX || PRI_MACROS_BROKEN # undef PRIuMAX # define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu") #endif #if !defined PRIxMAX || PRI_MACROS_BROKEN # undef PRIxMAX # define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx") #endif #if !defined PRIXMAX || PRI_MACROS_BROKEN # undef PRIXMAX # define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX") #endif #if !defined PRIdPTR || PRI_MACROS_BROKEN # undef PRIdPTR # define PRIdPTR \ (sizeof (void *) == sizeof (long) ? "ld" : \ sizeof (void *) == sizeof (int) ? "d" : \ "lld") #endif #if !defined PRIiPTR || PRI_MACROS_BROKEN # undef PRIiPTR # define PRIiPTR \ (sizeof (void *) == sizeof (long) ? "li" : \ sizeof (void *) == sizeof (int) ? "i" : \ "lli") #endif #if !defined PRIoPTR || PRI_MACROS_BROKEN # undef PRIoPTR # define PRIoPTR \ (sizeof (void *) == sizeof (long) ? "lo" : \ sizeof (void *) == sizeof (int) ? "o" : \ "llo") #endif #if !defined PRIuPTR || PRI_MACROS_BROKEN # undef PRIuPTR # define PRIuPTR \ (sizeof (void *) == sizeof (long) ? "lu" : \ sizeof (void *) == sizeof (int) ? "u" : \ "llu") #endif #if !defined PRIxPTR || PRI_MACROS_BROKEN # undef PRIxPTR # define PRIxPTR \ (sizeof (void *) == sizeof (long) ? "lx" : \ sizeof (void *) == sizeof (int) ? "x" : \ "llx") #endif #if !defined PRIXPTR || PRI_MACROS_BROKEN # undef PRIXPTR # define PRIXPTR \ (sizeof (void *) == sizeof (long) ? "lX" : \ sizeof (void *) == sizeof (int) ? "X" : \ "llX") #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ISO C functions. This is required by the standard because some ISO C functions will require linking with this object file and the name space must not be polluted. */ # define open __open # define close __close # define read __read # define mmap __mmap # define munmap __munmap #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in . */ #if !defined O_BINARY && defined _O_BINARY /* For MSC-compatible compilers. */ # define O_BINARY _O_BINARY # define O_TEXT _O_TEXT #endif #ifdef __BEOS__ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif /* On reasonable systems, binary I/O is the default. */ #ifndef O_BINARY # define O_BINARY 0 #endif /* Prototypes for local functions. Needed to ensure compiler checking of function argument counts despite of K&R C function definition syntax. */ static const char *get_sysdep_segment_value PARAMS ((const char *name)); /* We need a sign, whether a new catalog was loaded, which can be associated with all translations. This is important if the translations are cached by one of GCC's features. */ int _nl_msg_cat_cntr; /* Expand a system dependent string segment. Return NULL if unsupported. */ static const char * get_sysdep_segment_value (name) const char *name; { /* Test for an ISO C 99 section 7.8.1 format string directive. Syntax: P R I { d | i | o | u | x | X } { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */ /* We don't use a table of 14 times 6 'const char *' strings here, because data relocations cost startup time. */ if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I') { if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u' || name[3] == 'x' || name[3] == 'X') { if (name[4] == '8' && name[5] == '\0') { if (name[3] == 'd') return PRId8; if (name[3] == 'i') return PRIi8; if (name[3] == 'o') return PRIo8; if (name[3] == 'u') return PRIu8; if (name[3] == 'x') return PRIx8; if (name[3] == 'X') return PRIX8; abort (); } if (name[4] == '1' && name[5] == '6' && name[6] == '\0') { if (name[3] == 'd') return PRId16; if (name[3] == 'i') return PRIi16; if (name[3] == 'o') return PRIo16; if (name[3] == 'u') return PRIu16; if (name[3] == 'x') return PRIx16; if (name[3] == 'X') return PRIX16; abort (); } if (name[4] == '3' && name[5] == '2' && name[6] == '\0') { if (name[3] == 'd') return PRId32; if (name[3] == 'i') return PRIi32; if (name[3] == 'o') return PRIo32; if (name[3] == 'u') return PRIu32; if (name[3] == 'x') return PRIx32; if (name[3] == 'X') return PRIX32; abort (); } if (name[4] == '6' && name[5] == '4' && name[6] == '\0') { if (name[3] == 'd') return PRId64; if (name[3] == 'i') return PRIi64; if (name[3] == 'o') return PRIo64; if (name[3] == 'u') return PRIu64; if (name[3] == 'x') return PRIx64; if (name[3] == 'X') return PRIX64; abort (); } if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A' && name[7] == 'S' && name[8] == 'T') { if (name[9] == '8' && name[10] == '\0') { if (name[3] == 'd') return PRIdLEAST8; if (name[3] == 'i') return PRIiLEAST8; if (name[3] == 'o') return PRIoLEAST8; if (name[3] == 'u') return PRIuLEAST8; if (name[3] == 'x') return PRIxLEAST8; if (name[3] == 'X') return PRIXLEAST8; abort (); } if (name[9] == '1' && name[10] == '6' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST16; if (name[3] == 'i') return PRIiLEAST16; if (name[3] == 'o') return PRIoLEAST16; if (name[3] == 'u') return PRIuLEAST16; if (name[3] == 'x') return PRIxLEAST16; if (name[3] == 'X') return PRIXLEAST16; abort (); } if (name[9] == '3' && name[10] == '2' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST32; if (name[3] == 'i') return PRIiLEAST32; if (name[3] == 'o') return PRIoLEAST32; if (name[3] == 'u') return PRIuLEAST32; if (name[3] == 'x') return PRIxLEAST32; if (name[3] == 'X') return PRIXLEAST32; abort (); } if (name[9] == '6' && name[10] == '4' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST64; if (name[3] == 'i') return PRIiLEAST64; if (name[3] == 'o') return PRIoLEAST64; if (name[3] == 'u') return PRIuLEAST64; if (name[3] == 'x') return PRIxLEAST64; if (name[3] == 'X') return PRIXLEAST64; abort (); } } if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S' && name[7] == 'T') { if (name[8] == '8' && name[9] == '\0') { if (name[3] == 'd') return PRIdFAST8; if (name[3] == 'i') return PRIiFAST8; if (name[3] == 'o') return PRIoFAST8; if (name[3] == 'u') return PRIuFAST8; if (name[3] == 'x') return PRIxFAST8; if (name[3] == 'X') return PRIXFAST8; abort (); } if (name[8] == '1' && name[9] == '6' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST16; if (name[3] == 'i') return PRIiFAST16; if (name[3] == 'o') return PRIoFAST16; if (name[3] == 'u') return PRIuFAST16; if (name[3] == 'x') return PRIxFAST16; if (name[3] == 'X') return PRIXFAST16; abort (); } if (name[8] == '3' && name[9] == '2' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST32; if (name[3] == 'i') return PRIiFAST32; if (name[3] == 'o') return PRIoFAST32; if (name[3] == 'u') return PRIuFAST32; if (name[3] == 'x') return PRIxFAST32; if (name[3] == 'X') return PRIXFAST32; abort (); } if (name[8] == '6' && name[9] == '4' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST64; if (name[3] == 'i') return PRIiFAST64; if (name[3] == 'o') return PRIoFAST64; if (name[3] == 'u') return PRIuFAST64; if (name[3] == 'x') return PRIxFAST64; if (name[3] == 'X') return PRIXFAST64; abort (); } } if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X' && name[7] == '\0') { if (name[3] == 'd') return PRIdMAX; if (name[3] == 'i') return PRIiMAX; if (name[3] == 'o') return PRIoMAX; if (name[3] == 'u') return PRIuMAX; if (name[3] == 'x') return PRIxMAX; if (name[3] == 'X') return PRIXMAX; abort (); } if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R' && name[7] == '\0') { if (name[3] == 'd') return PRIdPTR; if (name[3] == 'i') return PRIiPTR; if (name[3] == 'o') return PRIoPTR; if (name[3] == 'u') return PRIuPTR; if (name[3] == 'x') return PRIxPTR; if (name[3] == 'X') return PRIXPTR; abort (); } } } /* Other system dependent strings are not valid. */ return NULL; } /* Initialize the codeset dependent parts of an opened message catalog. Return the header entry. */ const char * internal_function _nl_init_domain_conv (domain_file, domain, domainbinding) struct loaded_l10nfile *domain_file; struct loaded_domain *domain; struct binding *domainbinding; { /* Find out about the character set the file is encoded with. This can be found (in textual form) in the entry "". If this entry does not exist or if this does not contain the `charset=' information, we will assume the charset matches the one the current locale and we don't have to perform any conversion. */ char *nullentry; size_t nullentrylen; /* Preinitialize fields, to avoid recursion during _nl_find_msg. */ domain->codeset_cntr = (domainbinding != NULL ? domainbinding->codeset_cntr : 0); #ifdef _LIBC domain->conv = (__gconv_t) -1; #else # if HAVE_ICONV domain->conv = (iconv_t) -1; # endif #endif domain->conv_tab = NULL; /* Get the header entry. */ nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen); if (nullentry != NULL) { #if defined _LIBC || HAVE_ICONV const char *charsetstr; charsetstr = strstr (nullentry, "charset="); if (charsetstr != NULL) { size_t len; char *charset; const char *outcharset; charsetstr += strlen ("charset="); len = strcspn (charsetstr, " \t\n"); charset = (char *) alloca (len + 1); # if defined _LIBC || HAVE_MEMPCPY *((char *) mempcpy (charset, charsetstr, len)) = '\0'; # else memcpy (charset, charsetstr, len); charset[len] = '\0'; # endif /* The output charset should normally be determined by the locale. But sometimes the locale is not used or not correctly set up, so we provide a possibility for the user to override this. Moreover, the value specified through bind_textdomain_codeset overrides both. */ if (domainbinding != NULL && domainbinding->codeset != NULL) outcharset = domainbinding->codeset; else { outcharset = getenv ("OUTPUT_CHARSET"); if (outcharset == NULL || outcharset[0] == '\0') { # ifdef _LIBC outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string; # else # if HAVE_ICONV extern const char *locale_charset PARAMS ((void)); outcharset = locale_charset (); # endif # endif } } # ifdef _LIBC /* We always want to use transliteration. */ outcharset = norm_add_slashes (outcharset, "TRANSLIT"); charset = norm_add_slashes (charset, NULL); if (__gconv_open (outcharset, charset, &domain->conv, GCONV_AVOID_NOCONV) != __GCONV_OK) domain->conv = (__gconv_t) -1; # else # if HAVE_ICONV /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5, we want to use transliteration. */ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ || _LIBICONV_VERSION >= 0x0105 if (strchr (outcharset, '/') == NULL) { char *tmp; len = strlen (outcharset); tmp = (char *) alloca (len + 10 + 1); memcpy (tmp, outcharset, len); memcpy (tmp + len, "//TRANSLIT", 10 + 1); outcharset = tmp; domain->conv = iconv_open (outcharset, charset); freea (outcharset); } else # endif domain->conv = iconv_open (outcharset, charset); # endif # endif freea (charset); } #endif /* _LIBC || HAVE_ICONV */ } return nullentry; } /* Frees the codeset dependent parts of an opened message catalog. */ void internal_function _nl_free_domain_conv (domain) struct loaded_domain *domain; { if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1) free (domain->conv_tab); #ifdef _LIBC if (domain->conv != (__gconv_t) -1) __gconv_close (domain->conv); #else # if HAVE_ICONV if (domain->conv != (iconv_t) -1) iconv_close (domain->conv); # endif #endif } /* Load the message catalogs specified by FILENAME. If it is no valid message catalog do nothing. */ void internal_function _nl_load_domain (domain_file, domainbinding) struct loaded_l10nfile *domain_file; struct binding *domainbinding; { int fd; size_t size; #ifdef _LIBC struct stat64 st; #else struct stat st; #endif struct mo_file_header *data = (struct mo_file_header *) -1; int use_mmap = 0; struct loaded_domain *domain; int revision; const char *nullentry; domain_file->decided = 1; domain_file->data = NULL; /* Note that it would be useless to store domainbinding in domain_file because domainbinding might be == NULL now but != NULL later (after a call to bind_textdomain_codeset). */ /* If the record does not represent a valid locale the FILENAME might be NULL. This can happen when according to the given specification the locale file name is different for XPG and CEN syntax. */ if (domain_file->filename == NULL) return; /* Try to open the addressed file. */ fd = open (domain_file->filename, O_RDONLY | O_BINARY); if (fd == -1) return; /* We must know about the size of the file. */ if ( #ifdef _LIBC __builtin_expect (fstat64 (fd, &st) != 0, 0) #else __builtin_expect (fstat (fd, &st) != 0, 0) #endif || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) || __builtin_expect (size < sizeof (struct mo_file_header), 0)) { /* Something went wrong. */ close (fd); return; } #ifdef HAVE_MMAP /* Now we are ready to load the file. If mmap() is available we try this first. If not available or it failed we try to load it. */ data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); if (__builtin_expect (data != (struct mo_file_header *) -1, 1)) { /* mmap() call was successful. */ close (fd); use_mmap = 1; } #endif /* If the data is not yet available (i.e. mmap'ed) we try to load it manually. */ if (data == (struct mo_file_header *) -1) { size_t to_read; char *read_ptr; data = (struct mo_file_header *) malloc (size); if (data == NULL) return; to_read = size; read_ptr = (char *) data; do { long int nb = (long int) read (fd, read_ptr, to_read); if (nb <= 0) { #ifdef EINTR if (nb == -1 && errno == EINTR) continue; #endif close (fd); return; } read_ptr += nb; to_read -= nb; } while (to_read > 0); close (fd); } /* Using the magic number we can test whether it really is a message catalog file. */ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, 0)) { /* The magic number is wrong: not a message catalog file. */ #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); return; } domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); if (domain == NULL) return; domain_file->data = domain; domain->data = (char *) data; domain->use_mmap = use_mmap; domain->mmap_size = size; domain->must_swap = data->magic != _MAGIC; domain->malloced = NULL; /* Fill in the information about the available tables. */ revision = W (domain->must_swap, data->revision); /* We support only the major revision 0. */ switch (revision >> 16) { case 0: domain->nstrings = W (domain->must_swap, data->nstrings); domain->orig_tab = (const struct string_desc *) ((char *) data + W (domain->must_swap, data->orig_tab_offset)); domain->trans_tab = (const struct string_desc *) ((char *) data + W (domain->must_swap, data->trans_tab_offset)); domain->hash_size = W (domain->must_swap, data->hash_tab_size); domain->hash_tab = (domain->hash_size > 2 ? (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->hash_tab_offset)) : NULL); domain->must_swap_hash_tab = domain->must_swap; /* Now dispatch on the minor revision. */ switch (revision & 0xffff) { case 0: domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; break; case 1: default: { nls_uint32 n_sysdep_strings; if (domain->hash_tab == NULL) /* This is invalid. These minor revisions need a hash table. */ goto invalid; n_sysdep_strings = W (domain->must_swap, data->n_sysdep_strings); if (n_sysdep_strings > 0) { nls_uint32 n_sysdep_segments; const struct sysdep_segment *sysdep_segments; const char **sysdep_segment_values; const nls_uint32 *orig_sysdep_tab; const nls_uint32 *trans_sysdep_tab; size_t memneed; char *mem; struct sysdep_string_desc *inmem_orig_sysdep_tab; struct sysdep_string_desc *inmem_trans_sysdep_tab; nls_uint32 *inmem_hash_tab; unsigned int i; /* Get the values of the system dependent segments. */ n_sysdep_segments = W (domain->must_swap, data->n_sysdep_segments); sysdep_segments = (const struct sysdep_segment *) ((char *) data + W (domain->must_swap, data->sysdep_segments_offset)); sysdep_segment_values = alloca (n_sysdep_segments * sizeof (const char *)); for (i = 0; i < n_sysdep_segments; i++) { const char *name = (char *) data + W (domain->must_swap, sysdep_segments[i].offset); nls_uint32 namelen = W (domain->must_swap, sysdep_segments[i].length); if (!(namelen > 0 && name[namelen - 1] == '\0')) { freea (sysdep_segment_values); goto invalid; } sysdep_segment_values[i] = get_sysdep_segment_value (name); } orig_sysdep_tab = (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->orig_sysdep_tab_offset)); trans_sysdep_tab = (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->trans_sysdep_tab_offset)); /* Compute the amount of additional memory needed for the system dependent strings and the augmented hash table. */ memneed = 2 * n_sysdep_strings * sizeof (struct sysdep_string_desc) + domain->hash_size * sizeof (nls_uint32); for (i = 0; i < 2 * n_sysdep_strings; i++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, i < n_sysdep_strings ? orig_sysdep_tab[i] : trans_sysdep_tab[i - n_sysdep_strings])); size_t need = 0; const struct segment_pair *p = sysdep_string->segments; if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) for (p = sysdep_string->segments;; p++) { nls_uint32 sysdepref; need += W (domain->must_swap, p->segsize); sysdepref = W (domain->must_swap, p->sysdepref); if (sysdepref == SEGMENTS_END) break; if (sysdepref >= n_sysdep_segments) { /* Invalid. */ freea (sysdep_segment_values); goto invalid; } need += strlen (sysdep_segment_values[sysdepref]); } memneed += need; } /* Allocate additional memory. */ mem = (char *) malloc (memneed); if (mem == NULL) goto invalid; domain->malloced = mem; inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem; mem += n_sysdep_strings * sizeof (struct sysdep_string_desc); inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem; mem += n_sysdep_strings * sizeof (struct sysdep_string_desc); inmem_hash_tab = (nls_uint32 *) mem; mem += domain->hash_size * sizeof (nls_uint32); /* Compute the system dependent strings. */ for (i = 0; i < 2 * n_sysdep_strings; i++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, i < n_sysdep_strings ? orig_sysdep_tab[i] : trans_sysdep_tab[i - n_sysdep_strings])); const char *static_segments = (char *) data + W (domain->must_swap, sysdep_string->offset); const struct segment_pair *p = sysdep_string->segments; /* Concatenate the segments, and fill inmem_orig_sysdep_tab[i] (for i < n_sysdep_strings) and inmem_trans_sysdep_tab[i-n_sysdep_strings] (for i >= n_sysdep_strings). */ if (W (domain->must_swap, p->sysdepref) == SEGMENTS_END) { /* Only one static segment. */ inmem_orig_sysdep_tab[i].length = W (domain->must_swap, p->segsize); inmem_orig_sysdep_tab[i].pointer = static_segments; } else { inmem_orig_sysdep_tab[i].pointer = mem; for (p = sysdep_string->segments;; p++) { nls_uint32 segsize = W (domain->must_swap, p->segsize); nls_uint32 sysdepref = W (domain->must_swap, p->sysdepref); size_t n; if (segsize > 0) { memcpy (mem, static_segments, segsize); mem += segsize; static_segments += segsize; } if (sysdepref == SEGMENTS_END) break; n = strlen (sysdep_segment_values[sysdepref]); memcpy (mem, sysdep_segment_values[sysdepref], n); mem += n; } inmem_orig_sysdep_tab[i].length = mem - inmem_orig_sysdep_tab[i].pointer; } } /* Compute the augmented hash table. */ for (i = 0; i < domain->hash_size; i++) inmem_hash_tab[i] = W (domain->must_swap_hash_tab, domain->hash_tab[i]); for (i = 0; i < n_sysdep_strings; i++) { const char *msgid = inmem_orig_sysdep_tab[i].pointer; nls_uint32 hash_val = hash_string (msgid); nls_uint32 idx = hash_val % domain->hash_size; nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); for (;;) { if (inmem_hash_tab[idx] == 0) { /* Hash table entry is empty. Use it. */ inmem_hash_tab[idx] = 1 + domain->nstrings + i; break; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } } freea (sysdep_segment_values); domain->n_sysdep_strings = n_sysdep_strings; domain->orig_sysdep_tab = inmem_orig_sysdep_tab; domain->trans_sysdep_tab = inmem_trans_sysdep_tab; domain->hash_tab = inmem_hash_tab; domain->must_swap_hash_tab = 0; } else { domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; } } break; } break; default: /* This is an invalid revision. */ invalid: /* This is an invalid .mo file. */ if (domain->malloced) free (domain->malloced); #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); free (domain); domain_file->data = NULL; return; } /* Now initialize the character set converter from the character set the file is encoded with (found in the header entry) to the domain's specified character set or the locale's character set. */ nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding); /* Also look for a plural specification. */ EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); } #ifdef _LIBC void internal_function _nl_unload_domain (domain) struct loaded_domain *domain; { if (domain->plural != &__gettext_germanic_plural) __gettext_free_exp (domain->plural); _nl_free_domain_conv (domain); if (domain->malloced) free (domain->malloced); # ifdef _POSIX_MAPPED_FILES if (domain->use_mmap) munmap ((caddr_t) domain->data, domain->mmap_size); else # endif /* _POSIX_MAPPED_FILES */ free ((void *) domain->data); free (domain); } #endif indent-2.2.11/intl/gmo.h0000644000177400010010000001125711041664102011674 00000000000000/* Description of GNU message catalog format: general file layout. Copyright (C) 1995, 1997, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _GETTEXT_H #define _GETTEXT_H 1 #include /* @@ end of prolog @@ */ /* The magic number of the GNU message catalog format. */ #define _MAGIC 0x950412de #define _MAGIC_SWAPPED 0xde120495 /* Revision number of the currently used .mo (binary) file format. */ #define MO_REVISION_NUMBER 0 /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work when cross-compiling. */ #if __STDC__ # define UINT_MAX_32_BITS 4294967295U #else # define UINT_MAX_32_BITS 0xFFFFFFFF #endif /* If UINT_MAX isn't defined, assume it's a 32-bit type. This should be valid for all systems GNU cares about because that doesn't include 16-bit systems, and only modern systems (that certainly have ) have 64+-bit integral types. */ #ifndef UINT_MAX # define UINT_MAX UINT_MAX_32_BITS #endif #if UINT_MAX == UINT_MAX_32_BITS typedef unsigned nls_uint32; #else # if USHRT_MAX == UINT_MAX_32_BITS typedef unsigned short nls_uint32; # else # if ULONG_MAX == UINT_MAX_32_BITS typedef unsigned long nls_uint32; # else /* The following line is intended to throw an error. Using #error is not portable enough. */ "Cannot determine unsigned 32-bit data type." # endif # endif #endif /* Header for binary .mo file format. */ struct mo_file_header { /* The magic number. */ nls_uint32 magic; /* The revision number of the file format. */ nls_uint32 revision; /* The following are only used in .mo files with major revision 0. */ /* The number of strings pairs. */ nls_uint32 nstrings; /* Offset of table with start offsets of original strings. */ nls_uint32 orig_tab_offset; /* Offset of table with start offsets of translated strings. */ nls_uint32 trans_tab_offset; /* Size of hash table. */ nls_uint32 hash_tab_size; /* Offset of first hash table entry. */ nls_uint32 hash_tab_offset; /* The following are only used in .mo files with minor revision >= 1. */ /* The number of system dependent segments. */ nls_uint32 n_sysdep_segments; /* Offset of table describing system dependent segments. */ nls_uint32 sysdep_segments_offset; /* The number of system dependent strings pairs. */ nls_uint32 n_sysdep_strings; /* Offset of table with start offsets of original sysdep strings. */ nls_uint32 orig_sysdep_tab_offset; /* Offset of table with start offsets of translated sysdep strings. */ nls_uint32 trans_sysdep_tab_offset; }; /* Descriptor for static string contained in the binary .mo file. */ struct string_desc { /* Length of addressed string, not including the trailing NUL. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* The following are only used in .mo files with minor revision >= 1. */ /* Descriptor for system dependent string segment. */ struct sysdep_segment { /* Length of addressed string, including the trailing NUL. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* Descriptor for system dependent string. */ struct sysdep_string { /* Offset of static string segments in file. */ nls_uint32 offset; /* Alternating sequence of static and system dependent segments. The last segment is a static segment, including the trailing NUL. */ struct segment_pair { /* Size of static segment. */ nls_uint32 segsize; /* Reference to system dependent string segment, or ~0 at the end. */ nls_uint32 sysdepref; } segments[1]; }; /* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF, regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */ #define SEGMENTS_END ((nls_uint32) ~0) /* @@ begin of epilog @@ */ #endif /* gettext.h */ indent-2.2.11/intl/gettextP.h0000644000177400010010000001676611041664102012730 00000000000000/* Header describing internals of libintl library. Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _GETTEXTP_H #define _GETTEXTP_H #include /* Get size_t. */ #ifdef _LIBC # include "../iconv/gconv_int.h" #else # if HAVE_ICONV # include # endif #endif #include "loadinfo.h" #include "gmo.h" /* Get nls_uint32. */ /* @@ end of prolog @@ */ #ifndef PARAMS # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () # endif #endif #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif #ifndef W # define W(flag, data) ((flag) ? SWAP (data) : (data)) #endif #ifdef _LIBC # include # define SWAP(i) bswap_32 (i) #else static inline nls_uint32 SWAP (i) nls_uint32 i; { return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); } #endif /* In-memory representation of system dependent string. */ struct sysdep_string_desc { /* Length of addressed string, including the trailing NUL. */ size_t length; /* Pointer to addressed string. */ const char *pointer; }; /* The representation of an opened message catalog. */ struct loaded_domain { /* Pointer to memory containing the .mo file. */ const char *data; /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */ int use_mmap; /* Size of mmap()ed memory. */ size_t mmap_size; /* 1 if the .mo file uses a different endianness than this machine. */ int must_swap; /* Pointer to additional malloc()ed memory. */ void *malloced; /* Number of static strings pairs. */ nls_uint32 nstrings; /* Pointer to descriptors of original strings in the file. */ const struct string_desc *orig_tab; /* Pointer to descriptors of translated strings in the file. */ const struct string_desc *trans_tab; /* Number of system dependent strings pairs. */ nls_uint32 n_sysdep_strings; /* Pointer to descriptors of original sysdep strings. */ const struct sysdep_string_desc *orig_sysdep_tab; /* Pointer to descriptors of translated sysdep strings. */ const struct sysdep_string_desc *trans_sysdep_tab; /* Size of hash table. */ nls_uint32 hash_size; /* Pointer to hash table. */ const nls_uint32 *hash_tab; /* 1 if the hash table uses a different endianness than this machine. */ int must_swap_hash_tab; int codeset_cntr; #ifdef _LIBC __gconv_t conv; #else # if HAVE_ICONV iconv_t conv; # endif #endif char **conv_tab; struct expression *plural; unsigned long int nplurals; }; /* We want to allocate a string at the end of the struct. But ISO C doesn't allow zero sized arrays. */ #ifdef __GNUC__ # define ZERO 0 #else # define ZERO 1 #endif /* A set of settings bound to a message domain. Used to store settings from bindtextdomain() and bind_textdomain_codeset(). */ struct binding { struct binding *next; char *dirname; int codeset_cntr; /* Incremented each time codeset changes. */ char *codeset; char domainname[ZERO]; }; /* A counter which is incremented each time some previous translations become invalid. This variable is part of the external ABI of the GNU libintl. */ extern int _nl_msg_cat_cntr; #ifndef _LIBC const char *_nl_locale_name PARAMS ((int category, const char *categoryname)); #endif struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname, char *__locale, const char *__domainname, struct binding *__domainbinding)) internal_function; void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain, struct binding *__domainbinding)) internal_function; void _nl_unload_domain PARAMS ((struct loaded_domain *__domain)) internal_function; const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file, struct loaded_domain *__domain, struct binding *__domainbinding)) internal_function; void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain)) internal_function; char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, size_t *lengthp)) internal_function; #ifdef _LIBC extern char *__gettext PARAMS ((const char *__msgid)); extern char *__dgettext PARAMS ((const char *__domainname, const char *__msgid)); extern char *__dcgettext PARAMS ((const char *__domainname, const char *__msgid, int __category)); extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2, unsigned long int __n)); extern char *__dngettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int n)); extern char *__dcngettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category)); extern char *__dcigettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category)); extern char *__textdomain PARAMS ((const char *__domainname)); extern char *__bindtextdomain PARAMS ((const char *__domainname, const char *__dirname)); extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname, const char *__codeset)); #else extern char *libintl_gettext PARAMS ((const char *__msgid)); extern char *libintl_dgettext PARAMS ((const char *__domainname, const char *__msgid)); extern char *libintl_dcgettext PARAMS ((const char *__domainname, const char *__msgid, int __category)); extern char *libintl_ngettext PARAMS ((const char *__msgid1, const char *__msgid2, unsigned long int __n)); extern char *libintl_dngettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n)); extern char *libintl_dcngettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category)); extern char *libintl_dcigettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category)); extern char *libintl_textdomain PARAMS ((const char *__domainname)); extern char *libintl_bindtextdomain PARAMS ((const char *__domainname, const char *__dirname)); extern char *libintl_bind_textdomain_codeset PARAMS ((const char *__domainname, const char *__codeset)); #endif /* @@ begin of epilog @@ */ #endif /* gettextP.h */ indent-2.2.11/intl/loadinfo.h0000644000177400010010000001373711041664102012712 00000000000000/* Copyright (C) 1996-1999, 2000-2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _LOADINFO_H #define _LOADINFO_H 1 /* Declarations of locale dependent catalog lookup functions. Implemented in localealias.c Possibly replace a locale name by another. explodename.c Split a locale name into its various fields. l10nflist.c Generate a list of filenames of possible message catalogs. finddomain.c Find and open the relevant message catalogs. The main function _nl_find_domain() in finddomain.c is declared in gettextP.h. */ #ifndef PARAMS # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () # endif #endif #ifndef internal_function # define internal_function #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif /* Separator in PATH like lists of pathnames. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define PATH_SEPARATOR ';' #else /* Unix */ # define PATH_SEPARATOR ':' #endif /* Encoding of locale name parts. */ #define CEN_REVISION 1 #define CEN_SPONSOR 2 #define CEN_SPECIAL 4 #define XPG_NORM_CODESET 8 #define XPG_CODESET 16 #define TERRITORY 32 #define CEN_AUDIENCE 64 #define XPG_MODIFIER 128 #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) #define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) struct loaded_l10nfile { const char *filename; int decided; const void *data; struct loaded_l10nfile *next; struct loaded_l10nfile *successor[1]; }; /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ extern const char *_nl_normalize_codeset PARAMS ((const char *codeset, size_t name_len)); /* Lookup a locale dependent file. *L10NFILE_LIST denotes a pool of lookup results of locale dependent files of the same kind, sorted in decreasing order of ->filename. DIRLIST and DIRLIST_LEN are an argz list of directories in which to look, containing at least one directory (i.e. DIRLIST_LEN > 0). MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER, SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as produced by _nl_explode_name(). FILENAME is the filename suffix. The return value is the lookup result, either found in *L10NFILE_LIST, or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL. If the return value is non-NULL, it is added to *L10NFILE_LIST, and its ->next field denotes the chaining inside *L10NFILE_LIST, and furthermore its ->successor[] field contains a list of other lookup results from which this lookup result inherits. */ extern struct loaded_l10nfile * _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *special, const char *sponsor, const char *revision, const char *filename, int do_allocate)); /* Lookup the real locale name for a locale alias NAME, or NULL if NAME is not a locale alias (but possibly a real locale name). The return value is statically allocated and must not be freed. */ extern const char *_nl_expand_alias PARAMS ((const char *name)); /* Split a locale name NAME into its pieces: language, modifier, territory, codeset, special, sponsor, revision. NAME gets destructively modified: NUL bytes are inserted here and there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY, *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a pointer into the old NAME string, or NULL. *NORMALIZED_CODESET gets assigned the expanded *CODESET, if it is different from *CODESET; this one is dynamically allocated and has to be freed by the caller. The return value is a bitmask, where each bit corresponds to one filled-in value: XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER, TERRITORY for *TERRITORY, XPG_CODESET for *CODESET, XPG_NORM_CODESET for *NORMALIZED_CODESET, CEN_SPECIAL for *SPECIAL, CEN_SPONSOR for *SPONSOR, CEN_REVISION for *REVISION. */ extern int _nl_explode_name PARAMS ((char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset, const char **special, const char **sponsor, const char **revision)); /* Split a locale name NAME into a leading language part and all the rest. Return a pointer to the first character after the language, i.e. to the first byte of the rest. */ extern char *_nl_find_language PARAMS ((const char *name)); #endif /* loadinfo.h */ indent-2.2.11/intl/localealias.c0000644000177400010010000002330311041664102013351 00000000000000/* Handle aliases for locale names. Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #if defined _LIBC || defined HAVE___FSETLOCKING # include #endif #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif #endif #include #include #include "gettextP.h" /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define strcasecmp __strcasecmp # ifndef mempcpy # define mempcpy __mempcpy # endif # define HAVE_MEMPCPY 1 # define HAVE___FSETLOCKING 1 /* We need locking here since we can be called from different places. */ # include __libc_lock_define_initialized (static, lock); #endif #ifndef internal_function # define internal_function #endif /* Some optimizations for glibc. */ #ifdef _LIBC # define FEOF(fp) feof_unlocked (fp) # define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp) #else # define FEOF(fp) feof (fp) # define FGETS(buf, n, fp) fgets (buf, n, fp) #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif #if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED # undef fgets # define fgets(buf, len, s) fgets_unlocked (buf, len, s) #endif #if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED # undef feof # define feof(s) feof_unlocked (s) #endif struct alias_map { const char *alias; const char *value; }; static char *string_space; static size_t string_space_act; static size_t string_space_max; static struct alias_map *map; static size_t nmap; static size_t maxmap; /* Prototypes for local functions. */ static size_t read_alias_file PARAMS ((const char *fname, int fname_len)) internal_function; static int extend_alias_table PARAMS ((void)); static int alias_compare PARAMS ((const struct alias_map *map1, const struct alias_map *map2)); const char * _nl_expand_alias (name) const char *name; { static const char *locale_alias_path; struct alias_map *retval; const char *result = NULL; size_t added; #ifdef _LIBC __libc_lock_lock (lock); #endif if (locale_alias_path == NULL) locale_alias_path = LOCALE_ALIAS_PATH; do { struct alias_map item; item.alias = name; if (nmap > 0) retval = (struct alias_map *) bsearch (&item, map, nmap, sizeof (struct alias_map), (int (*) PARAMS ((const void *, const void *)) ) alias_compare); else retval = NULL; /* We really found an alias. Return the value. */ if (retval != NULL) { result = retval->value; break; } /* Perhaps we can find another alias file. */ added = 0; while (added == 0 && locale_alias_path[0] != '\0') { const char *start; while (locale_alias_path[0] == PATH_SEPARATOR) ++locale_alias_path; start = locale_alias_path; while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR) ++locale_alias_path; if (start < locale_alias_path) added = read_alias_file (start, locale_alias_path - start); } } while (added != 0); #ifdef _LIBC __libc_lock_unlock (lock); #endif return result; } static size_t internal_function read_alias_file (fname, fname_len) const char *fname; int fname_len; { FILE *fp; char *full_fname; size_t added; static const char aliasfile[] = "/locale.alias"; full_fname = (char *) alloca (fname_len + sizeof aliasfile); #ifdef HAVE_MEMPCPY mempcpy (mempcpy (full_fname, fname, fname_len), aliasfile, sizeof aliasfile); #else memcpy (full_fname, fname, fname_len); memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); #endif fp = fopen (full_fname, "r"); freea (full_fname); if (fp == NULL) return 0; #ifdef HAVE___FSETLOCKING /* No threads present. */ __fsetlocking (fp, FSETLOCKING_BYCALLER); #endif added = 0; while (!FEOF (fp)) { /* It is a reasonable approach to use a fix buffer here because a) we are only interested in the first two fields b) these fields must be usable as file names and so must not be that long */ char buf[BUFSIZ]; char *alias; char *value; char *cp; if (FGETS (buf, sizeof buf, fp) == NULL) /* EOF reached. */ break; /* Possibly not the whole line fits into the buffer. Ignore the rest of the line. */ if (strchr (buf, '\n') == NULL) { char altbuf[BUFSIZ]; do if (FGETS (altbuf, sizeof altbuf, fp) == NULL) /* Make sure the inner loop will be left. The outer loop will exit at the `feof' test. */ break; while (strchr (altbuf, '\n') == NULL); } cp = buf; /* Ignore leading white space. */ while (isspace ((unsigned char) cp[0])) ++cp; /* A leading '#' signals a comment line. */ if (cp[0] != '\0' && cp[0] != '#') { alias = cp++; while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) ++cp; /* Terminate alias name. */ if (cp[0] != '\0') *cp++ = '\0'; /* Now look for the beginning of the value. */ while (isspace ((unsigned char) cp[0])) ++cp; if (cp[0] != '\0') { size_t alias_len; size_t value_len; value = cp++; while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) ++cp; /* Terminate value. */ if (cp[0] == '\n') { /* This has to be done to make the following test for the end of line possible. We are looking for the terminating '\n' which do not overwrite here. */ *cp++ = '\0'; *cp = '\n'; } else if (cp[0] != '\0') *cp++ = '\0'; if (nmap >= maxmap) if (__builtin_expect (extend_alias_table (), 0)) return added; alias_len = strlen (alias) + 1; value_len = strlen (value) + 1; if (string_space_act + alias_len + value_len > string_space_max) { /* Increase size of memory pool. */ size_t new_size = (string_space_max + (alias_len + value_len > 1024 ? alias_len + value_len : 1024)); char *new_pool = (char *) realloc (string_space, new_size); if (new_pool == NULL) return added; if (__builtin_expect (string_space != new_pool, 0)) { size_t i; for (i = 0; i < nmap; i++) { map[i].alias += new_pool - string_space; map[i].value += new_pool - string_space; } } string_space = new_pool; string_space_max = new_size; } map[nmap].alias = memcpy (&string_space[string_space_act], alias, alias_len); string_space_act += alias_len; map[nmap].value = memcpy (&string_space[string_space_act], value, value_len); string_space_act += value_len; ++nmap; ++added; } } } /* Should we test for ferror()? I think we have to silently ignore errors. --drepper */ fclose (fp); if (added > 0) qsort (map, nmap, sizeof (struct alias_map), (int (*) PARAMS ((const void *, const void *))) alias_compare); return added; } static int extend_alias_table () { size_t new_size; struct alias_map *new_map; new_size = maxmap == 0 ? 100 : 2 * maxmap; new_map = (struct alias_map *) realloc (map, (new_size * sizeof (struct alias_map))); if (new_map == NULL) /* Simply don't extend: we don't have any more core. */ return -1; map = new_map; maxmap = new_size; return 0; } #ifdef _LIBC static void __attribute__ ((unused)) free_mem (void) { if (string_space != NULL) free (string_space); if (map != NULL) free (map); } text_set_element (__libc_subfreeres, free_mem); #endif static int alias_compare (map1, map2) const struct alias_map *map1; const struct alias_map *map2; { #if defined _LIBC || defined HAVE_STRCASECMP return strcasecmp (map1->alias, map2->alias); #else const unsigned char *p1 = (const unsigned char *) map1->alias; const unsigned char *p2 = (const unsigned char *) map2->alias; unsigned char c1, c2; if (p1 == p2) return 0; do { /* I know this seems to be odd but the tolower() function in some systems libc cannot handle nonalpha characters. */ c1 = isupper (*p1) ? tolower (*p1) : *p1; c2 = isupper (*p2) ? tolower (*p2) : *p2; if (c1 == '\0') break; ++p1; ++p2; } while (c1 == c2); return c1 - c2; #endif } indent-2.2.11/intl/dcigettext.c0000644000177400010010000010034411041664102013245 00000000000000/* Implementation of the internal dcigettext function. Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif #endif #include #ifndef errno extern int errno; #endif #ifndef __set_errno # define __set_errno(val) errno = (val) #endif #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include #ifdef _LIBC /* Guess whether integer division by zero raises signal SIGFPE. Set to 1 only if you know for sure. In case of doubt, set to 0. */ # if defined __alpha__ || defined __arm__ || defined __i386__ \ || defined __m68k__ || defined __s390__ # define INTDIV0_RAISES_SIGFPE 1 # else # define INTDIV0_RAISES_SIGFPE 0 # endif #endif #if !INTDIV0_RAISES_SIGFPE # include #endif #if defined HAVE_SYS_PARAM_H || defined _LIBC # include #endif #include "gettextP.h" #include "plural-exp.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "hash-string.h" /* Thread safetyness. */ #ifdef _LIBC # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_lock_define_initialized(CLASS, NAME) # define __libc_lock_lock(NAME) # define __libc_lock_unlock(NAME) # define __libc_rwlock_define_initialized(CLASS, NAME) # define __libc_rwlock_rdlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* Alignment of types. */ #if defined __GNUC__ && __GNUC__ >= 2 # define alignof(TYPE) __alignof__ (TYPE) #else # define alignof(TYPE) \ ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain libintl_nl_default_default_domain # define _nl_current_default_domain libintl_nl_current_default_domain # define _nl_default_dirname libintl_nl_default_dirname # define _nl_domain_bindings libintl_nl_domain_bindings #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define getcwd __getcwd # ifndef stpcpy # define stpcpy __stpcpy # endif # define tfind __tfind #else # if !defined HAVE_GETCWD char *getwd (); # define getcwd(buf, max) getwd (buf) # else char *getcwd (); # endif # ifndef HAVE_STPCPY static char *stpcpy PARAMS ((char *dest, const char *src)); # endif # ifndef HAVE_MEMPCPY static void *mempcpy PARAMS ((void *dest, const void *src, size_t n)); # endif #endif /* Amount to increase buffer size by in each try. */ #define PATH_INCR 32 /* The following is from pathmax.h. */ /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define PATH_MAX but might cause redefinition warnings when sys/param.h is later included (as on MORE/BSD 4.3). */ #if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__) # include #endif #ifndef _POSIX_PATH_MAX # define _POSIX_PATH_MAX 255 #endif #if !defined PATH_MAX && defined _PC_PATH_MAX # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) #endif /* Don't include sys/param.h if it already has been. */ #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN # include #endif #if !defined PATH_MAX && defined MAXPATHLEN # define PATH_MAX MAXPATHLEN #endif #ifndef PATH_MAX # define PATH_MAX _POSIX_PATH_MAX #endif /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) #endif /* This is the type used for the search tree where known translations are stored. */ struct known_translation_t { /* Domain in which to search. */ char *domainname; /* The category. */ int category; /* State of the catalog counter at the point the string was found. */ int counter; /* Catalog where the string was found. */ struct loaded_l10nfile *domain; /* And finally the translation. */ const char *translation; size_t translation_length; /* Pointer to the string in question. */ char msgid[ZERO]; }; /* Root of the search tree with known translations. We can use this only if the system provides the `tsearch' function family. */ #if defined HAVE_TSEARCH || defined _LIBC # include static void *root; # ifdef _LIBC # define tsearch __tsearch # endif /* Function to compare two entries in the table of known translations. */ static int transcmp PARAMS ((const void *p1, const void *p2)); static int transcmp (p1, p2) const void *p1; const void *p2; { const struct known_translation_t *s1; const struct known_translation_t *s2; int result; s1 = (const struct known_translation_t *) p1; s2 = (const struct known_translation_t *) p2; result = strcmp (s1->msgid, s2->msgid); if (result == 0) { result = strcmp (s1->domainname, s2->domainname); if (result == 0) /* We compare the category last (though this is the cheapest operation) since it is hopefully always the same (namely LC_MESSAGES). */ result = s1->category - s2->category; } return result; } #endif /* Name of the default domain used for gettext(3) prior any call to textdomain(3). The default value for this is "messages". */ const char _nl_default_default_domain[] attribute_hidden = "messages"; /* Value used as the default domain for gettext(3). */ const char *_nl_current_default_domain attribute_hidden = _nl_default_default_domain; /* Contains the default location of the message catalogs. */ #if defined __EMX__ extern const char _nl_default_dirname[]; #else const char _nl_default_dirname[] = LOCALEDIR; #endif /* List with bindings of specific domains created by bindtextdomain() calls. */ struct binding *_nl_domain_bindings; /* Prototypes for local functions. */ static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len)) internal_function; static const char *category_to_name PARAMS ((int category)) internal_function; static const char *guess_category_value PARAMS ((int category, const char *categoryname)) internal_function; /* For those loosing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA /* Nothing has to be done. */ # define freea(p) /* nothing */ # define ADD_BLOCK(list, address) /* nothing */ # define FREE_BLOCKS(list) /* nothing */ #else struct block_list { void *address; struct block_list *next; }; # define ADD_BLOCK(list, addr) \ do { \ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ /* If we cannot get a free block we cannot add the new element to \ the list. */ \ if (newp != NULL) { \ newp->address = (addr); \ newp->next = (list); \ (list) = newp; \ } \ } while (0) # define FREE_BLOCKS(list) \ do { \ while (list != NULL) { \ struct block_list *old = list; \ list = list->next; \ free (old->address); \ free (old); \ } \ } while (0) # undef alloca # define alloca(size) (malloc (size)) # define freea(p) free (p) #endif /* have alloca */ #ifdef _LIBC /* List of blocks allocated for translations. */ typedef struct transmem_list { struct transmem_list *next; char data[ZERO]; } transmem_block_t; static struct transmem_list *transmem_list; #else typedef unsigned char transmem_block_t; #endif /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCIGETTEXT __dcigettext #else # define DCIGETTEXT libintl_dcigettext #endif /* Lock variable to protect the global data in the gettext implementation. */ #ifdef _LIBC __libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden) #endif /* Checking whether the binaries runs SUID must be done and glibc provides easier methods therefore we make a difference here. */ #ifdef _LIBC # define ENABLE_SECURE __libc_enable_secure # define DETERMINE_SECURE #else # ifndef HAVE_GETUID # define getuid() 0 # endif # ifndef HAVE_GETGID # define getgid() 0 # endif # ifndef HAVE_GETEUID # define geteuid() getuid() # endif # ifndef HAVE_GETEGID # define getegid() getgid() # endif static int enable_secure; # define ENABLE_SECURE (enable_secure == 1) # define DETERMINE_SECURE \ if (enable_secure == 0) \ { \ if (getuid () != geteuid () || getgid () != getegid ()) \ enable_secure = 1; \ else \ enable_secure = -1; \ } #endif /* Get the function to evaluate the plural expression. */ #include "eval-plural.h" /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale and, if PLURAL is nonzero, search over string depending on the plural form determined by N. */ char * DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) const char *domainname; const char *msgid1; const char *msgid2; int plural; unsigned long int n; int category; { #ifndef HAVE_ALLOCA struct block_list *block_list = NULL; #endif struct loaded_l10nfile *domain; struct binding *binding; const char *categoryname; const char *categoryvalue; char *dirname, *xdomainname; char *single_locale; char *retval; size_t retlen; int saved_errno; #if defined HAVE_TSEARCH || defined _LIBC struct known_translation_t *search; struct known_translation_t **foundp = NULL; size_t msgid_len; #endif size_t domainname_len; /* If no real MSGID is given return NULL. */ if (msgid1 == NULL) return NULL; __libc_rwlock_rdlock (_nl_state_lock); /* If DOMAINNAME is NULL, we are interested in the default domain. If CATEGORY is not LC_MESSAGES this might not make much sense but the definition left this undefined. */ if (domainname == NULL) domainname = _nl_current_default_domain; /* OS/2 specific: backward compatibility with older libintl versions */ #ifdef LC_MESSAGES_COMPAT if (category == LC_MESSAGES_COMPAT) category = LC_MESSAGES; #endif #if defined HAVE_TSEARCH || defined _LIBC msgid_len = strlen (msgid1) + 1; /* Try to find the translation among those which we found at some time. */ search = (struct known_translation_t *) alloca (offsetof (struct known_translation_t, msgid) + msgid_len); memcpy (search->msgid, msgid1, msgid_len); search->domainname = (char *) domainname; search->category = category; foundp = (struct known_translation_t **) tfind (search, &root, transcmp); freea (search); if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr) { /* Now deal with plural. */ if (plural) retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation, (*foundp)->translation_length); else retval = (char *) (*foundp)->translation; __libc_rwlock_unlock (_nl_state_lock); return retval; } #endif /* Preserve the `errno' value. */ saved_errno = errno; /* See whether this is a SUID binary or not. */ DETERMINE_SECURE; /* First find matching binding. */ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding == NULL) dirname = (char *) _nl_default_dirname; else if (IS_ABSOLUTE_PATH (binding->dirname)) dirname = binding->dirname; else { /* We have a relative path. Make it absolute now. */ size_t dirname_len = strlen (binding->dirname) + 1; size_t path_max; char *ret; path_max = (unsigned int) PATH_MAX; path_max += 2; /* The getcwd docs say to do this. */ for (;;) { dirname = (char *) alloca (path_max + dirname_len); ADD_BLOCK (block_list, dirname); __set_errno (0); ret = getcwd (dirname, path_max); if (ret != NULL || errno != ERANGE) break; path_max += path_max / 2; path_max += PATH_INCR; } if (ret == NULL) { /* We cannot get the current working directory. Don't signal an error but simply return the default string. */ FREE_BLOCKS (block_list); __libc_rwlock_unlock (_nl_state_lock); __set_errno (saved_errno); return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); } stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); } /* Now determine the symbolic name of CATEGORY and its value. */ categoryname = category_to_name (category); categoryvalue = guess_category_value (category, categoryname); domainname_len = strlen (domainname); xdomainname = (char *) alloca (strlen (categoryname) + domainname_len + 5); ADD_BLOCK (block_list, xdomainname); stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), domainname, domainname_len), ".mo"); /* Creating working area. */ single_locale = (char *) alloca (strlen (categoryvalue) + 1); ADD_BLOCK (block_list, single_locale); /* Search for the given string. This is a loop because we perhaps got an ordered list of languages to consider for the translation. */ while (1) { /* Make CATEGORYVALUE point to the next element of the list. */ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') ++categoryvalue; if (categoryvalue[0] == '\0') { /* The whole contents of CATEGORYVALUE has been searched but no valid entry has been found. We solve this situation by implicitly appending a "C" entry, i.e. no translation will take place. */ single_locale[0] = 'C'; single_locale[1] = '\0'; } else { char *cp = single_locale; while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') *cp++ = *categoryvalue++; *cp = '\0'; /* When this is a SUID binary we must not allow accessing files outside the dedicated directories. */ if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale)) /* Ingore this entry. */ continue; } /* If the current locale value is C (or POSIX) we don't load a domain. Return the MSGID. */ if (strcmp (single_locale, "C") == 0 || strcmp (single_locale, "POSIX") == 0) { FREE_BLOCKS (block_list); __libc_rwlock_unlock (_nl_state_lock); __set_errno (saved_errno); return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); } /* Find structure describing the message catalog matching the DOMAINNAME and CATEGORY. */ domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); if (domain != NULL) { retval = _nl_find_msg (domain, binding, msgid1, &retlen); if (retval == NULL) { int cnt; for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) { retval = _nl_find_msg (domain->successor[cnt], binding, msgid1, &retlen); if (retval != NULL) { domain = domain->successor[cnt]; break; } } } if (retval != NULL) { /* Found the translation of MSGID1 in domain DOMAIN: starting at RETVAL, RETLEN bytes. */ FREE_BLOCKS (block_list); __set_errno (saved_errno); #if defined HAVE_TSEARCH || defined _LIBC if (foundp == NULL) { /* Create a new entry and add it to the search tree. */ struct known_translation_t *newp; newp = (struct known_translation_t *) malloc (offsetof (struct known_translation_t, msgid) + msgid_len + domainname_len + 1); if (newp != NULL) { newp->domainname = mempcpy (newp->msgid, msgid1, msgid_len); memcpy (newp->domainname, domainname, domainname_len + 1); newp->category = category; newp->counter = _nl_msg_cat_cntr; newp->domain = domain; newp->translation = retval; newp->translation_length = retlen; /* Insert the entry in the search tree. */ foundp = (struct known_translation_t **) tsearch (newp, &root, transcmp); if (foundp == NULL || __builtin_expect (*foundp != newp, 0)) /* The insert failed. */ free (newp); } } else { /* We can update the existing entry. */ (*foundp)->counter = _nl_msg_cat_cntr; (*foundp)->domain = domain; (*foundp)->translation = retval; (*foundp)->translation_length = retlen; } #endif /* Now deal with plural. */ if (plural) retval = plural_lookup (domain, n, retval, retlen); __libc_rwlock_unlock (_nl_state_lock); return retval; } } } /* NOTREACHED */ } char * internal_function _nl_find_msg (domain_file, domainbinding, msgid, lengthp) struct loaded_l10nfile *domain_file; struct binding *domainbinding; const char *msgid; size_t *lengthp; { struct loaded_domain *domain; nls_uint32 nstrings; size_t act; char *result; size_t resultlen; if (domain_file->decided == 0) _nl_load_domain (domain_file, domainbinding); if (domain_file->data == NULL) return NULL; domain = (struct loaded_domain *) domain_file->data; nstrings = domain->nstrings; /* Locate the MSGID and its translation. */ if (domain->hash_tab != NULL) { /* Use the hashing table. */ nls_uint32 len = strlen (msgid); nls_uint32 hash_val = hash_string (msgid); nls_uint32 idx = hash_val % domain->hash_size; nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); while (1) { nls_uint32 nstr = W (domain->must_swap_hash_tab, domain->hash_tab[idx]); if (nstr == 0) /* Hash table entry is empty. */ return NULL; nstr--; /* Compare msgid with the original string at index nstr. We compare the lengths with >=, not ==, because plural entries are represented by strings with an embedded NUL. */ if (nstr < nstrings ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len && (strcmp (msgid, domain->data + W (domain->must_swap, domain->orig_tab[nstr].offset)) == 0) : domain->orig_sysdep_tab[nstr - nstrings].length > len && (strcmp (msgid, domain->orig_sysdep_tab[nstr - nstrings].pointer) == 0)) { act = nstr; goto found; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } /* NOTREACHED */ } else { /* Try the default method: binary search in the sorted array of messages. */ size_t top, bottom; bottom = 0; top = nstrings; while (bottom < top) { int cmp_val; act = (bottom + top) / 2; cmp_val = strcmp (msgid, (domain->data + W (domain->must_swap, domain->orig_tab[act].offset))); if (cmp_val < 0) top = act; else if (cmp_val > 0) bottom = act + 1; else goto found; } /* No translation was found. */ return NULL; } found: /* The translation was found at index ACT. If we have to convert the string to use a different character set, this is the time. */ if (act < nstrings) { result = (char *) (domain->data + W (domain->must_swap, domain->trans_tab[act].offset)); resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1; } else { result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer; resultlen = domain->trans_sysdep_tab[act - nstrings].length; } #if defined _LIBC || HAVE_ICONV if (domain->codeset_cntr != (domainbinding != NULL ? domainbinding->codeset_cntr : 0)) { /* The domain's codeset has changed through bind_textdomain_codeset() since the message catalog was initialized or last accessed. We have to reinitialize the converter. */ _nl_free_domain_conv (domain); _nl_init_domain_conv (domain_file, domain, domainbinding); } if ( # ifdef _LIBC domain->conv != (__gconv_t) -1 # else # if HAVE_ICONV domain->conv != (iconv_t) -1 # endif # endif ) { /* We are supposed to do a conversion. First allocate an appropriate table with the same structure as the table of translations in the file, where we can put the pointers to the converted strings in. There is a slight complication with plural entries. They are represented by consecutive NUL terminated strings. We handle this case by converting RESULTLEN bytes, including NULs. */ if (domain->conv_tab == NULL && ((domain->conv_tab = (char **) calloc (nstrings + domain->n_sysdep_strings, sizeof (char *))) == NULL)) /* Mark that we didn't succeed allocating a table. */ domain->conv_tab = (char **) -1; if (__builtin_expect (domain->conv_tab == (char **) -1, 0)) /* Nothing we can do, no more memory. */ goto converted; if (domain->conv_tab[act] == NULL) { /* We haven't used this string so far, so it is not translated yet. Do this now. */ /* We use a bit more efficient memory handling. We allocate always larger blocks which get used over time. This is faster than many small allocations. */ __libc_lock_define_initialized (static, lock) # define INITIAL_BLOCK_SIZE 4080 static unsigned char *freemem; static size_t freemem_size; const unsigned char *inbuf; unsigned char *outbuf; int malloc_count; # ifndef _LIBC transmem_block_t *transmem_list = NULL; # endif __libc_lock_lock (lock); inbuf = (const unsigned char *) result; outbuf = freemem + sizeof (size_t); malloc_count = 0; while (1) { transmem_block_t *newmem; # ifdef _LIBC size_t non_reversible; int res; if (freemem_size < sizeof (size_t)) goto resize_freemem; res = __gconv (domain->conv, &inbuf, inbuf + resultlen, &outbuf, outbuf + freemem_size - sizeof (size_t), &non_reversible); if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT) break; if (res != __GCONV_FULL_OUTPUT) { __libc_lock_unlock (lock); goto converted; } inbuf = result; # else # if HAVE_ICONV const char *inptr = (const char *) inbuf; size_t inleft = resultlen; char *outptr = (char *) outbuf; size_t outleft; if (freemem_size < sizeof (size_t)) goto resize_freemem; outleft = freemem_size - sizeof (size_t); if (iconv (domain->conv, (ICONV_CONST char **) &inptr, &inleft, &outptr, &outleft) != (size_t) (-1)) { outbuf = (unsigned char *) outptr; break; } if (errno != E2BIG) { __libc_lock_unlock (lock); goto converted; } # endif # endif resize_freemem: /* We must allocate a new buffer or resize the old one. */ if (malloc_count > 0) { ++malloc_count; freemem_size = malloc_count * INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) realloc (transmem_list, freemem_size); # ifdef _LIBC if (newmem != NULL) transmem_list = transmem_list->next; else { struct transmem_list *old = transmem_list; transmem_list = transmem_list->next; free (old); } # endif } else { malloc_count = 1; freemem_size = INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) malloc (freemem_size); } if (__builtin_expect (newmem == NULL, 0)) { freemem = NULL; freemem_size = 0; __libc_lock_unlock (lock); goto converted; } # ifdef _LIBC /* Add the block to the list of blocks we have to free at some point. */ newmem->next = transmem_list; transmem_list = newmem; freemem = newmem->data; freemem_size -= offsetof (struct transmem_list, data); # else transmem_list = newmem; freemem = newmem; # endif outbuf = freemem + sizeof (size_t); } /* We have now in our buffer a converted string. Put this into the table of conversions. */ *(size_t *) freemem = outbuf - freemem - sizeof (size_t); domain->conv_tab[act] = (char *) freemem; /* Shrink freemem, but keep it aligned. */ freemem_size -= outbuf - freemem; freemem = outbuf; freemem += freemem_size & (alignof (size_t) - 1); freemem_size = freemem_size & ~ (alignof (size_t) - 1); __libc_lock_unlock (lock); } /* Now domain->conv_tab[act] contains the translation of all the plural variants. */ result = domain->conv_tab[act] + sizeof (size_t); resultlen = *(size_t *) domain->conv_tab[act]; } converted: /* The result string is converted. */ #endif /* _LIBC || HAVE_ICONV */ *lengthp = resultlen; return result; } /* Look up a plural variant. */ static char * internal_function plural_lookup (domain, n, translation, translation_len) struct loaded_l10nfile *domain; unsigned long int n; const char *translation; size_t translation_len; { struct loaded_domain *domaindata = (struct loaded_domain *) domain->data; unsigned long int index; const char *p; index = plural_eval (domaindata->plural, n); if (index >= domaindata->nplurals) /* This should never happen. It means the plural expression and the given maximum value do not match. */ index = 0; /* Skip INDEX strings at TRANSLATION. */ p = translation; while (index-- > 0) { #ifdef _LIBC p = __rawmemchr (p, '\0'); #else p = strchr (p, '\0'); #endif /* And skip over the NUL byte. */ p++; if (p >= translation + translation_len) /* This should never happen. It means the plural expression evaluated to a value larger than the number of variants available for MSGID1. */ return (char *) translation; } return (char *) p; } /* Return string representation of locale CATEGORY. */ static const char * internal_function category_to_name (category) int category; { const char *retval; switch (category) { #ifdef LC_COLLATE case LC_COLLATE: retval = "LC_COLLATE"; break; #endif #ifdef LC_CTYPE case LC_CTYPE: retval = "LC_CTYPE"; break; #endif #ifdef LC_MONETARY case LC_MONETARY: retval = "LC_MONETARY"; break; #endif #ifdef LC_NUMERIC case LC_NUMERIC: retval = "LC_NUMERIC"; break; #endif #ifdef LC_TIME case LC_TIME: retval = "LC_TIME"; break; #endif #ifdef LC_MESSAGES case LC_MESSAGES: retval = "LC_MESSAGES"; break; #endif #ifdef LC_RESPONSE case LC_RESPONSE: retval = "LC_RESPONSE"; break; #endif #ifdef LC_ALL case LC_ALL: /* This might not make sense but is perhaps better than any other value. */ retval = "LC_ALL"; break; #endif default: /* If you have a better idea for a default value let me know. */ retval = "LC_XXX"; } return retval; } /* Guess value of current locale from value of the environment variables. */ static const char * internal_function guess_category_value (category, categoryname) int category; const char *categoryname; { const char *language; const char *retval; /* The highest priority value is the `LANGUAGE' environment variable. But we don't use the value if the currently selected locale is the C locale. This is a GNU extension. */ language = getenv ("LANGUAGE"); if (language != NULL && language[0] == '\0') language = NULL; /* We have to proceed with the POSIX methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some systems this can be done by the `setlocale' function itself. */ #ifdef _LIBC retval = setlocale (category, NULL); #else retval = _nl_locale_name (category, categoryname); #endif /* Ignore LANGUAGE if the locale is set to "C" because 1. "C" locale usually uses the ASCII encoding, and most international messages use non-ASCII characters. These characters get displayed as question marks (if using glibc's iconv()) or as invalid 8-bit characters (because other iconv()s refuse to convert most non-ASCII characters to ASCII). In any case, the output is ugly. 2. The precise output of some programs in the "C" locale is specified by POSIX and should not depend on environment variables like "LANGUAGE". We allow such programs to use gettext(). */ return language != NULL && strcmp (retval, "C") != 0 ? language : retval; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (dest, src) char *dest; const char *src; { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif #if !_LIBC && !HAVE_MEMPCPY static void * mempcpy (dest, src, n) void *dest; const void *src; size_t n; { return (void *) ((char *) memcpy (dest, src, n) + n); } #endif #ifdef _LIBC /* If we want to free all resources we have to do some work at program's end. */ static void __attribute__ ((unused)) free_mem (void) { void *old; while (_nl_domain_bindings != NULL) { struct binding *oldp = _nl_domain_bindings; _nl_domain_bindings = _nl_domain_bindings->next; if (oldp->dirname != _nl_default_dirname) /* Yes, this is a pointer comparison. */ free (oldp->dirname); free (oldp->codeset); free (oldp); } if (_nl_current_default_domain != _nl_default_default_domain) /* Yes, again a pointer comparison. */ free ((char *) _nl_current_default_domain); /* Remove the search tree with the known translations. */ __tdestroy (root, free); root = NULL; while (transmem_list != NULL) { old = transmem_list; transmem_list = transmem_list->next; free (old); } } text_set_element (__libc_subfreeres, free_mem); #endif indent-2.2.11/intl/dgettext.c0000644000177400010010000000343011041664102012727 00000000000000/* Implementation of the dgettext(3) function. Copyright (C) 1995-1997, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DGETTEXT __dgettext # define DCGETTEXT INTUSE(__dcgettext) #else # define DGETTEXT libintl_dgettext # define DCGETTEXT libintl_dcgettext #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale. */ char * DGETTEXT (domainname, msgid) const char *domainname; const char *msgid; { return DCGETTEXT (domainname, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dgettext, dgettext); #endif indent-2.2.11/intl/plural-exp.h0000644000177400010010000001030411041664102013173 00000000000000/* Expression parsing and evaluation for plural form selection. Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _PLURAL_EXP_H #define _PLURAL_EXP_H #ifndef PARAMS # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () # endif #endif #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif /* This is the representation of the expressions to determine the plural form. */ struct expression { int nargs; /* Number of arguments. */ enum operator { /* Without arguments: */ var, /* The variable "n". */ num, /* Decimal number. */ /* Unary operators: */ lnot, /* Logical NOT. */ /* Binary operators: */ mult, /* Multiplication. */ divide, /* Division. */ module, /* Modulo operation. */ plus, /* Addition. */ minus, /* Subtraction. */ less_than, /* Comparison. */ greater_than, /* Comparison. */ less_or_equal, /* Comparison. */ greater_or_equal, /* Comparison. */ equal, /* Comparison for equality. */ not_equal, /* Comparison for inequality. */ land, /* Logical AND. */ lor, /* Logical OR. */ /* Ternary operators: */ qmop /* Question mark operator. */ } operation; union { unsigned long int num; /* Number value for `num'. */ struct expression *args[3]; /* Up to three arguments. */ } val; }; /* This is the data structure to pass information to the parser and get the result in a thread-safe way. */ struct parse_args { const char *cp; struct expression *res; }; /* Names for the libintl functions are a problem. This source code is used 1. in the GNU C Library library, 2. in the GNU libintl library, 3. in the GNU gettext tools. The function names in each situation must be different, to allow for binary incompatible changes in 'struct expression'. Furthermore, 1. in the GNU C Library library, the names have a __ prefix, 2.+3. in the GNU libintl library and in the GNU gettext tools, the names must follow ANSI C and not start with __. So we have to distinguish the three cases. */ #ifdef _LIBC # define FREE_EXPRESSION __gettext_free_exp # define PLURAL_PARSE __gettextparse # define GERMANIC_PLURAL __gettext_germanic_plural # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural #elif defined (IN_LIBINTL) # define FREE_EXPRESSION libintl_gettext_free_exp # define PLURAL_PARSE libintl_gettextparse # define GERMANIC_PLURAL libintl_gettext_germanic_plural # define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural #else # define FREE_EXPRESSION free_plural_expression # define PLURAL_PARSE parse_plural_expression # define GERMANIC_PLURAL germanic_plural # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression #endif extern void FREE_EXPRESSION PARAMS ((struct expression *exp)) internal_function; extern int PLURAL_PARSE PARAMS ((void *arg)); extern struct expression GERMANIC_PLURAL attribute_hidden; extern void EXTRACT_PLURAL_EXPRESSION PARAMS ((const char *nullentry, struct expression **pluralp, unsigned long int *npluralsp)) internal_function; #if !defined (_LIBC) && !defined (IN_LIBINTL) extern unsigned long int plural_eval PARAMS ((struct expression *pexp, unsigned long int n)); #endif #endif /* _PLURAL_EXP_H */ indent-2.2.11/intl/os2compat.h0000644000177400010010000000302211041664102013010 00000000000000/* OS/2 compatibility defines. This file is intended to be included from config.h Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* When included from os2compat.h we need all the original definitions */ #ifndef OS2_AWARE #undef LIBDIR #define LIBDIR _nlos2_libdir extern char *_nlos2_libdir; #undef LOCALEDIR #define LOCALEDIR _nlos2_localedir extern char *_nlos2_localedir; #undef LOCALE_ALIAS_PATH #define LOCALE_ALIAS_PATH _nlos2_localealiaspath extern char *_nlos2_localealiaspath; #endif #undef HAVE_STRCASECMP #define HAVE_STRCASECMP 1 #define strcasecmp stricmp #define strncasecmp strnicmp /* We have our own getenv() which works even if library is compiled as DLL */ #define getenv _nl_getenv /* Older versions of gettext used -1 as the value of LC_MESSAGES */ #define LC_MESSAGES_COMPAT (-1) indent-2.2.11/intl/eval-plural.h0000644000177400010010000000554611041664102013342 00000000000000/* Plural expression evaluation. Copyright (C) 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef STATIC #define STATIC static #endif /* Evaluate the plural expression and return an index value. */ STATIC unsigned long int plural_eval PARAMS ((struct expression *pexp, unsigned long int n)) internal_function; STATIC unsigned long int internal_function plural_eval (pexp, n) struct expression *pexp; unsigned long int n; { switch (pexp->nargs) { case 0: switch (pexp->operation) { case var: return n; case num: return pexp->val.num; default: break; } /* NOTREACHED */ break; case 1: { /* pexp->operation must be lnot. */ unsigned long int arg = plural_eval (pexp->val.args[0], n); return ! arg; } case 2: { unsigned long int leftarg = plural_eval (pexp->val.args[0], n); if (pexp->operation == lor) return leftarg || plural_eval (pexp->val.args[1], n); else if (pexp->operation == land) return leftarg && plural_eval (pexp->val.args[1], n); else { unsigned long int rightarg = plural_eval (pexp->val.args[1], n); switch (pexp->operation) { case mult: return leftarg * rightarg; case divide: #if !INTDIV0_RAISES_SIGFPE if (rightarg == 0) raise (SIGFPE); #endif return leftarg / rightarg; case module: #if !INTDIV0_RAISES_SIGFPE if (rightarg == 0) raise (SIGFPE); #endif return leftarg % rightarg; case plus: return leftarg + rightarg; case minus: return leftarg - rightarg; case less_than: return leftarg < rightarg; case greater_than: return leftarg > rightarg; case less_or_equal: return leftarg <= rightarg; case greater_or_equal: return leftarg >= rightarg; case equal: return leftarg == rightarg; case not_equal: return leftarg != rightarg; default: break; } } /* NOTREACHED */ break; } case 3: { /* pexp->operation must be qmop. */ unsigned long int boolarg = plural_eval (pexp->val.args[0], n); return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); } } /* NOTREACHED */ return 0; } indent-2.2.11/intl/bindtextdom.c0000644000177400010010000002324011041664102013421 00000000000000/* Implementation of the bindtextdomain(3) function Copyright (C) 1995-1998, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "gettextP.h" #ifdef _LIBC /* We have to handle multi-threaded applications. */ # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_rwlock_define(CLASS, NAME) # define __libc_rwlock_wrlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_dirname libintl_nl_default_dirname # define _nl_domain_bindings libintl_nl_domain_bindings #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ /* Contains the default location of the message catalogs. */ extern const char _nl_default_dirname[]; /* List with bindings of specific domains. */ extern struct binding *_nl_domain_bindings; /* Lock variable to protect the global data in the gettext implementation. */ __libc_rwlock_define (extern, _nl_state_lock attribute_hidden) /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define BINDTEXTDOMAIN __bindtextdomain # define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define BINDTEXTDOMAIN libintl_bindtextdomain # define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset #endif /* Prototypes for local functions. */ static void set_binding_values PARAMS ((const char *domainname, const char **dirnamep, const char **codesetp)); /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP to be used for the DOMAINNAME message catalog. If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not modified, only the current value is returned. If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither modified nor returned. */ static void set_binding_values (domainname, dirnamep, codesetp) const char *domainname; const char **dirnamep; const char **codesetp; { struct binding *binding; int modified; /* Some sanity checks. */ if (domainname == NULL || domainname[0] == '\0') { if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; return; } __libc_rwlock_wrlock (_nl_state_lock); modified = 0; for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding != NULL) { if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The current binding has be to returned. */ *dirnamep = binding->dirname; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->dirname; if (strcmp (dirname, result) != 0) { if (strcmp (dirname, _nl_default_dirname) == 0) result = (char *) _nl_default_dirname; else { #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, dirname, len); #endif } if (__builtin_expect (result != NULL, 1)) { if (binding->dirname != _nl_default_dirname) free (binding->dirname); binding->dirname = result; modified = 1; } } *dirnamep = result; } } if (codesetp) { const char *codeset = *codesetp; if (codeset == NULL) /* The current binding has be to returned. */ *codesetp = binding->codeset; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->codeset; if (result == NULL || strcmp (codeset, result) != 0) { #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, codeset, len); #endif if (__builtin_expect (result != NULL, 1)) { if (binding->codeset != NULL) free (binding->codeset); binding->codeset = result; binding->codeset_cntr++; modified = 1; } } *codesetp = result; } } } else if ((dirnamep == NULL || *dirnamep == NULL) && (codesetp == NULL || *codesetp == NULL)) { /* Simply return the default values. */ if (dirnamep) *dirnamep = _nl_default_dirname; if (codesetp) *codesetp = NULL; } else { /* We have to create a new binding. */ size_t len = strlen (domainname) + 1; struct binding *new_binding = (struct binding *) malloc (offsetof (struct binding, domainname) + len); if (__builtin_expect (new_binding == NULL, 0)) goto failed; memcpy (new_binding->domainname, domainname, len); if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The default value. */ dirname = _nl_default_dirname; else { if (strcmp (dirname, _nl_default_dirname) == 0) dirname = _nl_default_dirname; else { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; memcpy (result, dirname, len); #endif dirname = result; } } *dirnamep = dirname; new_binding->dirname = (char *) dirname; } else /* The default value. */ new_binding->dirname = (char *) _nl_default_dirname; new_binding->codeset_cntr = 0; if (codesetp) { const char *codeset = *codesetp; if (codeset != NULL) { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; memcpy (result, codeset, len); #endif codeset = result; new_binding->codeset_cntr++; } *codesetp = codeset; new_binding->codeset = (char *) codeset; } else new_binding->codeset = NULL; /* Now enqueue it. */ if (_nl_domain_bindings == NULL || strcmp (domainname, _nl_domain_bindings->domainname) < 0) { new_binding->next = _nl_domain_bindings; _nl_domain_bindings = new_binding; } else { binding = _nl_domain_bindings; while (binding->next != NULL && strcmp (domainname, binding->next->domainname) > 0) binding = binding->next; new_binding->next = binding->next; binding->next = new_binding; } modified = 1; /* Here we deal with memory allocation failures. */ if (0) { failed_codeset: if (new_binding->dirname != _nl_default_dirname) free (new_binding->dirname); failed_dirname: free (new_binding); failed: if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; } } /* If we modified any binding, we flush the caches. */ if (modified) ++_nl_msg_cat_cntr; __libc_rwlock_unlock (_nl_state_lock); } /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ char * BINDTEXTDOMAIN (domainname, dirname) const char *domainname; const char *dirname; { set_binding_values (domainname, &dirname, NULL); return (char *) dirname; } /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ char * BIND_TEXTDOMAIN_CODESET (domainname, codeset) const char *domainname; const char *codeset; { set_binding_values (domainname, NULL, &codeset); return (char *) codeset; } #ifdef _LIBC /* Aliases for function names in GNU C Library. */ weak_alias (__bindtextdomain, bindtextdomain); weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset); #endif indent-2.2.11/intl/libgnuintl.h0000644000177400010010000002435511041664102013264 00000000000000/* Message catalogs for internationalization. Copyright (C) 1995-1997, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 #include /* The LC_MESSAGES locale category is the category used by the functions gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. On systems that don't define it, use an arbitrary value instead. On Solaris, defines __LOCALE_H (or _LOCALE_H in Solaris 2.5) then includes (i.e. this file!) and then only defines LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES in this case. */ #if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun)) # define LC_MESSAGES 1729 #endif /* We define an additional symbol to signal that we use the GNU implementation of gettext. */ #define __USE_GNU_GETTEXT 1 /* Provide information about the supported file formats. Returns the maximum minor revision number supported for a given major revision. */ #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ ((major) == 0 ? 1 : -1) /* Resolve a platform specific conflict on DJGPP. GNU gettext takes precedence over _conio_gettext. */ #ifdef __DJGPP__ # undef gettext #endif /* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers used by programs. Similarly, test __PROTOTYPES, not PROTOTYPES. */ #ifndef _INTL_PARAMS # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define _INTL_PARAMS(args) args # else # define _INTL_PARAMS(args) () # endif #endif #ifdef __cplusplus extern "C" { #endif /* We redirect the functions to those prefixed with "libintl_". This is necessary, because some systems define gettext/textdomain/... in the C library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). If we used the unprefixed names, there would be cases where the definition in the C library would override the one in the libintl.so shared library. Recall that on ELF systems, the symbols are looked up in the following order: 1. in the executable, 2. in the shared libraries specified on the link command line, in order, 3. in the dependencies of the shared libraries specified on the link command line, 4. in the dlopen()ed shared libraries, in the order in which they were dlopen()ed. The definition in the C library would override the one in libintl.so if either * -lc is given on the link command line and -lintl isn't, or * -lc is given on the link command line before -lintl, or * libintl.so is a dependency of a dlopen()ed shared library but not linked to the executable at link time. Since Solaris gettext() behaves differently than GNU gettext(), this would be unacceptable. The redirection happens by default through macros in C, so that &gettext is independent of the compilation unit, but through inline functions in C++, in order not to interfere with the name mangling of class fields or class methods called 'gettext'. */ /* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. If he doesn't, we choose the method. A third possible method is _INTL_REDIRECT_ASM, supported only by GCC. */ #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) # if __GNUC__ >= 2 && (defined __STDC__ || defined __cplusplus) # define _INTL_REDIRECT_ASM # else # ifdef __cplusplus # define _INTL_REDIRECT_INLINE # else # define _INTL_REDIRECT_MACROS # endif # endif #endif /* Auxiliary macros. */ #ifdef _INTL_REDIRECT_ASM # define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) # define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring # define _INTL_STRINGIFY(prefix) #prefix #else # define _INTL_ASM(cname) #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_gettext (const char *__msgid); static inline char *gettext (const char *__msgid) { return libintl_gettext (__msgid); } #else #ifdef _INTL_REDIRECT_MACROS # define gettext libintl_gettext #endif extern char *gettext _INTL_PARAMS ((const char *__msgid)) _INTL_ASM (libintl_gettext); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dgettext (const char *__domainname, const char *__msgid); static inline char *dgettext (const char *__domainname, const char *__msgid) { return libintl_dgettext (__domainname, __msgid); } #else #ifdef _INTL_REDIRECT_MACROS # define dgettext libintl_dgettext #endif extern char *dgettext _INTL_PARAMS ((const char *__domainname, const char *__msgid)) _INTL_ASM (libintl_dgettext); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, int __category); static inline char *dcgettext (const char *__domainname, const char *__msgid, int __category) { return libintl_dcgettext (__domainname, __msgid, __category); } #else #ifdef _INTL_REDIRECT_MACROS # define dcgettext libintl_dcgettext #endif extern char *dcgettext _INTL_PARAMS ((const char *__domainname, const char *__msgid, int __category)) _INTL_ASM (libintl_dcgettext); #endif /* Similar to `gettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n); static inline char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) { return libintl_ngettext (__msgid1, __msgid2, __n); } #else #ifdef _INTL_REDIRECT_MACROS # define ngettext libintl_ngettext #endif extern char *ngettext _INTL_PARAMS ((const char *__msgid1, const char *__msgid2, unsigned long int __n)) _INTL_ASM (libintl_ngettext); #endif /* Similar to `dgettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n); static inline char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) { return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); } #else #ifdef _INTL_REDIRECT_MACROS # define dngettext libintl_dngettext #endif extern char *dngettext _INTL_PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n)) _INTL_ASM (libintl_dngettext); #endif /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category); static inline char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) { return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); } #else #ifdef _INTL_REDIRECT_MACROS # define dcngettext libintl_dcngettext #endif extern char *dcngettext _INTL_PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category)) _INTL_ASM (libintl_dcngettext); #endif /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_textdomain (const char *__domainname); static inline char *textdomain (const char *__domainname) { return libintl_textdomain (__domainname); } #else #ifdef _INTL_REDIRECT_MACROS # define textdomain libintl_textdomain #endif extern char *textdomain _INTL_PARAMS ((const char *__domainname)) _INTL_ASM (libintl_textdomain); #endif /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_bindtextdomain (const char *__domainname, const char *__dirname); static inline char *bindtextdomain (const char *__domainname, const char *__dirname) { return libintl_bindtextdomain (__domainname, __dirname); } #else #ifdef _INTL_REDIRECT_MACROS # define bindtextdomain libintl_bindtextdomain #endif extern char *bindtextdomain _INTL_PARAMS ((const char *__domainname, const char *__dirname)) _INTL_ASM (libintl_bindtextdomain); #endif /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_bind_textdomain_codeset (const char *__domainname, const char *__codeset); static inline char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) { return libintl_bind_textdomain_codeset (__domainname, __codeset); } #else #ifdef _INTL_REDIRECT_MACROS # define bind_textdomain_codeset libintl_bind_textdomain_codeset #endif extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname, const char *__codeset)) _INTL_ASM (libintl_bind_textdomain_codeset); #endif #ifdef __cplusplus } #endif #endif /* libintl.h */ indent-2.2.11/intl/explodename.c0000644000177400010010000001105011041664102013375 00000000000000/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ char * _nl_find_language (name) const char *name; { while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '+' && name[0] != ',') ++name; return (char *) name; } int _nl_explode_name (name, language, modifier, territory, codeset, normalized_codeset, special, sponsor, revision) char *name; const char **language; const char **modifier; const char **territory; const char **codeset; const char **normalized_codeset; const char **special; const char **sponsor; const char **revision; { enum { undecided, xpg, cen } syntax; char *cp; int mask; *modifier = NULL; *territory = NULL; *codeset = NULL; *normalized_codeset = NULL; *special = NULL; *sponsor = NULL; *revision = NULL; /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_' and `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = 0; syntax = undecided; *language = cp = name; cp = _nl_find_language (*language); if (*language == cp) /* This does not make sense: language has to be specified. Use this entry as it is without exploding. Perhaps it is an alias. */ cp = strchr (*language, '\0'); else if (cp[0] == '_') { /* Next is the territory. */ cp[0] = '\0'; *territory = ++cp; while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= TERRITORY; if (cp[0] == '.') { /* Next is the codeset. */ syntax = xpg; cp[0] = '\0'; *codeset = ++cp; while (cp[0] != '\0' && cp[0] != '@') ++cp; mask |= XPG_CODESET; if (*codeset != cp && (*codeset)[0] != '\0') { *normalized_codeset = _nl_normalize_codeset (*codeset, cp - *codeset); if (strcmp (*codeset, *normalized_codeset) == 0) free ((char *) *normalized_codeset); else mask |= XPG_NORM_CODESET; } } } if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) { /* Next is the modifier. */ syntax = cp[0] == '@' ? xpg : cen; cp[0] = '\0'; *modifier = ++cp; while (syntax == cen && cp[0] != '\0' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= XPG_MODIFIER | CEN_AUDIENCE; } if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) { syntax = cen; if (cp[0] == '+') { /* Next is special application (CEN syntax). */ cp[0] = '\0'; *special = ++cp; while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= CEN_SPECIAL; } if (cp[0] == ',') { /* Next is sponsor (CEN syntax). */ cp[0] = '\0'; *sponsor = ++cp; while (cp[0] != '\0' && cp[0] != '_') ++cp; mask |= CEN_SPONSOR; } if (cp[0] == '_') { /* Next is revision (CEN syntax). */ cp[0] = '\0'; *revision = ++cp; mask |= CEN_REVISION; } } /* For CEN syntax values it might be important to have the separator character in the file name, not for XPG syntax. */ if (syntax == xpg) { if (*territory != NULL && (*territory)[0] == '\0') mask &= ~TERRITORY; if (*codeset != NULL && (*codeset)[0] == '\0') mask &= ~XPG_CODESET; if (*modifier != NULL && (*modifier)[0] == '\0') mask &= ~XPG_MODIFIER; } return mask; } indent-2.2.11/intl/dcgettext.c0000644000177400010010000000350011041664102013070 00000000000000/* Implementation of the dcgettext(3) function. Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCGETTEXT __dcgettext # define DCIGETTEXT __dcigettext #else # define DCGETTEXT libintl_dcgettext # define DCIGETTEXT libintl_dcigettext #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCGETTEXT (domainname, msgid, category) const char *domainname; const char *msgid; int category; { return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ INTDEF(__dcgettext) weak_alias (__dcgettext, dcgettext); #endif indent-2.2.11/intl/finddomain.c0000644000177400010010000001314611041664102013214 00000000000000/* Handle list of needed message catalogs Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* List of already loaded domains. */ static struct loaded_l10nfile *_nl_loaded_domains; /* Return a data structure describing the message catalog described by the DOMAINNAME and CATEGORY parameters with respect to the currently established bindings. */ struct loaded_l10nfile * internal_function _nl_find_domain (dirname, locale, domainname, domainbinding) const char *dirname; char *locale; const char *domainname; struct binding *domainbinding; { struct loaded_l10nfile *retval; const char *language; const char *modifier; const char *territory; const char *codeset; const char *normalized_codeset; const char *special; const char *sponsor; const char *revision; const char *alias_value; int mask; /* LOCALE can consist of up to four recognized parts for the XPG syntax: language[_territory[.codeset]][@modifier] and six parts for the CEN syntax: language[_territory][+audience][+special][,[sponsor][_revision]] Beside the first part all of them are allowed to be missing. If the full specified locale is not found, the less specific one are looked for. The various parts will be stripped off according to the following order: (1) revision (2) sponsor (3) special (4) codeset (5) normalized codeset (6) territory (7) audience/modifier */ /* If we have already tested for this locale entry there has to be one data set in the list of loaded domains. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, 0, locale, NULL, NULL, NULL, NULL, NULL, NULL, NULL, domainname, 0); if (retval != NULL) { /* We know something about this locale. */ int cnt; if (retval->decided == 0) _nl_load_domain (retval, domainbinding); if (retval->data != NULL) return retval; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided == 0) _nl_load_domain (retval->successor[cnt], domainbinding); if (retval->successor[cnt]->data != NULL) break; } return cnt >= 0 ? retval : NULL; /* NOTREACHED */ } /* See whether the locale value is an alias. If yes its value *overwrites* the alias name. No test for the original value is done. */ alias_value = _nl_expand_alias (locale); if (alias_value != NULL) { #if defined _LIBC || defined HAVE_STRDUP locale = strdup (alias_value); if (locale == NULL) return NULL; #else size_t len = strlen (alias_value) + 1; locale = (char *) malloc (len); if (locale == NULL) return NULL; memcpy (locale, alias_value, len); #endif } /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_' and `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = _nl_explode_name (locale, &language, &modifier, &territory, &codeset, &normalized_codeset, &special, &sponsor, &revision); /* Create all possible locale entries which might be interested in generalization. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, mask, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, domainname, 1); if (retval == NULL) /* This means we are out of core. */ return NULL; if (retval->decided == 0) _nl_load_domain (retval, domainbinding); if (retval->data == NULL) { int cnt; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided == 0) _nl_load_domain (retval->successor[cnt], domainbinding); if (retval->successor[cnt]->data != NULL) break; } } /* The room for an alias was dynamically allocated. Free it now. */ if (alias_value != NULL) free (locale); /* The space for normalized_codeset is dynamically allocated. Free it. */ if (mask & XPG_NORM_CODESET) free ((void *) normalized_codeset); return retval; } #ifdef _LIBC static void __attribute__ ((unused)) free_mem (void) { struct loaded_l10nfile *runp = _nl_loaded_domains; while (runp != NULL) { struct loaded_l10nfile *here = runp; if (runp->data != NULL) _nl_unload_domain ((struct loaded_domain *) runp->data); runp = runp->next; free ((char *) here->filename); free (here); } } text_set_element (__libc_subfreeres, free_mem); #endif indent-2.2.11/intl/ref-del.sin0000644000177400010010000000202411041664103012763 00000000000000# Remove this package from a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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 Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// s/ @PACKAGE@ / / s/^/# Packages using this file:/ } indent-2.2.11/intl/ref-add.sin0000644000177400010010000000210111041664103012743 00000000000000# Add this package to a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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 Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// ta :a s/ @PACKAGE@ / @PACKAGE@ / tb s/ $/ @PACKAGE@ / :b s/^/# Packages using this file:/ } indent-2.2.11/intl/localename.c0000644000177400010010000005412611041664102013207 00000000000000/* Determine the current selected locale. Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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 Ulrich Drepper , 1995. */ /* Win32 code written by Tor Lillqvist . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #if defined _WIN32 || defined __WIN32__ # undef WIN32 /* avoid warning on mingw32 */ # define WIN32 #endif #ifdef WIN32 # define WIN32_LEAN_AND_MEAN # include /* Mingw headers don't have latest language and sublanguage codes. */ # ifndef LANG_AFRIKAANS # define LANG_AFRIKAANS 0x36 # endif # ifndef LANG_ALBANIAN # define LANG_ALBANIAN 0x1c # endif # ifndef LANG_ARABIC # define LANG_ARABIC 0x01 # endif # ifndef LANG_ARMENIAN # define LANG_ARMENIAN 0x2b # endif # ifndef LANG_ASSAMESE # define LANG_ASSAMESE 0x4d # endif # ifndef LANG_AZERI # define LANG_AZERI 0x2c # endif # ifndef LANG_BASQUE # define LANG_BASQUE 0x2d # endif # ifndef LANG_BELARUSIAN # define LANG_BELARUSIAN 0x23 # endif # ifndef LANG_BENGALI # define LANG_BENGALI 0x45 # endif # ifndef LANG_CATALAN # define LANG_CATALAN 0x03 # endif # ifndef LANG_DIVEHI # define LANG_DIVEHI 0x65 # endif # ifndef LANG_ESTONIAN # define LANG_ESTONIAN 0x25 # endif # ifndef LANG_FAEROESE # define LANG_FAEROESE 0x38 # endif # ifndef LANG_FARSI # define LANG_FARSI 0x29 # endif # ifndef LANG_GALICIAN # define LANG_GALICIAN 0x56 # endif # ifndef LANG_GEORGIAN # define LANG_GEORGIAN 0x37 # endif # ifndef LANG_GUJARATI # define LANG_GUJARATI 0x47 # endif # ifndef LANG_HEBREW # define LANG_HEBREW 0x0d # endif # ifndef LANG_HINDI # define LANG_HINDI 0x39 # endif # ifndef LANG_INDONESIAN # define LANG_INDONESIAN 0x21 # endif # ifndef LANG_KANNADA # define LANG_KANNADA 0x4b # endif # ifndef LANG_KASHMIRI # define LANG_KASHMIRI 0x60 # endif # ifndef LANG_KAZAK # define LANG_KAZAK 0x3f # endif # ifndef LANG_KONKANI # define LANG_KONKANI 0x57 # endif # ifndef LANG_KYRGYZ # define LANG_KYRGYZ 0x40 # endif # ifndef LANG_LATVIAN # define LANG_LATVIAN 0x26 # endif # ifndef LANG_LITHUANIAN # define LANG_LITHUANIAN 0x27 # endif # ifndef LANG_MACEDONIAN # define LANG_MACEDONIAN 0x2f # endif # ifndef LANG_MALAY # define LANG_MALAY 0x3e # endif # ifndef LANG_MALAYALAM # define LANG_MALAYALAM 0x4c # endif # ifndef LANG_MANIPURI # define LANG_MANIPURI 0x58 # endif # ifndef LANG_MARATHI # define LANG_MARATHI 0x4e # endif # ifndef LANG_MONGOLIAN # define LANG_MONGOLIAN 0x50 # endif # ifndef LANG_NEPALI # define LANG_NEPALI 0x61 # endif # ifndef LANG_ORIYA # define LANG_ORIYA 0x48 # endif # ifndef LANG_PUNJABI # define LANG_PUNJABI 0x46 # endif # ifndef LANG_SANSKRIT # define LANG_SANSKRIT 0x4f # endif # ifndef LANG_SERBIAN # define LANG_SERBIAN 0x1a # endif # ifndef LANG_SINDHI # define LANG_SINDHI 0x59 # endif # ifndef LANG_SLOVAK # define LANG_SLOVAK 0x1b # endif # ifndef LANG_SORBIAN # define LANG_SORBIAN 0x2e # endif # ifndef LANG_SWAHILI # define LANG_SWAHILI 0x41 # endif # ifndef LANG_SYRIAC # define LANG_SYRIAC 0x5a # endif # ifndef LANG_TAMIL # define LANG_TAMIL 0x49 # endif # ifndef LANG_TATAR # define LANG_TATAR 0x44 # endif # ifndef LANG_TELUGU # define LANG_TELUGU 0x4a # endif # ifndef LANG_THAI # define LANG_THAI 0x1e # endif # ifndef LANG_UKRAINIAN # define LANG_UKRAINIAN 0x22 # endif # ifndef LANG_URDU # define LANG_URDU 0x20 # endif # ifndef LANG_UZBEK # define LANG_UZBEK 0x43 # endif # ifndef LANG_VIETNAMESE # define LANG_VIETNAMESE 0x2a # endif # ifndef SUBLANG_ARABIC_SAUDI_ARABIA # define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 # endif # ifndef SUBLANG_ARABIC_IRAQ # define SUBLANG_ARABIC_IRAQ 0x02 # endif # ifndef SUBLANG_ARABIC_EGYPT # define SUBLANG_ARABIC_EGYPT 0x03 # endif # ifndef SUBLANG_ARABIC_LIBYA # define SUBLANG_ARABIC_LIBYA 0x04 # endif # ifndef SUBLANG_ARABIC_ALGERIA # define SUBLANG_ARABIC_ALGERIA 0x05 # endif # ifndef SUBLANG_ARABIC_MOROCCO # define SUBLANG_ARABIC_MOROCCO 0x06 # endif # ifndef SUBLANG_ARABIC_TUNISIA # define SUBLANG_ARABIC_TUNISIA 0x07 # endif # ifndef SUBLANG_ARABIC_OMAN # define SUBLANG_ARABIC_OMAN 0x08 # endif # ifndef SUBLANG_ARABIC_YEMEN # define SUBLANG_ARABIC_YEMEN 0x09 # endif # ifndef SUBLANG_ARABIC_SYRIA # define SUBLANG_ARABIC_SYRIA 0x0a # endif # ifndef SUBLANG_ARABIC_JORDAN # define SUBLANG_ARABIC_JORDAN 0x0b # endif # ifndef SUBLANG_ARABIC_LEBANON # define SUBLANG_ARABIC_LEBANON 0x0c # endif # ifndef SUBLANG_ARABIC_KUWAIT # define SUBLANG_ARABIC_KUWAIT 0x0d # endif # ifndef SUBLANG_ARABIC_UAE # define SUBLANG_ARABIC_UAE 0x0e # endif # ifndef SUBLANG_ARABIC_BAHRAIN # define SUBLANG_ARABIC_BAHRAIN 0x0f # endif # ifndef SUBLANG_ARABIC_QATAR # define SUBLANG_ARABIC_QATAR 0x10 # endif # ifndef SUBLANG_AZERI_LATIN # define SUBLANG_AZERI_LATIN 0x01 # endif # ifndef SUBLANG_AZERI_CYRILLIC # define SUBLANG_AZERI_CYRILLIC 0x02 # endif # ifndef SUBLANG_CHINESE_MACAU # define SUBLANG_CHINESE_MACAU 0x05 # endif # ifndef SUBLANG_ENGLISH_SOUTH_AFRICA # define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 # endif # ifndef SUBLANG_ENGLISH_JAMAICA # define SUBLANG_ENGLISH_JAMAICA 0x08 # endif # ifndef SUBLANG_ENGLISH_CARIBBEAN # define SUBLANG_ENGLISH_CARIBBEAN 0x09 # endif # ifndef SUBLANG_ENGLISH_BELIZE # define SUBLANG_ENGLISH_BELIZE 0x0a # endif # ifndef SUBLANG_ENGLISH_TRINIDAD # define SUBLANG_ENGLISH_TRINIDAD 0x0b # endif # ifndef SUBLANG_ENGLISH_ZIMBABWE # define SUBLANG_ENGLISH_ZIMBABWE 0x0c # endif # ifndef SUBLANG_ENGLISH_PHILIPPINES # define SUBLANG_ENGLISH_PHILIPPINES 0x0d # endif # ifndef SUBLANG_FRENCH_LUXEMBOURG # define SUBLANG_FRENCH_LUXEMBOURG 0x05 # endif # ifndef SUBLANG_FRENCH_MONACO # define SUBLANG_FRENCH_MONACO 0x06 # endif # ifndef SUBLANG_GERMAN_LUXEMBOURG # define SUBLANG_GERMAN_LUXEMBOURG 0x04 # endif # ifndef SUBLANG_GERMAN_LIECHTENSTEIN # define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 # endif # ifndef SUBLANG_KASHMIRI_INDIA # define SUBLANG_KASHMIRI_INDIA 0x02 # endif # ifndef SUBLANG_MALAY_MALAYSIA # define SUBLANG_MALAY_MALAYSIA 0x01 # endif # ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM # define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 # endif # ifndef SUBLANG_NEPALI_INDIA # define SUBLANG_NEPALI_INDIA 0x02 # endif # ifndef SUBLANG_SERBIAN_LATIN # define SUBLANG_SERBIAN_LATIN 0x02 # endif # ifndef SUBLANG_SERBIAN_CYRILLIC # define SUBLANG_SERBIAN_CYRILLIC 0x03 # endif # ifndef SUBLANG_SPANISH_GUATEMALA # define SUBLANG_SPANISH_GUATEMALA 0x04 # endif # ifndef SUBLANG_SPANISH_COSTA_RICA # define SUBLANG_SPANISH_COSTA_RICA 0x05 # endif # ifndef SUBLANG_SPANISH_PANAMA # define SUBLANG_SPANISH_PANAMA 0x06 # endif # ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC # define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 # endif # ifndef SUBLANG_SPANISH_VENEZUELA # define SUBLANG_SPANISH_VENEZUELA 0x08 # endif # ifndef SUBLANG_SPANISH_COLOMBIA # define SUBLANG_SPANISH_COLOMBIA 0x09 # endif # ifndef SUBLANG_SPANISH_PERU # define SUBLANG_SPANISH_PERU 0x0a # endif # ifndef SUBLANG_SPANISH_ARGENTINA # define SUBLANG_SPANISH_ARGENTINA 0x0b # endif # ifndef SUBLANG_SPANISH_ECUADOR # define SUBLANG_SPANISH_ECUADOR 0x0c # endif # ifndef SUBLANG_SPANISH_CHILE # define SUBLANG_SPANISH_CHILE 0x0d # endif # ifndef SUBLANG_SPANISH_URUGUAY # define SUBLANG_SPANISH_URUGUAY 0x0e # endif # ifndef SUBLANG_SPANISH_PARAGUAY # define SUBLANG_SPANISH_PARAGUAY 0x0f # endif # ifndef SUBLANG_SPANISH_BOLIVIA # define SUBLANG_SPANISH_BOLIVIA 0x10 # endif # ifndef SUBLANG_SPANISH_EL_SALVADOR # define SUBLANG_SPANISH_EL_SALVADOR 0x11 # endif # ifndef SUBLANG_SPANISH_HONDURAS # define SUBLANG_SPANISH_HONDURAS 0x12 # endif # ifndef SUBLANG_SPANISH_NICARAGUA # define SUBLANG_SPANISH_NICARAGUA 0x13 # endif # ifndef SUBLANG_SPANISH_PUERTO_RICO # define SUBLANG_SPANISH_PUERTO_RICO 0x14 # endif # ifndef SUBLANG_SWEDISH_FINLAND # define SUBLANG_SWEDISH_FINLAND 0x02 # endif # ifndef SUBLANG_URDU_PAKISTAN # define SUBLANG_URDU_PAKISTAN 0x01 # endif # ifndef SUBLANG_URDU_INDIA # define SUBLANG_URDU_INDIA 0x02 # endif # ifndef SUBLANG_UZBEK_LATIN # define SUBLANG_UZBEK_LATIN 0x01 # endif # ifndef SUBLANG_UZBEK_CYRILLIC # define SUBLANG_UZBEK_CYRILLIC 0x02 # endif #endif /* XPG3 defines the result of 'setlocale (category, NULL)' as: "Directs 'setlocale()' to query 'category' and return the current setting of 'local'." However it does not specify the exact format. Neither do SUSV2 and ISO C 99. So we can use this feature only on selected systems (e.g. those using GNU C Library). */ #if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2) # define HAVE_LOCALE_NULL #endif /* Determine the current locale's name, and canonicalize it into XPG syntax language[_territory[.codeset]][@modifier] The codeset part in the result is not reliable; the locale_charset() should be used for codeset information instead. The result must not be freed; it is statically allocated. */ const char * _nl_locale_name (category, categoryname) int category; const char *categoryname; { const char *retval; #ifndef WIN32 /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. On some systems this can be done by the 'setlocale' function itself. */ # if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL retval = setlocale (category, NULL); # else /* Setting of LC_ALL overwrites all other. */ retval = getenv ("LC_ALL"); if (retval == NULL || retval[0] == '\0') { /* Next comes the name of the desired category. */ retval = getenv (categoryname); if (retval == NULL || retval[0] == '\0') { /* Last possibility is the LANG environment variable. */ retval = getenv ("LANG"); if (retval == NULL || retval[0] == '\0') /* We use C as the default domain. POSIX says this is implementation defined. */ retval = "C"; } } # endif return retval; #else /* WIN32 */ /* Return an XPG style locale name language[_territory][@modifier]. Don't even bother determining the codeset; it's not useful in this context, because message catalogs are not specific to a single codeset. */ LCID lcid; LANGID langid; int primary, sub; /* Let the user override the system settings through environment variables, as on POSIX systems. */ retval = getenv ("LC_ALL"); if (retval != NULL && retval[0] != '\0') return retval; retval = getenv (categoryname); if (retval != NULL && retval[0] != '\0') return retval; retval = getenv ("LANG"); if (retval != NULL && retval[0] != '\0') return retval; /* Use native Win32 API locale ID. */ lcid = GetThreadLocale (); /* Strip off the sorting rules, keep only the language part. */ langid = LANGIDFROMLCID (lcid); /* Split into language and territory part. */ primary = PRIMARYLANGID (langid); sub = SUBLANGID (langid); /* Dispatch on language. See also http://www.unicode.org/unicode/onlinedat/languages.html . For details about languages, see http://www.ethnologue.com/ . */ switch (primary) { case LANG_AFRIKAANS: return "af_ZA"; case LANG_ALBANIAN: return "sq_AL"; case 0x5e: /* AMHARIC */ return "am_ET"; case LANG_ARABIC: switch (sub) { case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; case SUBLANG_ARABIC_EGYPT: return "ar_EG"; case SUBLANG_ARABIC_LIBYA: return "ar_LY"; case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; case SUBLANG_ARABIC_OMAN: return "ar_OM"; case SUBLANG_ARABIC_YEMEN: return "ar_YE"; case SUBLANG_ARABIC_SYRIA: return "ar_SY"; case SUBLANG_ARABIC_JORDAN: return "ar_JO"; case SUBLANG_ARABIC_LEBANON: return "ar_LB"; case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; case SUBLANG_ARABIC_UAE: return "ar_AE"; case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; case SUBLANG_ARABIC_QATAR: return "ar_QA"; } return "ar"; case LANG_ARMENIAN: return "hy_AM"; case LANG_ASSAMESE: return "as_IN"; case LANG_AZERI: switch (sub) { /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */ case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; } return "az"; case LANG_BASQUE: return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */ case LANG_BELARUSIAN: return "be_BY"; case LANG_BENGALI: return "bn_IN"; case LANG_BULGARIAN: return "bg_BG"; case 0x55: /* BURMESE */ return "my_MM"; case 0x53: /* CAMBODIAN */ return "km_KH"; case LANG_CATALAN: return "ca_ES"; case 0x5c: /* CHEROKEE */ return "chr_US"; case LANG_CHINESE: switch (sub) { case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW"; case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN"; case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; case SUBLANG_CHINESE_MACAU: return "zh_MO"; } return "zh"; case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN * What used to be called Serbo-Croatian * should really now be two separate * languages because of political reasons. * (Says tml, who knows nothing about Serbian * or Croatian.) * (I can feel those flames coming already.) */ switch (sub) { case SUBLANG_DEFAULT: return "hr_HR"; case SUBLANG_SERBIAN_LATIN: return "sr_YU"; case SUBLANG_SERBIAN_CYRILLIC: return "sr_YU@cyrillic"; } return "hr"; case LANG_CZECH: return "cs_CZ"; case LANG_DANISH: return "da_DK"; case LANG_DIVEHI: return "div_MV"; case LANG_DUTCH: switch (sub) { case SUBLANG_DUTCH: return "nl_NL"; case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE"; } return "nl"; case 0x66: /* EDO */ return "bin_NG"; case LANG_ENGLISH: switch (sub) { /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought * English was the language spoken in England. * Oh well. */ case SUBLANG_ENGLISH_US: return "en_US"; case SUBLANG_ENGLISH_UK: return "en_GB"; case SUBLANG_ENGLISH_AUS: return "en_AU"; case SUBLANG_ENGLISH_CAN: return "en_CA"; case SUBLANG_ENGLISH_NZ: return "en_NZ"; case SUBLANG_ENGLISH_EIRE: return "en_IE"; case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; } return "en"; case LANG_ESTONIAN: return "et_EE"; case LANG_FAEROESE: return "fo_FO"; case LANG_FARSI: return "fa_IR"; case LANG_FINNISH: return "fi_FI"; case LANG_FRENCH: switch (sub) { case SUBLANG_FRENCH: return "fr_FR"; case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE"; case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; case SUBLANG_FRENCH_SWISS: return "fr_CH"; case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; case SUBLANG_FRENCH_MONACO: return "fr_MC"; } return "fr"; case 0x62: /* FRISIAN */ return "fy_NL"; case 0x67: /* FULFULDE */ return "ful_NG"; case 0x3c: /* GAELIC */ switch (sub) { case 0x01: /* SCOTTISH */ return "gd_GB"; case 0x02: /* IRISH */ return "ga_IE"; } return "C"; case LANG_GALICIAN: return "gl_ES"; case LANG_GEORGIAN: return "ka_GE"; case LANG_GERMAN: switch (sub) { case SUBLANG_GERMAN: return "de_DE"; case SUBLANG_GERMAN_SWISS: return "de_CH"; case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; } return "de"; case LANG_GREEK: return "el_GR"; case 0x74: /* GUARANI */ return "gn_PY"; case LANG_GUJARATI: return "gu_IN"; case 0x68: /* HAUSA */ return "ha_NG"; case 0x75: /* HAWAIIAN */ /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers) or Hawaii Creole English ("cpe_US", 600000 speakers)? */ return "cpe_US"; case LANG_HEBREW: return "he_IL"; case LANG_HINDI: return "hi_IN"; case LANG_HUNGARIAN: return "hu_HU"; case 0x69: /* IBIBIO */ return "nic_NG"; case LANG_ICELANDIC: return "is_IS"; case 0x70: /* IGBO */ return "ibo_NG"; case LANG_INDONESIAN: return "id_ID"; case 0x5d: /* INUKTITUT */ return "iu_CA"; case LANG_ITALIAN: switch (sub) { case SUBLANG_ITALIAN: return "it_IT"; case SUBLANG_ITALIAN_SWISS: return "it_CH"; } return "it"; case LANG_JAPANESE: return "ja_JP"; case LANG_KANNADA: return "kn_IN"; case 0x71: /* KANURI */ return "kau_NG"; case LANG_KASHMIRI: switch (sub) { case SUBLANG_DEFAULT: return "ks_PK"; case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; } return "ks"; case LANG_KAZAK: return "kk_KZ"; case LANG_KONKANI: /* FIXME: Adjust this when such locales appear on Unix. */ return "kok_IN"; case LANG_KOREAN: return "ko_KR"; case LANG_KYRGYZ: return "ky_KG"; case 0x54: /* LAO */ return "lo_LA"; case 0x76: /* LATIN */ return "la_VA"; case LANG_LATVIAN: return "lv_LV"; case LANG_LITHUANIAN: return "lt_LT"; case LANG_MACEDONIAN: return "mk_MK"; case LANG_MALAY: switch (sub) { case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; } return "ms"; case LANG_MALAYALAM: return "ml_IN"; case 0x3a: /* MALTESE */ return "mt_MT"; case LANG_MANIPURI: /* FIXME: Adjust this when such locales appear on Unix. */ return "mni_IN"; case LANG_MARATHI: return "mr_IN"; case LANG_MONGOLIAN: return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */ case LANG_NEPALI: switch (sub) { case SUBLANG_DEFAULT: return "ne_NP"; case SUBLANG_NEPALI_INDIA: return "ne_IN"; } return "ne"; case LANG_NORWEGIAN: switch (sub) { case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO"; case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; } return "no"; case LANG_ORIYA: return "or_IN"; case 0x72: /* OROMO */ return "om_ET"; case 0x79: /* PAPIAMENTU */ return "pap_AN"; case 0x63: /* PASHTO */ return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */ case LANG_POLISH: return "pl_PL"; case LANG_PORTUGUESE: switch (sub) { case SUBLANG_PORTUGUESE: return "pt_PT"; /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; } return "pt"; case LANG_PUNJABI: return "pa_IN"; case 0x17: /* RHAETO-ROMANCE */ return "rm_CH"; case LANG_ROMANIAN: return "ro_RO"; case LANG_RUSSIAN: return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA". */ case 0x3b: /* SAMI */ return "se_NO"; case LANG_SANSKRIT: return "sa_IN"; case LANG_SINDHI: return "sd"; case 0x5b: /* SINHALESE */ return "si_LK"; case LANG_SLOVAK: return "sk_SK"; case LANG_SLOVENIAN: return "sl_SI"; case 0x77: /* SOMALI */ return "so_SO"; case LANG_SORBIAN: /* FIXME: Adjust this when such locales appear on Unix. */ return "wen_DE"; case LANG_SPANISH: switch (sub) { case SUBLANG_SPANISH: return "es_ES"; case SUBLANG_SPANISH_MEXICAN: return "es_MX"; case SUBLANG_SPANISH_MODERN: return "es_ES@modern"; /* not seen on Unix */ case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; case SUBLANG_SPANISH_PANAMA: return "es_PA"; case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; case SUBLANG_SPANISH_PERU: return "es_PE"; case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; case SUBLANG_SPANISH_ECUADOR: return "es_EC"; case SUBLANG_SPANISH_CHILE: return "es_CL"; case SUBLANG_SPANISH_URUGUAY: return "es_UY"; case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; case SUBLANG_SPANISH_HONDURAS: return "es_HN"; case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; } return "es"; case 0x30: /* SUTU */ return "bnt_TZ"; case LANG_SWAHILI: return "sw_KE"; case LANG_SWEDISH: switch (sub) { case SUBLANG_DEFAULT: return "sv_SE"; case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; } return "sv"; case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */ case 0x64: /* TAGALOG */ return "tl_PH"; case 0x28: /* TAJIK */ return "tg_TJ"; case 0x5f: /* TAMAZIGHT */ return "ber_MA"; case LANG_TAMIL: return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */ case LANG_TATAR: return "tt_RU"; case LANG_TELUGU: return "te_IN"; case LANG_THAI: return "th_TH"; case 0x51: /* TIBETAN */ return "bo_CN"; case 0x73: /* TIGRINYA */ return "ti_ET"; case 0x31: /* TSONGA */ return "ts_ZA"; case LANG_TURKISH: return "tr_TR"; case 0x42: /* TURKMEN */ return "tk_TM"; case LANG_UKRAINIAN: return "uk_UA"; case LANG_URDU: switch (sub) { case SUBLANG_URDU_PAKISTAN: return "ur_PK"; case SUBLANG_URDU_INDIA: return "ur_IN"; } return "ur"; case LANG_UZBEK: switch (sub) { /* FIXME: Adjust this when Uzbek locales appear on Unix. */ case SUBLANG_UZBEK_LATIN: return "uz_UZ@latin"; case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic"; } return "uz"; case 0x33: /* VENDA */ return "ven_ZA"; case LANG_VIETNAMESE: return "vi_VN"; case 0x52: /* WELSH */ return "cy_GB"; case 0x34: /* XHOSA */ return "xh_ZA"; case 0x78: /* YI */ return "sit_CN"; case 0x3d: /* YIDDISH */ return "yi_IL"; case 0x6a: /* YORUBA */ return "yo_NG"; case 0x35: /* ZULU */ return "zu_ZA"; default: return "C"; } #endif } indent-2.2.11/intl/osdep.c0000644000177400010010000000164311041664102012215 00000000000000/* OS dependent parts of libintl. Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #if defined __EMX__ # include "os2compat.c" #else /* Avoid AIX compiler warning. */ typedef int dummy; #endif indent-2.2.11/intl/locale.alias0000644000177400010010000000514111041664102013206 00000000000000# Locale name alias data base. # Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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. # The format of this file is the same as for the corresponding file of # the X Window System, which normally can be found in # /usr/lib/X11/locale/locale.alias # A single line contains two fields: an alias and a substitution value. # All entries are case independent. # Note: This file is far from being complete. If you have a value for # your own site which you think might be useful for others too, share # it with the rest of us. Send it using the `glibcbug' script to # bugs@gnu.org. # Packages using this file: bokmal no_NO.ISO-8859-1 bokmål no_NO.ISO-8859-1 catalan ca_ES.ISO-8859-1 croatian hr_HR.ISO-8859-2 czech cs_CZ.ISO-8859-2 danish da_DK.ISO-8859-1 dansk da_DK.ISO-8859-1 deutsch de_DE.ISO-8859-1 dutch nl_NL.ISO-8859-1 eesti et_EE.ISO-8859-1 estonian et_EE.ISO-8859-1 finnish fi_FI.ISO-8859-1 français fr_FR.ISO-8859-1 french fr_FR.ISO-8859-1 galego gl_ES.ISO-8859-1 galician gl_ES.ISO-8859-1 german de_DE.ISO-8859-1 greek el_GR.ISO-8859-7 hebrew he_IL.ISO-8859-8 hrvatski hr_HR.ISO-8859-2 hungarian hu_HU.ISO-8859-2 icelandic is_IS.ISO-8859-1 italian it_IT.ISO-8859-1 japanese ja_JP.eucJP japanese.euc ja_JP.eucJP ja_JP ja_JP.eucJP ja_JP.ujis ja_JP.eucJP japanese.sjis ja_JP.SJIS korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR lithuanian lt_LT.ISO-8859-13 nb_NO no_NO.ISO-8859-1 nb_NO.ISO-8859-1 no_NO.ISO-8859-1 norwegian no_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 portuguese pt_PT.ISO-8859-1 romanian ro_RO.ISO-8859-2 russian ru_RU.ISO-8859-5 slovak sk_SK.ISO-8859-2 slovene sl_SI.ISO-8859-2 slovenian sl_SI.ISO-8859-2 spanish es_ES.ISO-8859-1 swedish sv_SE.ISO-8859-1 thai th_TH.TIS-620 turkish tr_TR.ISO-8859-9 indent-2.2.11/intl/os2compat.c0000644000177400010010000000550311041664102013011 00000000000000/* OS/2 compatibility functions. Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #define OS2_AWARE #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* A version of getenv() that works from DLLs */ extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); char * _nl_getenv (const char *name) { unsigned char *value; if (DosScanEnv (name, &value)) return NULL; else return value; } /* A fixed size buffer. */ char libintl_nl_default_dirname[MAXPATHLEN+1]; char *_nlos2_libdir = NULL; char *_nlos2_localealiaspath = NULL; char *_nlos2_localedir = NULL; static __attribute__((constructor)) void nlos2_initialize () { char *root = getenv ("UNIXROOT"); char *gnulocaledir = getenv ("GNULOCALEDIR"); _nlos2_libdir = gnulocaledir; if (!_nlos2_libdir) { if (root) { size_t sl = strlen (root); _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); memcpy (_nlos2_libdir, root, sl); memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); } else _nlos2_libdir = LIBDIR; } _nlos2_localealiaspath = gnulocaledir; if (!_nlos2_localealiaspath) { if (root) { size_t sl = strlen (root); _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); memcpy (_nlos2_localealiaspath, root, sl); memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); } else _nlos2_localealiaspath = LOCALE_ALIAS_PATH; } _nlos2_localedir = gnulocaledir; if (!_nlos2_localedir) { if (root) { size_t sl = strlen (root); _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); memcpy (_nlos2_localedir, root, sl); memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); } else _nlos2_localedir = LOCALEDIR; } if (strlen (_nlos2_localedir) <= MAXPATHLEN) strcpy (libintl_nl_default_dirname, _nlos2_localedir); } indent-2.2.11/intl/hash-string.h0000644000177400010010000000357411041664102013344 00000000000000/* Description of GNU message catalog format: string hashing function. Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* @@ end of prolog @@ */ #ifndef PARAMS # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) () # endif #endif /* We assume to have `unsigned long int' value with at least 32 bits. */ #define HASHWORDBITS 32 /* Defines the so called `hashpjw' function by P.J. Weinberger [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 1986, 1987 Bell Telephone Laboratories, Inc.] */ static unsigned long int hash_string PARAMS ((const char *__str_param)); static inline unsigned long int hash_string (str_param) const char *str_param; { unsigned long int hval, g; const char *str = str_param; /* Compute the hash value for the given string. */ hval = 0; while (*str != '\0') { hval <<= 4; hval += (unsigned long int) *str++; g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); if (g != 0) { hval ^= g >> (HASHWORDBITS - 8); hval ^= g; } } return hval; } indent-2.2.11/intl/config.charset0000755000177400010010000003341211041664102013561 00000000000000#! /bin/sh # Output a system dependent table of character encoding aliases. # # Copyright (C) 2000-2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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. # # The table consists of lines of the form # ALIAS CANONICAL # # ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". # ALIAS is compared in a case sensitive way. # # CANONICAL is the GNU canonical name for this character encoding. # It must be an encoding supported by libiconv. Support by GNU libc is # also desirable. CANONICAL is case insensitive. Usually an upper case # MIME charset name is preferred. # The current list of GNU canonical charset names is as follows. # # name used by which systems a MIME name? # ASCII, ANSI_X3.4-1968 glibc solaris freebsd # ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-3 glibc solaris yes # ISO-8859-4 osf solaris freebsd yes # ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-6 glibc aix hpux solaris yes # ISO-8859-7 glibc aix hpux irix osf solaris yes # ISO-8859-8 glibc aix hpux osf solaris yes # ISO-8859-9 glibc aix hpux irix osf solaris yes # ISO-8859-13 glibc # ISO-8859-14 glibc # ISO-8859-15 glibc aix osf solaris freebsd # KOI8-R glibc solaris freebsd yes # KOI8-U glibc freebsd yes # KOI8-T glibc # CP437 dos # CP775 dos # CP850 aix osf dos # CP852 dos # CP855 dos # CP856 aix # CP857 dos # CP861 dos # CP862 dos # CP864 dos # CP865 dos # CP866 freebsd dos # CP869 dos # CP874 woe32 dos # CP922 aix # CP932 aix woe32 dos # CP943 aix # CP949 osf woe32 dos # CP950 woe32 dos # CP1046 aix # CP1124 aix # CP1125 dos # CP1129 aix # CP1250 woe32 # CP1251 glibc woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 # CP1255 glibc woe32 # CP1256 woe32 # CP1257 woe32 # GB2312 glibc aix hpux irix solaris freebsd yes # EUC-JP glibc aix hpux irix osf solaris freebsd yes # EUC-KR glibc aix hpux irix osf solaris freebsd yes # EUC-TW glibc aix hpux irix osf solaris # BIG5 glibc aix hpux osf solaris freebsd yes # BIG5-HKSCS glibc solaris # GBK glibc aix osf solaris woe32 dos # GB18030 glibc solaris # SHIFT_JIS hpux osf solaris freebsd yes # JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII glibc yes # TCVN5712-1 glibc # GEORGIAN-PS glibc # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux # HP-HEBREW8 hpux # HP-TURKISH8 hpux # HP-KANA8 hpux # DEC-KANJI osf # DEC-HANYU osf # UTF-8 glibc aix hpux osf solaris yes # # Note: Names which are not marked as being a MIME name should not be used in # Internet protocols for information interchange (mail, news, etc.). # # Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications # must understand both names and treat them as equivalent. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM host="$1" os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` echo "# This file contains a table of character encoding aliases," echo "# suitable for operating system '${os}'." echo "# It was automatically generated from config.charset." # List of references, updated during installation: echo "# Packages using this file: " case "$os" in linux* | *-gnu*) # With glibc-2.1 or newer, we don't need any canonicalization, # because glibc has iconv and both glibc and libiconv support all # GNU canonical names directly. Therefore, the Makefile does not # need to install the alias file at all. # The following applies only to glibc-2.0.x and older libcs. echo "ISO_646.IRV:1983 ASCII" ;; aix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "IBM-850 CP850" echo "IBM-856 CP856" echo "IBM-921 ISO-8859-13" echo "IBM-922 CP922" echo "IBM-932 CP932" echo "IBM-943 CP943" echo "IBM-1046 CP1046" echo "IBM-1124 CP1124" echo "IBM-1129 CP1129" echo "IBM-1252 CP1252" echo "IBM-eucCN GB2312" echo "IBM-eucJP EUC-JP" echo "IBM-eucKR EUC-KR" echo "IBM-eucTW EUC-TW" echo "big5 BIG5" echo "GBK GBK" echo "TIS-620 TIS-620" echo "UTF-8 UTF-8" ;; hpux*) echo "iso88591 ISO-8859-1" echo "iso88592 ISO-8859-2" echo "iso88595 ISO-8859-5" echo "iso88596 ISO-8859-6" echo "iso88597 ISO-8859-7" echo "iso88598 ISO-8859-8" echo "iso88599 ISO-8859-9" echo "iso885915 ISO-8859-15" echo "roman8 HP-ROMAN8" echo "arabic8 HP-ARABIC8" echo "greek8 HP-GREEK8" echo "hebrew8 HP-HEBREW8" echo "turkish8 HP-TURKISH8" echo "kana8 HP-KANA8" echo "tis620 TIS-620" echo "big5 BIG5" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "hp15CN GB2312" #echo "ccdc ?" # what is this? echo "SJIS SHIFT_JIS" echo "utf8 UTF-8" ;; irix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-9 ISO-8859-9" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" ;; osf*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "cp850 CP850" echo "big5 BIG5" echo "dechanyu DEC-HANYU" echo "dechanzi GB2312" echo "deckanji DEC-KANJI" echo "deckorean EUC-KR" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "GBK GBK" echo "KSC5601 CP949" echo "sdeckanji EUC-JP" echo "SJIS SHIFT_JIS" echo "TACTIS TIS-620" echo "UTF-8 UTF-8" ;; solaris*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-3 ISO-8859-3" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" echo "BIG5 BIG5" echo "Big5-HKSCS BIG5-HKSCS" echo "gb2312 GB2312" echo "GBK GBK" echo "GB18030 GB18030" echo "cns11643 EUC-TW" echo "5601 EUC-KR" echo "ko_KR.johap92 JOHAB" echo "eucJP EUC-JP" echo "PCK SHIFT_JIS" echo "TIS620.2533 TIS-620" #echo "sun_eu_greek ?" # what is this? echo "UTF-8 UTF-8" ;; freebsd* | os2*) # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just # reuse FreeBSD's locale data for OS/2. echo "C ASCII" echo "US-ASCII ASCII" for l in la_LN lt_LN; do echo "$l.ASCII ASCII" done for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do echo "$l.ISO_8859-1 ISO-8859-1" echo "$l.DIS_8859-15 ISO-8859-15" done for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do echo "$l.ISO_8859-2 ISO-8859-2" done for l in la_LN lt_LT; do echo "$l.ISO_8859-4 ISO-8859-4" done for l in ru_RU ru_SU; do echo "$l.KOI8-R KOI8-R" echo "$l.ISO_8859-5 ISO-8859-5" echo "$l.CP866 CP866" done echo "uk_UA.KOI8-U KOI8-U" echo "zh_TW.BIG5 BIG5" echo "zh_TW.Big5 BIG5" echo "zh_CN.EUC GB2312" echo "ja_JP.EUC EUC-JP" echo "ja_JP.SJIS SHIFT_JIS" echo "ja_JP.Shift_JIS SHIFT_JIS" echo "ko_KR.EUC EUC-KR" ;; netbsd*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-15 ISO-8859-15" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "BIG5 BIG5" echo "SJIS SHIFT_JIS" ;; beos*) # BeOS has a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "#" echo "# The encodings given here may not all be correct." echo "# If you find that the encoding given for your language and" echo "# country is not the one your DOS machine actually uses, just" echo "# correct it in this file, and send a mail to" echo "# Juan Manuel Guerrero " echo "# and Bruno Haible ." echo "#" echo "C ASCII" # ISO-8859-1 languages echo "ca CP850" echo "ca_ES CP850" echo "da CP865" # not CP850 ?? echo "da_DK CP865" # not CP850 ?? echo "de CP850" echo "de_AT CP850" echo "de_CH CP850" echo "de_DE CP850" echo "en CP850" echo "en_AU CP850" # not CP437 ?? echo "en_CA CP850" echo "en_GB CP850" echo "en_NZ CP437" echo "en_US CP437" echo "en_ZA CP850" # not CP437 ?? echo "es CP850" echo "es_AR CP850" echo "es_BO CP850" echo "es_CL CP850" echo "es_CO CP850" echo "es_CR CP850" echo "es_CU CP850" echo "es_DO CP850" echo "es_EC CP850" echo "es_ES CP850" echo "es_GT CP850" echo "es_HN CP850" echo "es_MX CP850" echo "es_NI CP850" echo "es_PA CP850" echo "es_PY CP850" echo "es_PE CP850" echo "es_SV CP850" echo "es_UY CP850" echo "es_VE CP850" echo "et CP850" echo "et_EE CP850" echo "eu CP850" echo "eu_ES CP850" echo "fi CP850" echo "fi_FI CP850" echo "fr CP850" echo "fr_BE CP850" echo "fr_CA CP850" echo "fr_CH CP850" echo "fr_FR CP850" echo "ga CP850" echo "ga_IE CP850" echo "gd CP850" echo "gd_GB CP850" echo "gl CP850" echo "gl_ES CP850" echo "id CP850" # not CP437 ?? echo "id_ID CP850" # not CP437 ?? echo "is CP861" # not CP850 ?? echo "is_IS CP861" # not CP850 ?? echo "it CP850" echo "it_CH CP850" echo "it_IT CP850" echo "lt CP775" echo "lt_LT CP775" echo "lv CP775" echo "lv_LV CP775" echo "nb CP865" # not CP850 ?? echo "nb_NO CP865" # not CP850 ?? echo "nl CP850" echo "nl_BE CP850" echo "nl_NL CP850" echo "nn CP865" # not CP850 ?? echo "nn_NO CP865" # not CP850 ?? echo "no CP865" # not CP850 ?? echo "no_NO CP865" # not CP850 ?? echo "pt CP850" echo "pt_BR CP850" echo "pt_PT CP850" echo "sv CP850" echo "sv_SE CP850" # ISO-8859-2 languages echo "cs CP852" echo "cs_CZ CP852" echo "hr CP852" echo "hr_HR CP852" echo "hu CP852" echo "hu_HU CP852" echo "pl CP852" echo "pl_PL CP852" echo "ro CP852" echo "ro_RO CP852" echo "sk CP852" echo "sk_SK CP852" echo "sl CP852" echo "sl_SI CP852" echo "sq CP852" echo "sq_AL CP852" echo "sr CP852" # CP852 or CP866 or CP855 ?? echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? # ISO-8859-3 languages echo "mt CP850" echo "mt_MT CP850" # ISO-8859-5 languages echo "be CP866" echo "be_BE CP866" echo "bg CP866" # not CP855 ?? echo "bg_BG CP866" # not CP855 ?? echo "mk CP866" # not CP855 ?? echo "mk_MK CP866" # not CP855 ?? echo "ru CP866" echo "ru_RU CP866" echo "uk CP1125" echo "uk_UA CP1125" # ISO-8859-6 languages echo "ar CP864" echo "ar_AE CP864" echo "ar_DZ CP864" echo "ar_EG CP864" echo "ar_IQ CP864" echo "ar_IR CP864" echo "ar_JO CP864" echo "ar_KW CP864" echo "ar_MA CP864" echo "ar_OM CP864" echo "ar_QA CP864" echo "ar_SA CP864" echo "ar_SY CP864" # ISO-8859-7 languages echo "el CP869" echo "el_GR CP869" # ISO-8859-8 languages echo "he CP862" echo "he_IL CP862" # ISO-8859-9 languages echo "tr CP857" echo "tr_TR CP857" # Japanese echo "ja CP932" echo "ja_JP CP932" # Chinese echo "zh_CN GBK" echo "zh_TW CP950" # not CP938 ?? # Korean echo "kr CP949" # not CP934 ?? echo "kr_KR CP949" # not CP934 ?? # Thai echo "th CP874" echo "th_TH CP874" # Other echo "eo CP850" echo "eo_EO CP850" ;; esac indent-2.2.11/intl/Makefile.in0000644000177400010010000002515411041664102013007 00000000000000# Makefile for directory with message catalog handling in GNU NLS Utilities. # Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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. PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ transform = @program_transform_name@ libdir = @libdir@ includedir = @includedir@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/intl aliaspath = $(localedir) subdir = intl INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar CC = @CC@ LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ -DLIBDIR=\"$(libdir)\" -DIN_LIBINTL @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) HEADERS = $(COMHDRS) libgnuintl.h loadinfo.h COMHDRS = gmo.h gettextP.h hash-string.h plural-exp.h eval-plural.h os2compat.h SOURCES = $(COMSRCS) intl-compat.c COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \ plural-exp.c localcharset.c localename.c osdep.c os2compat.c OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \ plural.$lo plural-exp.$lo localcharset.$lo localename.$lo osdep.$lo GETTOBJS = intl-compat.$lo DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ COPYING.LIB-2 gettext.h libgettext.h plural-eval.c # Libtool's library version information for libintl. # Before making a gettext release, the gettext maintainer must change this # according to the libtool documentation, section "Library interface versions". # Maintainers of other packages that include the intl directory must *not* # change these values. LTV_CURRENT=4 LTV_REVISION=0 LTV_AGE=2 .SUFFIXES: .SUFFIXES: .c .y .o .lo .sin .sed .c.o: $(COMPILE) $< .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) $< .y.c: $(YACC) $(YFLAGS) --output $@ $< rm -f $*.h .sin.sed: sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ mv t-$@ $@ INCLUDES = -I.. -I. -I$(top_srcdir)/intl all: all-@USE_INCLUDED_LIBINTL@ all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed all-no: all-no-@BUILD_INCLUDED_LIBINTL@ all-no-yes: libgnuintl.$la all-no-no: libintl.a libgnuintl.a: $(OBJECTS) rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ libintl.la libgnuintl.la: $(OBJECTS) $(LIBTOOL) --mode=link \ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ $(OBJECTS) @LTLIBICONV@ -lc \ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ -rpath $(libdir) \ -no-undefined libintl.h: libgnuintl.h cp $(srcdir)/libgnuintl.h libintl.h charset.alias: config.charset $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ mv t-$@ $@ check: all # This installation goal is only used in GNU gettext. Packages which # only use the library should use install instead. # We must not install the libintl.h/libintl.a files if we are on a # system which has the GNU gettext() function in its C library or in a # separate library. # If you want to use the one which comes with this version of the # package, you have to use `configure --with-included-gettext'. install: install-exec install-data install-exec: all if test "$(PACKAGE)" = "gettext" \ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ orig=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ if test @GLIBC21@ = no; then \ orig=charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ fi; \ fi; \ $(mkinstalldirs) $(DESTDIR)$(localedir); \ test -f $(DESTDIR)$(localedir)/locale.alias \ && orig=$(DESTDIR)$(localedir)/locale.alias \ || orig=$(srcdir)/locale.alias; \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ : ; \ fi install-data: all if test "$(PACKAGE)" = "gettext"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \ for file in $$dists; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ dists="$(DISTFILES.generated)"; \ for file in $$dists; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ $(INSTALL_DATA) $$dir/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ dists="$(DISTFILES.obsolete)"; \ for file in $$dists; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-strip: install installdirs: if test "$(PACKAGE)" = "gettext" \ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ $(mkinstalldirs) $(DESTDIR)$(localedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: if test "$(PACKAGE)" = "gettext" \ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ rm -f $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ if test -f $(DESTDIR)$(localedir)/locale.alias; then \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext"; then \ for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi info dvi: $(OBJECTS): ../config.h libgnuintl.h bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: gettextP.h gmo.h loadinfo.h dcigettext.$lo: hash-string.h explodename.$lo l10nflist.$lo: loadinfo.h dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: plural-exp.h dcigettext.$lo: eval-plural.h tags: TAGS TAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) id: ID ID: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) mostlyclean: rm -f *.a *.la *.o *.lo core core.* rm -f libintl.h charset.alias ref-add.sed ref-del.sed rm -f -r .libs _libs clean: mostlyclean distclean: clean rm -f Makefile ID TAGS if test "$(PACKAGE)" = gettext; then \ rm -f ChangeLog.inst $(DISTFILES.normal); \ else \ : ; \ fi maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." # GNU gettext needs not contain the file `VERSION' but contains some # other files which should not be distributed in other packages. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: Makefile if test "$(PACKAGE)" = gettext; then \ additional="$(DISTFILES.gettext)"; \ else \ additional="$(DISTFILES.normal)"; \ fi; \ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ cp -p $$dir/$$file $(distdir); \ done Makefile: Makefile.in ../config.status cd .. \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: indent-2.2.11/intl/dngettext.c0000644000177400010010000000363711041664102013116 00000000000000/* Implementation of the dngettext(3) function. Copyright (C) 1995-1997, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DNGETTEXT __dngettext # define DCNGETTEXT INTUSE(__dcngettext) #else # define DNGETTEXT libintl_dngettext # define DCNGETTEXT libintl_dcngettext #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale and skip message according to the plural form. */ char * DNGETTEXT (domainname, msgid1, msgid2, n) const char *domainname; const char *msgid1; const char *msgid2; unsigned long int n; { return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dngettext, dngettext); #endif indent-2.2.11/intl/dcngettext.c0000644000177400010010000000361411041664102013254 00000000000000/* Implementation of the dcngettext(3) function. Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCNGETTEXT __dcngettext # define DCIGETTEXT __dcigettext #else # define DCNGETTEXT libintl_dcngettext # define DCIGETTEXT libintl_dcigettext #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCNGETTEXT (domainname, msgid1, msgid2, n, category) const char *domainname; const char *msgid1; const char *msgid2; unsigned long int n; int category; { return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ INTDEF(__dcngettext) weak_alias (__dcngettext, dcngettext); #endif indent-2.2.11/intl/intl-compat.c0000644000177400010010000000576711041664102013345 00000000000000/* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. Copyright (C) 1995, 2000-2002 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #define _INTL_REDIRECT_MACROS #include "libgnuintl.h" #include "gettextP.h" /* @@ end of prolog @@ */ /* This file redirects the gettext functions (without prefix) to those defined in the included GNU libintl library (with "libintl_" prefix). It is compiled into libintl in order to make the AM_GNU_GETTEXT test of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which has the redirections primarily in the include file. */ #undef gettext #undef dgettext #undef dcgettext #undef ngettext #undef dngettext #undef dcngettext #undef textdomain #undef bindtextdomain #undef bind_textdomain_codeset char * gettext (msgid) const char *msgid; { return libintl_gettext (msgid); } char * dgettext (domainname, msgid) const char *domainname; const char *msgid; { return libintl_dgettext (domainname, msgid); } char * dcgettext (domainname, msgid, category) const char *domainname; const char *msgid; int category; { return libintl_dcgettext (domainname, msgid, category); } char * ngettext (msgid1, msgid2, n) const char *msgid1; const char *msgid2; unsigned long int n; { return libintl_ngettext (msgid1, msgid2, n); } char * dngettext (domainname, msgid1, msgid2, n) const char *domainname; const char *msgid1; const char *msgid2; unsigned long int n; { return libintl_dngettext (domainname, msgid1, msgid2, n); } char * dcngettext (domainname, msgid1, msgid2, n, category) const char *domainname; const char *msgid1; const char *msgid2; unsigned long int n; int category; { return libintl_dcngettext (domainname, msgid1, msgid2, n, category); } char * textdomain (domainname) const char *domainname; { return libintl_textdomain (domainname); } char * bindtextdomain (domainname, dirname) const char *domainname; const char *dirname; { return libintl_bindtextdomain (domainname, dirname); } char * bind_textdomain_codeset (domainname, codeset) const char *domainname; const char *codeset; { return libintl_bind_textdomain_codeset (domainname, codeset); } indent-2.2.11/intl/plural-exp.c0000644000177400010010000000771411041664102013201 00000000000000/* Expression parsing for plural form selection. Copyright (C) 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" #if (defined __GNUC__ && !defined __APPLE_CC__) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) /* These structs are the constant expression for the germanic plural form determination. It represents the expression "n != 1". */ static const struct expression plvar = { .nargs = 0, .operation = var, }; static const struct expression plone = { .nargs = 0, .operation = num, .val = { .num = 1 } }; struct expression GERMANIC_PLURAL = { .nargs = 2, .operation = not_equal, .val = { .args = { [0] = (struct expression *) &plvar, [1] = (struct expression *) &plone } } }; # define INIT_GERMANIC_PLURAL() #else /* For compilers without support for ISO C 99 struct/union initializers: Initialization at run-time. */ static struct expression plvar; static struct expression plone; struct expression GERMANIC_PLURAL; static void init_germanic_plural () { if (plone.val.num == 0) { plvar.nargs = 0; plvar.operation = var; plone.nargs = 0; plone.operation = num; plone.val.num = 1; GERMANIC_PLURAL.nargs = 2; GERMANIC_PLURAL.operation = not_equal; GERMANIC_PLURAL.val.args[0] = &plvar; GERMANIC_PLURAL.val.args[1] = &plone; } } # define INIT_GERMANIC_PLURAL() init_germanic_plural () #endif void internal_function EXTRACT_PLURAL_EXPRESSION (nullentry, pluralp, npluralsp) const char *nullentry; struct expression **pluralp; unsigned long int *npluralsp; { if (nullentry != NULL) { const char *plural; const char *nplurals; plural = strstr (nullentry, "plural="); nplurals = strstr (nullentry, "nplurals="); if (plural == NULL || nplurals == NULL) goto no_plural; else { char *endp; unsigned long int n; struct parse_args args; /* First get the number. */ nplurals += 9; while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) ++nplurals; if (!(*nplurals >= '0' && *nplurals <= '9')) goto no_plural; #if defined HAVE_STRTOUL || defined _LIBC n = strtoul (nplurals, &endp, 10); #else for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++) n = n * 10 + (*endp - '0'); #endif if (nplurals == endp) goto no_plural; *npluralsp = n; /* Due to the restrictions bison imposes onto the interface of the scanner function we have to put the input string and the result passed up from the parser into the same structure which address is passed down to the parser. */ plural += 7; args.cp = plural; if (PLURAL_PARSE (&args) != 0) goto no_plural; *pluralp = args.res; } } else { /* By default we are using the Germanic form: singular form only for `one', the plural form otherwise. Yes, this is also what English is using since English is a Germanic language. */ no_plural: INIT_GERMANIC_PLURAL (); *pluralp = &GERMANIC_PLURAL; *npluralsp = 2; } } indent-2.2.11/intl/plural.y0000644000177400010010000001773411041664103012441 00000000000000%{ /* Expression parsing for plural form selection. Copyright (C) 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* The bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include "plural-exp.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ #ifndef _LIBC # define __gettextparse PLURAL_PARSE #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg %} %pure_parser %expect 7 %union { unsigned long int num; enum operator op; struct expression *exp; } %{ /* Prototypes for local functions. */ static struct expression *new_exp PARAMS ((int nargs, enum operator op, struct expression * const *args)); static inline struct expression *new_exp_0 PARAMS ((enum operator op)); static inline struct expression *new_exp_1 PARAMS ((enum operator op, struct expression *right)); static struct expression *new_exp_2 PARAMS ((enum operator op, struct expression *left, struct expression *right)); static inline struct expression *new_exp_3 PARAMS ((enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch)); static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); static void yyerror PARAMS ((const char *str)); /* Allocation of expressions. */ static struct expression * new_exp (nargs, op, args) int nargs; enum operator op; struct expression * const *args; { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (op) enum operator op; { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (op, right) enum operator op; struct expression *right; { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (op, left, right) enum operator op; struct expression *left; struct expression *right; { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (op, bexp, tbranch, fbranch) enum operator op; struct expression *bexp; struct expression *tbranch; struct expression *fbranch; { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } %} /* This declares that all operators have the same associativity and the precedence order as in C. See [Harbison, Steele: C, A Reference Manual]. There is no unary minus and no bitwise operators. Operators with the same syntactic behaviour have been merged into a single token, to save space in the array generated by bison. */ %right '?' /* ? */ %left '|' /* || */ %left '&' /* && */ %left EQUOP2 /* == != */ %left CMPOP2 /* < > <= >= */ %left ADDOP2 /* + - */ %left MULOP2 /* * / % */ %right '!' /* ! */ %token EQUOP2 CMPOP2 ADDOP2 MULOP2 %token NUMBER %type exp %% start: exp { if ($1 == NULL) YYABORT; ((struct parse_args *) arg)->res = $1; } ; exp: exp '?' exp ':' exp { $$ = new_exp_3 (qmop, $1, $3, $5); } | exp '|' exp { $$ = new_exp_2 (lor, $1, $3); } | exp '&' exp { $$ = new_exp_2 (land, $1, $3); } | exp EQUOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp CMPOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp ADDOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp MULOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | '!' exp { $$ = new_exp_1 (lnot, $2); } | 'n' { $$ = new_exp_0 (var); } | NUMBER { if (($$ = new_exp_0 (num)) != NULL) $$->val.num = $1; } | '(' exp ')' { $$ = $2; } ; %% void internal_function FREE_EXPRESSION (exp) struct expression *exp; { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (lval, pexp) YYSTYPE *lval; const char **pexp; { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (str) const char *str; { /* Do nothing. We don't print error messages here. */ } indent-2.2.11/intl/textdomain.c0000644000177400010010000001071011041664103013253 00000000000000/* Implementation of the textdomain(3) function. Copyright (C) 1995-1998, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "gettextP.h" #ifdef _LIBC /* We have to handle multi-threaded applications. */ # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_rwlock_define(CLASS, NAME) # define __libc_rwlock_wrlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain libintl_nl_default_default_domain # define _nl_current_default_domain libintl_nl_current_default_domain #endif /* @@ end of prolog @@ */ /* Name of the default text domain. */ extern const char _nl_default_default_domain[] attribute_hidden; /* Default text domain in which entries for gettext(3) are to be found. */ extern const char *_nl_current_default_domain attribute_hidden; /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define TEXTDOMAIN __textdomain # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define TEXTDOMAIN libintl_textdomain #endif /* Lock variable to protect the global data in the gettext implementation. */ __libc_rwlock_define (extern, _nl_state_lock attribute_hidden) /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ char * TEXTDOMAIN (domainname) const char *domainname; { char *new_domain; char *old_domain; /* A NULL pointer requests the current setting. */ if (domainname == NULL) return (char *) _nl_current_default_domain; __libc_rwlock_wrlock (_nl_state_lock); old_domain = (char *) _nl_current_default_domain; /* If domain name is the null string set to default domain "messages". */ if (domainname[0] == '\0' || strcmp (domainname, _nl_default_default_domain) == 0) { _nl_current_default_domain = _nl_default_default_domain; new_domain = (char *) _nl_current_default_domain; } else if (strcmp (domainname, old_domain) == 0) /* This can happen and people will use it to signal that some environment variable changed. */ new_domain = old_domain; else { /* If the following malloc fails `_nl_current_default_domain' will be NULL. This value will be returned and so signals we are out of core. */ #if defined _LIBC || defined HAVE_STRDUP new_domain = strdup (domainname); #else size_t len = strlen (domainname) + 1; new_domain = (char *) malloc (len); if (new_domain != NULL) memcpy (new_domain, domainname, len); #endif if (new_domain != NULL) _nl_current_default_domain = new_domain; } /* We use this possibility to signal a change of the loaded catalogs since this is most likely the case and there is no other easy we to do it. Do it only when the call was successful. */ if (new_domain != NULL) { ++_nl_msg_cat_cntr; if (old_domain != new_domain && old_domain != _nl_default_default_domain) free (old_domain); } __libc_rwlock_unlock (_nl_state_lock); return new_domain; } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__textdomain, textdomain); #endif indent-2.2.11/intl/localcharset.c0000644000177400010010000002245011041664102013546 00000000000000/* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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 Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #if HAVE_STDDEF_H # include #endif #include #if HAVE_STRING_H # include #else # include #endif #if HAVE_STDLIB_H # include #endif #if defined _WIN32 || defined __WIN32__ # undef WIN32 /* avoid warning on mingw32 */ # define WIN32 #endif #if defined __EMX__ /* Assume EMX program runs on OS/2, even if compiled under DOS. */ # define OS2 #endif #if !defined WIN32 # if HAVE_LANGINFO_CODESET # include # else # if HAVE_SETLOCALE # include # endif # endif #elif defined WIN32 # define WIN32_LEAN_AND_MEAN # include #endif #if defined OS2 # define INCL_DOS # include #endif #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') #endif #ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' #endif #ifndef ISSLASH # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) #endif #ifdef HAVE_GETC_UNLOCKED # undef getc # define getc getc_unlocked #endif #ifdef __cplusplus /* When compiling with "gcc -x c++", produce a function with C linkage. */ extern "C" const char * locale_charset (void); #endif /* The following static variable is declared 'volatile' to avoid a possible multithread problem in the function get_charset_aliases. If we are running in a threaded environment, and if two threads initialize 'charset_aliases' simultaneously, both will produce the same value, and everything will be ok if the two assignments to 'charset_aliases' are atomic. But I don't know what will happen if the two assignments mix. */ #if __STDC__ != 1 # define volatile /* empty */ #endif /* Pointer to the contents of the charset.alias file, if it has already been read, else NULL. Its format is: ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ static const char * volatile charset_aliases; /* Return a pointer to the contents of the charset.alias file. */ static const char * get_charset_aliases () { const char *cp; cp = charset_aliases; if (cp == NULL) { #if !defined WIN32 FILE *fp; const char *dir = LIBDIR; const char *base = "charset.alias"; char *file_name; /* Concatenate dir and base into freshly allocated file_name. */ { size_t dir_len = strlen (dir); size_t base_len = strlen (base); int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); file_name = (char *) malloc (dir_len + add_slash + base_len + 1); if (file_name != NULL) { memcpy (file_name, dir, dir_len); if (add_slash) file_name[dir_len] = DIRECTORY_SEPARATOR; memcpy (file_name + dir_len + add_slash, base, base_len + 1); } } if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) /* Out of memory or file not found, treat it as empty. */ cp = ""; else { /* Parse the file's contents. */ int c; char buf1[50+1]; char buf2[50+1]; char *res_ptr = NULL; size_t res_size = 0; size_t l1, l2; for (;;) { c = getc (fp); if (c == EOF) break; if (c == '\n' || c == ' ' || c == '\t') continue; if (c == '#') { /* Skip comment, to end of line. */ do c = getc (fp); while (!(c == EOF || c == '\n')); if (c == EOF) break; continue; } ungetc (c, fp); if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) break; l1 = strlen (buf1); l2 = strlen (buf2); if (res_size == 0) { res_size = l1 + 1 + l2 + 1; res_ptr = (char *) malloc (res_size + 1); } else { res_size += l1 + 1 + l2 + 1; res_ptr = (char *) realloc (res_ptr, res_size + 1); } if (res_ptr == NULL) { /* Out of memory. */ res_size = 0; break; } strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); strcpy (res_ptr + res_size - (l2 + 1), buf2); } fclose (fp); if (res_size == 0) cp = ""; else { *(res_ptr + res_size) = '\0'; cp = res_ptr; } } if (file_name != NULL) free (file_name); #else /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ # if defined WIN32 cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0" "CP20127" "\0" "ASCII" "\0" "CP20866" "\0" "KOI8-R" "\0" "CP21866" "\0" "KOI8-RU" "\0" "CP28591" "\0" "ISO-8859-1" "\0" "CP28592" "\0" "ISO-8859-2" "\0" "CP28593" "\0" "ISO-8859-3" "\0" "CP28594" "\0" "ISO-8859-4" "\0" "CP28595" "\0" "ISO-8859-5" "\0" "CP28596" "\0" "ISO-8859-6" "\0" "CP28597" "\0" "ISO-8859-7" "\0" "CP28598" "\0" "ISO-8859-8" "\0" "CP28599" "\0" "ISO-8859-9" "\0" "CP28605" "\0" "ISO-8859-15" "\0"; # endif #endif charset_aliases = cp; } return cp; } /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ #ifdef STATIC STATIC #endif const char * locale_charset () { const char *codeset; const char *aliases; #if !(defined WIN32 || defined OS2) # if HAVE_LANGINFO_CODESET /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); # else /* On old systems which lack it, use setlocale or getenv. */ const char *locale = NULL; /* But most old systems don't have a complete set of locales. Some (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't use setlocale here; it would return "C" when it doesn't support the locale name the user has set. */ # if HAVE_SETLOCALE && 0 locale = setlocale (LC_CTYPE, NULL); # endif if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } } /* On some old systems, one used to set locale = "iso8859_1". On others, you set it to "language_COUNTRY.charset". In any case, we resolve it through the charset.alias file. */ codeset = locale; # endif #elif defined WIN32 static char buf[2 + 10 + 1]; /* Woe32 has a function returning the locale's codepage as a number. */ sprintf (buf, "CP%u", GetACP ()); codeset = buf; #elif defined OS2 const char *locale; static char buf[2 + 10 + 1]; ULONG cp[3]; ULONG cplen; /* Allow user to override the codeset, as set in the operating system, with standard language environment variables. */ locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } if (locale != NULL && locale[0] != '\0') { /* If the locale name contains an encoding after the dot, return it. */ const char *dot = strchr (locale, '.'); if (dot != NULL) { const char *modifier; dot++; /* Look for the possible @... trailer and remove it, if any. */ modifier = strchr (dot, '@'); if (modifier == NULL) return dot; if (modifier - dot < sizeof (buf)) { memcpy (buf, dot, modifier - dot); buf [modifier - dot] = '\0'; return buf; } } /* Resolve through the charset.alias file. */ codeset = locale; } else { /* OS/2 has a function returning the locale's codepage as a number. */ if (DosQueryCp (sizeof (cp), cp, &cplen)) codeset = ""; else { sprintf (buf, "CP%u", cp[0]); codeset = buf; } } #endif if (codeset == NULL) /* The canonical name cannot be determined. */ codeset = ""; /* Resolve alias. */ for (aliases = get_charset_aliases (); *aliases != '\0'; aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) if (strcmp (codeset, aliases) == 0 || (aliases[0] == '*' && aliases[1] == '\0')) { codeset = aliases + strlen (aliases) + 1; break; } /* Don't return an empty string. GNU libc and GNU libiconv interpret the empty string as denoting "the locale's character encoding", thus GNU libiconv would call this function a second time. */ if (codeset[0] == '\0') codeset = "ASCII"; return codeset; } indent-2.2.11/Makefile.am0000644000177400010010000000530311015101640012014 00000000000000## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = no-texinfo.tex SUBDIRS = intl src doc po man BUILT_SOURCES = EXTRA_DIST = README \ config/config.rpath config/mkinstalldirs \ ChangeLog-1990 ChangeLog-1998 ChangeLog-2001 \ miscel/make-decc.com miscel/vaxc-make.com miscel/gnuc-make.com \ aclocal/UTIMBUF.m4 \ miscel/Makefile.mingw32 \ miscel/makefile.watcom \ miscel/README.vc++ \ miscel/README.VMS \ bootstrap \ regression DISTCLEANFILES=config/config.cache config/config.log config.h ps: cd doc && $(MAKE) @PACKAGE@.ps pdf: cd doc && $(MAKE) @PACKAGE@.pdf html: cd doc && $(MAKE) html html-split: cd doc && $(MAKE) html-split # --------------- Maintainer's Section MAINTAINERCLEANFILES = intl/* aclocal.m4 Makefile.in \ config.h.in config/* \ po/Makefile.in.in po/Rules-quot po/boldquot.sed po/en@boldquot.header \ po/en@quot.header po/insert-header.sin po/quot.sed po/remove-potcdate.sin \ stamp-h1 stamp-h.in configure \ @PACKAGE@-1.spec \ @PACKAGE@.lsm indent-2.spec .gdbinit \ INSTALL ABOUT-NLS ## Use -g when in maintainer mode if MAINTAINER_MODE CFLAGS+= -g -Wall -I. else CFLAGS+= -I. endif if MAINTAINER_MODE README: Makefile miscel/README.in configure.ac sed -e 's%!VERSION!%@VERSION@%g' miscel/$@.in > $@ miscel/Makefile.mingw32 miscel/makefile.watcom :%: %.in cat $@.in | perl -e 'while (<>) {chomp; print "$$_\015\012"; }' > $@ miscel/README.vc++ miscel/README.VMS @PACKAGE@.lsm :%: Makefile %.in sed -e 's%!VERSION!%@VERSION@%g' $@.in > $@ tar: $(MAKE) dist install -D @PACKAGE@-@VERSION@.tar.gz $(REDHAT)/SOURCES/@PACKAGE@-@VERSION@.tar.gz WWWDIR=/home/david/www/@PACKAGE@ REDHAT=$(shell grep '^%_topdir' rpm/macros | cut -d \ -f 2) SPECFILE=@PACKAGE@-${shell echo "@VERSION@" | cut -d. -f1}.spec rpm: tar $(SPECFILE) rpm --rcfile=/usr/lib/rpm/rpmrc:rpm/rpmrc --target=$(TARGET) --sign --clean -ba $(SPECFILE) $(SPECFILE): rpm/$(SPECFILE).in configure.ac cvs commit rpm/$(SPECFILE).in sed -e 's/!VERSION!/@VERSION@/g' rpm/$(SPECFILE).in | grep -B2000 '!CHANGELOG!' | grep -v '!CHANGELOG!' > $(SPECFILE) echo -n "%changelog" >> $(SPECFILE) cvs log rpm/$(SPECFILE).in | \ grep -A2000 '^-----' | \ egrep -v '^-----|^=====|^revision' | \ awk -F'[ ;]' --assign lastdate="" '{ if ($$0~/^date: /) { \ if (lastdate != $$2) { \ lastdate=$$2; \ printf("\n* "); \ system("echo -n `date --date \""$$2" "$$3"\" \"+%a %b %d %Y\"`"); \ printf(" $(AUTHOR)\n"); \ } \ } else if ($$0~/^[A-Z]/) { printf("- %s\n", $$0); } else if ($$0~/./) { printf(" %s\n", $$0); } else {print} }' >> $(SPECFILE) grep -A2000 '!CHANGELOG!' rpm/$(SPECFILE).in | grep -v '!CHANGELOG!' >> $(SPECFILE) endif ACLOCAL_AMFLAGS = -I m4 indent-2.2.11/ChangeLog-19980000644000177400010010000014367510775646104012206 000000000000001998-12-02 * indent.c (need_chars): Changed this #define to an inline function. Also, increase size of buffer by at least `needed'. 1998-11-25 * lexi.c (lexi): New case lable for 'L' in switch (*token) to handle wide strings. In the if statement for alphanums, fail the test if we are looking at L" or L'. * regression/TEST: added new test case wide.c to EXAMPLES. 1998-11-24 * indent.texinfo (Common styles): Corrected description of canned styles to correspond with args.c * makefile.in (TARFILES): Removed indent.1 from the list. 1998-11-23 * backup.c (make_backup): Removed #ifdef __MSDOS__, just declare size unsigned int in all cases. 1998-11-22 * All code now passes through gcc -Wall. * args.c: Removed unused variable `exp_troff'. * comments.c (print_comment): Removed unused label comment_exit. * io.c (dump_line): Removed unused label inhibit_newline. * makefile.in (indent.html): New target. * sys.h: Removed conditionals around `memcpy' function and define of `bcopy' to `memcpy'. I will assume that memcpy is available, and see if it's problematic. * memcpy.c: Changed #ifdef USG to #ifndef HAVE_MEMCPY. * regression/TEST: added new test files bbb-test.c and class-func.cc. * comments.c (print_comment): Use new variable `comment_lines_count' to count lines in a boxed comment. When printing a boxed comment, set `parser_state_tos->com_col' to `found_col' when returning from a single line boxed comment. 1998-11-21 * indent.h (struct buf): New `len' and `column' elements added to struc buf. * indent.c (indent): Update `save_com.len' where appropriate. Set `save_com.column' where appropriate. * io.c (current_column): Use `len' element of save_com to detect if `buf_ptr' is using the save_com buffer, rather than the `end' element, because that could point to the `ptr' (beginning) element. * indent.c (indent): Null-terminate the `save_com' buffer. 1998-11-20 * indent.c (indent): Include parser_state_tos->classname != '\0' in determining whether to set `is_procname_definition'. * indent.h (struct parser_state): New elements `classname_' and `classname_end'. * lexi.c (lexi): If we detect "::" after an indent, set `classname_' and `classname_end'. * parse.c (reset_parser): Initialize `classname_' and `classname_end'. * indent.c (indent): Don't break the line if we had an identifier and `parser_state_tos->last_token' is doublecolon. * indent.h (codes): Changed enum value `operator' to `cpp_operator', since "operator" is a C++ keyword. indent.c: Likewise. lexi.c: Likewise. 1998-10-20 * indent.c (indent): In the while (parser_state_tos->search_brace) loop, notice if we see a newline and make sure it's output by using new local variable `just_saw_nl'. 1998-10-01 * io.c (dump_line): If we're resetting the indentation level because a break is just before an lparen, check that parser_state_tos->paren_level >= 2 before doing this. Thu Aug 27 10:19:24 1998 * indent.c (main): Removed type of `main'. 1998-08-25 * args.c (pro): Changed the "-nps" member of the "gnu" options settings to "-npsl" as the nps option does not exist. 1998-08-23 * comments.c (print_comment): If the comment begins in the very first column and user specified -fc1, indent it to the code. Don't touch the comment at all if -fc1 was not specified. 1998-08-22 * io.c (dump_line): If `break_line' is set, there is no comment on the line, and `buf_break' is properly set, break the line at `buf_break' and fill s_code with the un-output portion of the line. Use new variable `not_truncated' to indicate whether the line was broken or not. Only reset `e_code' to `s_code' if we didn't break the line. If we broke the line, the the next line will begin with a lparen, then reset `parser_state_tos->paren_indents' to the level for the *previous* lparen - otherwise, the line will get indent to where the paren was on the original line. * indent.c (indent): If we plan to break the line, set `break_line' and `force_nl'. Whereever we append a blank to the output line, set `buf_break' to that point. Also, NULL-terminate the line. * indent.c, args.c, io.c: All troff-related code removed. 1998-08-17 * indent.c (indent): Initialize `buf_break' to 0. If it seems like we need to break the line, set `buf_break' to `buf_ptr'. * indent.h: New variable `buf_break' for keeping track of the last place we can break a line. 1998-07-22 Joseph Arceneaux * io.c (dump_line): Remove any trailing spaces before outputting code. Fri Jun 27 12:29:11 1997 Joseph Arceneaux * indent.h: Removed broken declaration of lexi (). Thu May 15 15:52:25 1997 Joseph Arceneaux * indent.c (indent): Handle new codes elements `operator' and `overloaded'. * indent.h (rwcodes): New rwcodes element `operator'. (codes): New elements `overloaded' and `operator'. * lexi.c (lexi): When a keyword is found, check for new rwcodes element rw_operator and if found return `operator'. In default case, return `overloaded' if last token was `operator'. Fri Apr 11 12:25:08 1997 Joseph Arceneaux * indent.h (codes): New code `doublecolon'. * lexi.c (lexi): Recognize "::" as new code doublecolon. * indent.c (indent): Handle new code `doublecolon'. * backup.c (make_backup): Use new variable `size' to handle MSDOS 16 bit values for amount written to file. * io.c (dump_line): Cast (e_lab - s_lab) to an int for the "%.*s" width specifier ('*' means use the first argumen to the string as the width). (read_file): Cast size arguments to `xrealloc' and `xmalloc' to unsigned. (read_file): Use unsigned int for `size' on MSDOS, so that we can read slightly larger sizes. Ugh! Thu Dec 12 10:13:22 1996 Joseph Arceneaux * indent.c (main): Make certain that `in_name' is initialized before reading file contents; reading a zero-length file results in a call to ERROR, which expects `in_name' to be set. Thu Jan 4 11:39:39 1996 Joseph Arceneaux * parse.c (parse): Don't use variable `case_ind' any more; do it all on the `cstk' parser stack element. (inc_pstack): Copy the case indentation value from the lower stack frame to the new, top frame. (parse): In main switch, case lbrace, if `swstmt' is on top of stack and `case_indent' is non-zero, add it to `parser_state_tos->i_l_follow'. (parse): In main swtich, case `swstmt', just increment `parser_state_tos->i_l_follow' by `ind_size', not `case_indent'. Sat Dec 30 09:51:52 1995 Joseph Arceneaux * indent.texinfo (Invoking indent): Described format of .indent.pro, including comments. * args.c (scan_profile): Added handling of comments, both C++ and C, in the indent profile. Also added check for end of buffers. Fri Dec 29 13:42:30 1995 Joseph Arceneaux * regression/TEST: New test file right-margin-comment.c. * comments.c (print_comment): After the main switch statment, if formatting and the line break is after any text, then skip any white space. For C++ comments, if that white space includes a newline, then end the comment by jumping to new label `cplus_exit'. New label `comment_exit', for terminating C comment. Not currently used. Thu Dec 28 16:48:50 1995 Joseph Arceneaux * makefile.in: Added new variable `NTFILES', set to "indent.mak". Include ${NTFILES} in TARFILES. * indent.mak: New file for building under NT. Contributed by beverly@datacube.com (Beverly Brown). * indent.h (fstate): Changed member `allcaps' from 1-bit int to unsigned char. Wed Dec 27 14:33:36 1995 Joseph Arceneaux * regression/TEST: New test files first-in-block.c and two-on-line.c. * comments.c (print_comment): For lower-level comments which begin lines, don't set `start_column' dependent on if the comment began in column 1 or not; always set it to the indent level minus whatever unindent was specified. Do continue to set `format' depending on that condition, however. case EOL in main loop, if it's a c++ comment, just pop the stack and return. Let the main token handling loop deal with the newline and calling `dump_line'. (print_comment): New variable `two_contigous_comments', for handling cases of lines consisting of two or more comments, but no code, on a single line. All updates of `parser_state_tos->com_col' now consider this variable. Also, set `parser_state_tos->box_com' to `boxed_comment' whereever `parser_state_tos->com_col' is set. (print_comment): Subsequent to the first handling of boxed comments, removed all initialization of stuff conditional on `boxed_comment', since that is 0. Note that this is before the main loop, where this could get set. Mon Oct 30 13:02:07 1995 Joseph Arceneaux * regression/TEST: New test file "kr-proc-decls.c" * indent.c (indent): `is_procname' renamed to `is_procname_definition' and set only if `parser_state_tos->in_parameter_declaration' is also set (besides just `parser_state_tos->procname[0]' not being null). * args.c: New variable `space_after_pointer_type'. * indent.h: Declared here. * indent.h (codes): New element `start_token'. * parse.c (reset_parser): Used to initialize `parser_state_tos->last_token'. * lexi.c (lexi): When examining an alphanumeric, in the hack for guessing if the token is a typedef'd declaration keyword, add an if sub-clause "parser_state_tos->last_token == start_token". * indent.c (indent): In case newline, try to detect the case of breaking the line between a type and a procedure name, and if user has specified that procnames don't start lines (e.g., K&R style), don't break the line. Also, if the type seems to have been a pointer type and the new variable `space_after_pointer_type' is set, then request a space. Sun Oct 29 10:43:09 1995 Joseph Arceneaux * parse.c (reset_parser): Initialize the first element of `parser_state_tos->il', `parser_state_tos->cstk', and `parser_state_tos->paren_indents'. Sat Oct 28 09:00:29 1995 Joseph Arceneaux * indent.c (indent): When searching for brace, in the `default' case, don't put the token into the save buffer. Rather, back up `buf_ptr' by setting it to token. Since this is the place where we much with the other input buffer, I'm hoping this action won't conflict with anythin. * lexi.c (lexi): Don't set `token_end' at the end of this loop. Set it instead in the switch statement where `buf_ptr' is advanced. Otherwise, it may wind up pointing into a different buffer than `token', because a call to `fill_buffer ()' switched the buffers. Who is the complete loser who designed this program? * indent.c (indent): Under the `sw_buffer' label, don't add useless extra space to the end of the `save_com' buffer. * lexi.c (lexi): In case case '#', if `leave_preproc_space' is set, append any blanks following '#' to the token. * indent.c (indent): In case preesc, just stick the whole token onto the output stream. * regression/TEST: Added new test case, no-newline2.c * indent.c (indent): In main switch statement, case preesc while loop looking for end of line now also checks `had_eof'. * indent.texinfo (Option Summary): Doc fix in summary for "-l". * comments.c (print_comment): Initialized `save_length'. Reset `save_length' to 0 when we reset `save_ptr' (changes nothing, but makes gcc -Wall -O happy). * indent.h: Declare `inc_pstack ()'. * version.h: Changed version to 2.0. * makefile.in (indent.info): Don't depend on ${MAN} * indent.texinfo (Comments): Removed discussion of "-l" option here. (Changed indent version number to 2.0, manual number to 1.4) * args.c (set_defaults): Made INLINE. (option_prefix): Ditto. (eqin): Ditto. Thu Oct 26 11:05:38 1995 Joseph Arceneaux * indent.c (output_line_length): New function to calculate the apparent length of the current output line. (indent): A the beginning and end of the main loop, check to see if we have surpassed any line length restrictions (specified by `max_col'), and if so, set `force_nl'. (indent): In main switch statment cases `comma', and `newline', remove ancient check for surpassed line length. * indent.c (indent): No longer sets `comment_max_col' to `max_col' if the former is 0. These now both default to non-zero values. * regression/TEST: Added "-lc 50" to a bunch of lines, to make the comment margin be the same as the line margin, now that I've changed the behaviour of this code in `indent'. * indent.h (DEFAULT_RIGHT_COMMENT_MARGIN): New #define to 78, which is what `comment_max_col' wound up defaulted to before. (DEFAULT_RIGHT_MARGIN): New #define to 78. This will break some of the earlier behaviour. * args.c (pro): Removed the "-nps" and "-ps" options. * indent.h (codes): Changed `period' to `struct_delim', handling both '.' and "->". * lexi.c (lexi): For case of "->", simply return code `struct_delim'. For case of '.', also return code `struct_delim'. * indent.c (indent): Replaced all instances of `period' with `struct_delim'. * io.c (count_columns): New parameter `stop_char', which can stop the count before a null char. (dump_line, compute_code_target): Calls to `count_columns' changed appropriately. * comments.c (print_comment): Likewise. * sys.h (NULL_CHAR): New #define. Mon Oct 2 17:25:35 1995 Joseph Arceneaux * globs.c (fatal): Don't return `system_error', just `indent_fatal'. * indent.h: Removed `system_error' exit value. This is handled by `indent_fatal'. Tue Aug 9 20:46:53 1994 Joseph Arceneaux * indent.c (PARSE): New macro for calling the parser. Sets `file_exit_value' to `indent_error' if an error happened. Fri May 6 18:58:04 1994 Joseph Arceneaux (jla@albert.gnu.ai.mit.edu) * vaxc-make.com: Changed PR_COMMENT.C to COMMENTS.C. Tue Apr 5 21:40:22 1994 Joseph Arceneaux (jla@albert.gnu.ai.mit.edu) * comments.c (print_comment): In `while' loop handling boxed comments, make sure to check if we need to call `fill_buffer' at every place `buf_ptr' gets advanced. Sun Feb 27 01:21:44 1994 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * globs.c (fatal): New function which replaces "sys_error". All affected files changed accordingly. * indent.h (WARNING): New define using `message'. (ERROR): Likewise. Many global things now declared extern here. * sys.h: Several system functions declared extern here. * globs.c (sys_error): #ifdef DEBUG, call `abort'. (message): New function to replace `diag'. Sat Feb 26 22:41:27 1994 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * io.c: Variable `found_err' removed. indent.h: Ditto. * indent.c (indent): Added a default case to the big switch statement. Mon Feb 21 16:55:43 1994 Joseph Arceneaux (jla@geech.gnu.ai.mit.edu) * backup.c (make_backup): If error, exit with `system_error'. * io.c (parsefont): Exit with `invocation_error'. * backup.c: * globs.c: #include "indent.h" * makefile.in: Note these new dependencies. * args.c (set_option): In case PRO_PRSTRING, exit with `invocation_error' rather than 0. Changed all calls to `exit' to use type 'enum exit_value`. * indent.c (indent): Return value now of type `enum exit_value'. New variable `file_exit_value' used to return this value. Calls to `exit' changed to `return' statements. (main): New variable `exit_status' used to return final exit value. New variable `status' in for loop for checking return value of `indent'. All calls to `exit' changed to use new enum values. Sun Feb 20 18:16:56 1994 Joseph Arceneaux (jla@albert.gnu.ai.mit.edu) * globs.c (xmalloc): Changed value of `exit' to 2. (sys_error): Moved here from io.c. * backup.c (make_backup): Changed value of `exit' to 2. * indent.h: New type `enum exit_value'. * comments.c (print_comment): When processing a boxed comment and we have reached the end, increment `buf_ptr' before checking limits and calling `fill_buffer'. Sat Feb 19 18:29:20 1994 Joseph Arceneaux (jla@albert.gnu.ai.mit.edu) * lexi.c (lexi): Understand complex suffixes (GNU C extensions) 'i' and 'j'. Thu Feb 10 15:51:35 1994 Joseph Arceneaux (jla@albert.gnu.ai.mit.edu) * comments.c (print_comment): Call `CHECK_COM_SIZE' when processing boxed comments. Wed Feb 9 09:39:14 1994 Joseph Arceneaux (jla@albert.gnu.ai.mit.edu) * backup.c (make_backup): Removed unused variables `p' and `new_version'. Fri Feb 4 01:34:59 1994 Joseph Arceneaux (jla@geech.gnu.ai.mit.edu) * gnuc-make.com: Changed `pr_comments.c' to comments.c. * comments.c: Initialize `parser_state_tos->box_com' to 1 in boxed comment section. Tue Feb 1 01:03:50 1994 Joseph Arceneaux (jla@geech.gnu.ai.mit.edu) * args.c (set_option): Handle new enum `PRO_FUNCTION' by calling p->p_obj as a function. * indent.texinfo: Updated version info, copyright. Whoops! Ignore all references to "-nbbb" and "-bbb". Sat Jan 29 18:15:42 1994 Joseph Arceneaux (jla@geech.gnu.ai.mit.edu) * Version 1.9 released. * indent.texinfo (Option Summary): Describe new option "-lc". * args.c, indent.c: `block_comment_max_col' renamed to comment_max_col. * comments.c: `right_margin' set to `block_comment_max_col'. Documentation of `print_comment' changed. * makefile.in (NOTES): Changed to include COPYING. * COPYING: Upgraded to version 2 of the GNU license. * NEWS, README, VMS.README: Updated for version 1.9. Wed Jan 19 17:54:32 1994 Joe Arceneaux (jla at sparky) * comments.c (print_comment): Handling of standard box comments rewritten; now it all happens in its own little loop as soon as the thing is detected. Thu Jan 13 10:37:31 1994 Joe Arceneaux (jla at sparky) * comments.c (print_comment): Change of Fri Jun 4 18:10:54 1993 reinstalled. How this ever got uninstalled is a mystery to me, and makes me wonder about keeping the main source directory on a GNU machine. Wed Jan 12 15:08:48 1994 Joe Arceneaux (jla at sparky) * comments.c (print_comment): Handle better the cases of formatted comments with no contents. Make main loops conditional on (! had_eof). Pop stack and reset parser_state_tos->com_col after main loop before returning. Sun Jan 9 23:35:28 1994 Joe Arceneaux (jla at sparky) * io.c (fill_buffer): Rewrite main loop. Fri Jan 7 15:10:23 1994 Joe Arceneaux (jla at sparky) * io.c (read_file): Complain if file is zero-length. Thu Jan 6 17:10:44 1994 Joe Arceneaux (jla at sparky) * indent.c (indent): Removed several calls to `fill_buffer' which were superfluous because we know the char just read was not EOL or NULL. * io.c (sys_error): Cleanup realloc buisiness and moved former static `errbuf' into this function. It never returns, so no worry about reallocing. * io.c: Cleaned up several #if 0. Tue Jan 4 20:06:17 1994 Joe Arceneaux (jla at sparky) * comments.c (print_comment): In the conditional `if (blankline_delims)' removed while clause `(p < buf_end)'. Wed Dec 29 17:21:29 1993 Joe Arceneaux (jla at sparky) * makefile.in: Renamed file `pr_comment.c' to `comments.c'. * io.c (read_file): Call `xrealloc' on fileptr.data and fileptr.name if there is already stuff there. Wed Dec 22 14:11:24 1993 Joe Arceneaux (jla at sparky) * indent.c (indent): In case newline, once again modified conditional for calling `dump_line': Added sub-clause of not being `parser_state_tos->in_decl'. Mon Jun 28 20:41:52 1993 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * sys.h: For MSDOS, only define USG if not using GCC. This breaks `memcpy' and stuff from ctypes.h, apparently. * makefile.in (distclean): Remove config.status. * (.c.o): Put ${DEFS} first, and ${CFLAGS} last. * RELEASE-NOTES renamed to NEWS globally. Mon Jun 21 17:43:26 1993 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * indent.c (indent): Check that `code_lines' and `com_lines' are both greater than zero before printing out their ratio. Fri Jun 18 17:46:09 1993 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * version.h: `VERSION_STRING' inc'd to version 1.9. * backup.c: Removed all instances of old define `SYS_BACKUP_SUFFIX'. * io.c (vms_read): Fixed while loop to be more correct, and return bufp - buffer rather than nread, which may be incorrect value. Thu Jun 17 21:08:14 1993 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * makefile.in: Changed `CFLAGS' to just "-O". Wed Jun 16 15:32:36 1993 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * Version 1.8 released. * makefile.in: New variable VMSFILES describing the files needed for indent under VMS. Removed comments.texinfo from list of files to tar. Use `gzip' utility for compression, rather than tar -z. * configure-6-93: * configure.in-693: Copies of the configure script and its input file from the autoconf directory. The reliability of the ones in the autoconf directory is questionable. `configure' and `configure.in' are now links to these files. * version.h: Comments rewritten. Tue Jun 15 10:14:47 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * Thanks to MEHRDAD@glum.dev.cf.ac.uk for the VMS patches. * io.c (read_file): Use SYS_READ, conditional expansion, instead of read. (vms_read): Substitute for `read' under VMS. * backup.c: Set `simple_backup_suffix' from new define BACKUP_SUFFIX_STR. Define this (to "~") if undefined. Likewise, BACKUP_SUFFIX_CHAR and BACKUP_SUFFIX_FORMAT. * sys.h: Conditional defines for VMS added. * args.c (set_profile): Use new define PROFILE_FORMAT for formatting homedir/profile path. Mon Jun 14 11:37:14 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.texinfo (Comments): Section completely rewritten. Old text in file old-comments.texinfo. * indent.texinfo (Statements): Explained how -bl and -br affect struct declarations. * indent.c (indent): In case newline, modified conditional determining whether or not to call `dump_line' to avoid doing so after a right brace if user has specified `btype_2'. This makes enums and structs more consistent -- in default mode, the name of the struct goes on a separate line from the rbrace and on the same line in K&R mode, and does so consistently whether in or outside a procedure block. * sys.h: Added some defines for compilation under MS-DOS, under #ifdef __MSDOS__. Thanks to hnyman@lesti.hut.fi. * io.c (read_file): Adjust `fileptr.size' to be what `read' returned, if different from the results of `stat'. This is because the DOS `read' converts the CR-LF on disc to '\n' in memory. Fri Jun 11 12:39:38 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * lexi.c (lexi): Accept LL and ULL as suffixes to numbers as well. Suggested by rdh@key.amdahl.com. * indent.c (indent): In case `rbrace', when conditionally setting `force_nl', extended the first clause of the if conditional to make `rw_decl' equivalent to `rw_struct_like', and also depend on `btype_2'. This keeps the structure name on the same line when running with -kr option. * parse.c (parse): In case `lbrace', in conditional for adding `brace_indent', also consider `btype_2'. Thu Jun 10 17:21:54 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * io.c (count_columns): Rewritten and renamed from `count_spaces'. Wed Jun 9 12:45:07 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.texinfo (Disabling Formatting): New section describing the new feature implemented below in io.c. * io.c (compute_code_target): Rewritten to be clearer. Note that the use of `max_col' is inconsistent with it's use elsewhere, where it is primarily for use with comment formatting. * (fill_buffer): Rewritten completely. Now handles command comments /* *INDENT-OFF* */ and /* *INDENT-ON* */. `inhibit_formatting' is now a local variable; the reference to it in `dump_line' has been removed. Control of formatting is handled entirely within `fill_buffer'. Tue Jun 8 19:03:22 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.c (indent): In case `lbrace', when resetting ..->decl_on_line, also reset ->in_decl. Not doing this had the effect that the first statement after the opening '{' of a procedure would not be properly continued if it was broken across two lines. There is probably a better place to do this. * io.c (dump_line): In the loop which outputs `s_code', removed the stupid tab calculations, as well as the undocumented feature for printing out the character '0200'. * parse.c (parse): In case `lbrace', if last reserved word was `rw_struct_like', don't indent for struct if the last token was an `rparen'. This fixes a bug with a struct pointer parameter. * regression/TEST: Added new test struct_param.c. Mon Jun 7 17:01:23 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.c (indent): When handling an embedded comment, if there is code on the line, set `embedded_comment_on_line' to 2, otherwise to 1, to communicate to dump_line () if the line starts with code or comment text. * io.c (dump_line): In section for code (s_code != e_code), if `embedded_comment_on_line' is 1, then use comment indentation, otherwise, use code indentation. Fri Jun 4 18:10:54 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * pr_comment.c (print_comment): When looking at a leading '*' to decide if it begins the second line of a starred boxed comment (by looking at what column it was in), compare that column to `found_column' rather than `start_column'. * indent.c (indent): In case preesc, when handling stuff following the '#', set `quote' when we encounter the quoting character the first time. Also merged cases '\'' and '"'. * regression directory: Merged all the new comment code tests into the standard regression tests. Wed May 19 12:11:10 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * pr_comment.c (print_comment): At `end_line:', don't compress into newlines if it's the first line (because it has the starting delimiter). * pr_comment.c (print_comment): Moved checks for `buf_ptr' past end outside of while loops (only '\n' and '\0' end the buffer, and changed "buf_ptr >= buf_end" to "buf_ptr == buf_end". * parse.c: `parser_state_tos' elements `comment_delta' and `n_comment_delta' eliminated. * indent.h: Ditto. * pr_comment.c: Ditto. * io.c: Old comment code removed. * pr_comment.c (print_comment): New variable `visible_preamble' set if the preamble is not whitespace. Used to make sure lines which only have whitespace on them become single newlines. Don't use `postfix_blankline_requested' to add newlines. This screwed up the algorithm for dealing with paragraph breaks. In the `end_line:' section, only advance `buf_ptr' if it wasn't a paragraph break, because in that case we have scanned ahead a character to detect "\n\n". Tue May 11 17:26:18 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * pr_comment.c (print_comment): For comment formatting, changed comparison of `column' to `right_margin' from >= to >. Tue Apr 6 17:51:41 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * pr_comment.c (print_comment): Also consider the characters '=' and '_' to make up the top line of a boxed comment. * comments.texinfo: Changed to reflect this. Wed Feb 24 15:22:51 1993 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * makefile.in: Added "-O" to CFLAGS. Thu Feb 11 15:54:10 1993 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * Version 1.7 released. * makefile.in: Renamed from zmakefile.in. All "-f zmakefile" arguments to `MAKE' removed. Dependencies on "zmakefile.in" changed to "makefile.in". * Makefile: Changed references to "zmakefile" to "makefile". Wed Feb 10 12:25:04 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.c (indent): In case preesc, when going through the line, consider EOL as terminating a C++ comment. Mon Feb 8 04:45:06 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * memcpy.c: Function `memcpy' surrounded by #ifdef USG. USG is only defined if `configure' did not find `bcopy'. memcpy.o should only be loaded if `configure' did not find it. * sys.h: If USG not defined, define memcpy to be bcopy. * makefile.in: Renamed from zmakefile.in. * configure: Use "makefile" rather than zmakefile. Explicitly name `indent' in rule for same. * indent.texinfo: Updated copyright and version information. Added new section Bugs. Added "nlps" option. * io.c (pad_output): Rewritten. If `tabsize' is less than one, use spaces rather than tabs. * sys.h: #define TAB and EOL. Changed type of element `size' in struct file_buffer to unsigned long. * indent.h, io.c: Type of `in_prog_size' changed to unsigned long. * indent.c, parse.c, pr_comment.c, lexi.c, io.c: Use new macros TAB and EOL instead of '\t' and '\n'. * args.c, indent.c, backup.c, io.c, parse.c: Cast integer arguments to printf. * indent.c: * lexi.c: * parse.c: Added missing parameters to calls to `diag'. * args.c: Added new long option "remove-preprocessor-space". Fri Feb 5 17:40:08 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.c (indent): In case semicolon, case lbrace, and case rbrace, disabled code which checked paren levels (with parser_state_tos->p_l_follow) to enable passing weird stuff to macros. See comments ending "-jla". (indent): In case lparen, if in a declaration, don't indent out to `dec_ind' if the paren was '['. * Removed several global variables which were shadowed by locals to function `indent'. * args.c: Turned off, by default, "lps" option. Added "nlps" option. * io.c (current_column): New function. * lexi.c: In case ':', set parser_state_tos->want_blank under certain conditions. Tue Feb 2 14:03:39 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.c (indent): Handle C++ comments, with special attention to the code for case preesc. Thu Jan 28 17:31:57 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * parse.c (reset_parser): Initialize parser_state_tos->com_col to 0. Wed Jan 27 13:45:16 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.c (indent): Handle new code type `cplus_comment'. * lexi.c (lexi): Handle C++ comments ("//"). * indent.h: Macros CHECK_CODE_SIZE and CHECK_LAB_SIZE moved to indent.c. Macro CHECK_COM_SIZE moved to pr_comment.c. New code, `cplus_comment'. * pr_comment.c (pr_comment): Removed variable `just_saw_decl' and it's use. Sat Jan 23 19:36:31 1993 Joseph Arceneaux (jla@betty-blue.gnu-age.com) * indent.c (indent): Only reset `com_ind' if it's less than or equal to 0. Don't call parse (semicolon) initially. Skip any leading newlines, resetting col to 1. Don't set `parser_state_tos->ind_level' and `parser_state_tos->i_l_follow' if col > ind_size. * parse.c (reset_parser): If tabsize is 0, set it to 1. Fri Oct 9 21:01:49 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.c (indent): Restuctured the conditional for setting `force_nl' in case rbrace to be clearer. Also, only check whether to set `postfix_blankline_requested' we're not setting `force_nl'. Wed Oct 7 16:15:25 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * io.c (diag): Only one format of error message now. Output it on the standard error in any case. * indent.c (indent): In case decl, don't call "parse (decl)" if we are in a "sizeof". * args.c: Make default value for `format_col1_comments' be false, to correspond with the "-gnu" spec. Fri Aug 28 19:15:50 1992 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * args.c (set_option): Added missing argument to call to `set_option'. Mon Aug 24 12:47:32 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * sys.h (INLINE): Define this to "__inline__" if __GNUC__ is defined, not "inline". Good thing we have standards... * indent.c (indent): New variable `embedded_comment_on_line' set if an embedded comment is found. * io.c (dump_line): Increment `com_lines' in the case where the comment buffer is empty, but `embedded_comment_on_line' is true. Clear that variable in both cases. This makes indent include embedded comments in its count of total comment lines. * io.c (read_stdin): If the input buffer is realloc'd, update the character pointer `p'. Wed Aug 19 18:25:48 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * Version 1.6 released. * indent.c (indent): In case comma, use `tabsize' rather than 8 to determine if we're past max_col. In case newline, also dump the line if we are past max_col. Fri Aug 14 19:08:04 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * io.c (dump_line): Test `swallow_optional_blanklines' separately from (prefix_blankline_requested && not_first_line). Makes "-sob" work properly. * indent.c (indent): Intialize several local variables to 0. Tue Aug 11 18:02:38 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.c (indent): In case rbrace, add clause to conditional for setting `force_nl'. The clause forces a newline after '}' in most cases. In case swstmt, set `parser_state_tos->in_decl' to false, since we know we're not in a declaration if have just seen "switch" (of course, who knows what indent might think about things). This corrects the indentation of a case label following the lbrace of the switch. Mon Aug 10 16:23:54 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.gperf: "return" generates `rw_return', not `rw_break'. How did this happen? I didn't make this change, and it was not present in indent 1.4. Doubtless this insidious program modifies itself destructively... * lexi.c (hash, is_reserved): regenerated from indent.gperf. * args.c: Make the -gnu setting specify "-bli2" rather than "-bli4". * lexi.c (lexi): Accept 'F' suffixes on numeric constants. * sys.h Require "__GNUC__" to define INLINE, not "__STDC__". Mon Aug 4 21:22:54 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * Version 1.5 released. Mon Aug 3 21:14:40 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.c (indent): In case rparen, removed the change of Jul 28. This is now done if the case mask fails and parser_state_tos->in_decl is true and ..->block_init is false. The old change broke the "-ncs" feature. Perhaps this could have been done otherwise by using ..->last_u_d. Also, decrement `parser_state_tos->paren_depth' immediatly. * All source files formatted with ./indent. * pr_comment.c (pr_comment): If `parser_state_tos->box_com' is set (which means that the comment is presumed to be hand-formatted), set `parser_state_tos->n_comment_delta' to (1 - parser_state_tos->com_col), rather than using `count_spaces' to calculate the space up to the comment column. Not only is this simpler, but the old code used `cur_line' to count those spaces, which was pointing to the *NEXT* line in some cases (because some code in indent () which ignored newlines (like in the case of multi-line comments after #define statments) called fill_buffer ()). Another example of just how brain damaged this code is. For more extreme self-abuse, look a the interaction between pr_comment () and dump_line (). Sun Aug 2 02:10:32 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * pr_comment.c (pr_comment): When computing `parser_state_tos->com_col' for beyond the normal comment position, use (tabsize - 1) instead of 7. Wed Jul 29 22:50:45 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * lexi.c (lexi): If `buf_ptr' == '(' after scanning an alphanum which is not a keyword, add clause that paren_depth must be 0 before considering this as a possible function definition. Tue Jul 28 17:17:08 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * parse.c (parse): In case lbrace, handle state of being in a decl specially: If this brace succedes a struct-like thing and it goes on a line by itself (! btype_2), then add `brace_indent' to the amount of indentation. This make GNU-style indentation of structures, etc. work properly. * indent.c (indent): In case rparen, if not the beginning of the code, and in_decl, set `parser_state_tos->want_blank'. This is to handle ensure a space before the last rparen of cases like "int (*fp ()) ()". Fri Jul 24 18:53:15 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.c: Changes to handle spaces between options and their values. It would be better to use `getopt', but this change is much simpler. Declaration of `set_option' changed to return int. (main): Increment `i' by the value of `set_option ()'; also, pass argv[i + 1] as second parameter to `set_option'. * args.c (set_option): Take new parameter `param'. New label `arg_missing', just before label `found', to handle missing option value error. If `param_start' is 0, set it to `param'. (scan_profile): Rewritten to look at two entries at once, and pass both to `set_option'. Wed Jul 22 15:55:56 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.c (indent): In case lbrace, set `parser_state_tos->want_blank' under certain conditions if not at beginning of line and `btype_2' was specified. * indent.c: Macro `need_chars' moved here from indent.h. * io.c (read_file, read_stdin): No longer appends " \n" to the end of the file, which is now simply delimited with '\0'. xmalloc 2 less bytes for the buffer. (fill_buffer): Stop and set `had_eof' when '\0' is encountered in the file text, then return immediately. * lexi.c (lexi): New case in main switch statement for '\0', which indicates eof. Removed code to set this in case '\n'. Fri Jul 10 14:45:25 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * lexi.c (): If keyword "struct" was found inside of parens (case rw_struct_like:) set parser_state_tos->cast_mask before breaking. Wed Jul 8 21:11:01 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * lexi.c (lexi): Accept 'U' and "UL" suffixes on integer constants. Fri Jul 3 16:05:45 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.c (indent): For cases unare_op and comma, don't space out to decl_indent (dec_indent) if we are inside parens (parser_state_tos->paren_depth > 0). Thu Jul 2 13:36:50 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.c (indent): In case rparen, if paren starts the line, check that paren_level is greater than zero before using it to index `paren_indents'. * args.c: New variable `leave_preproc_space'. Set by new option "-lps". * indent.h: Declare `leave_preproc_space'. * indent.c (indent): In case preesc, don't ignore blanks after '#' if `leave_preproc_space' is set. * indent.texinfo: Entries added for new option "-lps". * indent.c: At the end of case preesc, call dump_line() if this appears to be a case where it won't get called when processing the newline character. Wed Jul 1 16:12:57 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * lexi.c (hash, is_reserved): Regenerated (from gperf) with new words "volatile" and "const". * args.c: Removed the trailing comma from the last element of enum profile. This breaks some compilers. * Makefile: Changed to drive the configuration process. * zmakefile.in: Renamed from Makefile.in * CONF-README: Renamed from INSTALL Tue Jun 30 21:34:16 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * globs.c (mymemcpy): Function deleted. * sys.h: Declarations and defines for mymemcpy, etc, removed. * indent_globs.h: All references to memcpy removed. * backup.c: `mymemcpy' changed to `memcpy'. * indent.c: Ditto. * io.c: Ditto. * Makefile.in: * INSTALL: * configure: * configure.in: * memcpy.c: New files. Sun Jun 14 13:38:12 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * Version 1.4 released. Fri Jun 12 15:02:37 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * globs.c (mymemcpy): Now a void function. Don't return anything. * io.c (dump_line): When printing label, use `tabsize' to increment target if `com_st' contains tabs. Also use `tabsize' to calculate target when it's less than zero. Thu Jun 11 20:27:48 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * indent.c (indent): When token_type is a binary_op, if parser_state_tos->want_blank is not true, but the preceding character is not a space, put one on the line. * Removed variable `sccsid' from all files. Wed Jun 10 13:00:26 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * args.c: Added long option name "dont-space-special-semicolon" for -nss. Tue Jun 9 13:01:21 1992 Joseph Arceneaux (jla@geech.gnu.ai.mit.edu) * Makefile: Automatically make the files README and RELEASE-NOTES. * sys.h: Provide defines for using memcpy or bcopy. * globs.c: `mymemcpy ()' only defined #ifndef mymemcpy. * indent.c (main): Set `in_name' to the current input file name. * io.c (dumpline): Check parser_state_tos->paren_level before using it to index parser_state_tos->paren_indents. Mon Jun 8 17:55:07 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * lexi.c (lexi): In conditional (paren_count == 0), add '=' to the characters (along with ';', ',', and '(') which constitute a function definition. This was to cause an ugly declaration from libc ("int (*foo) __P ((int bar)) = bax;") to remain on one line. Note that this is not valid C. * indent.c (main): When indenting multiple output files, make sure to close each output file before continuing. Fri Jun 5 13:56:54 1992 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * io.c (read_file): Use mymemcpy() instead of bcopy(); * backup.c (max_version): Don't free dirname unless it was malloc'd. Wed May 6 02:01:18 1992 Joseph Arceneaux (jla@geech.gnu.ai.mit.edu) * Version 1.3 released. * indent.texinfo: Reorganization of the "Invocation" part, and a new menu entry "Backup files", as well as corrections throughout. A new option "nip" added. * indent.c (main): New variable `using_stdin', used to indicate when `-' was specified on the command line. Tue May 5 21:28:06 1992 Joseph Arceneaux (jla@geech.gnu.ai.mit.edu) * args.c: Set default for `decl_com_ind' to 33. If BERKELEY_DEFAULTS is defined, default `continuation_indent' to 4. Sun May 3 00:43:10 1992 Joseph Arceneaux (jla at hugo) * parse.c (reduce): when reducing , do set i_l_follow to il[parser_state_tos]. This was removed earlier after a new reduction was added, but this obviously fixes some bugs. It will stay if indent passes all the old tests. * args.c (set_option): When calling `addkey' to add a user identifier, make it type 'rw_decl' since these are supposed to be typedef identifiers. Removed "-d4" spec in "-orig" option settings. Made default for "-fca" be false. * args.c (set_profile): Only read one profile. The one in the current directory has priority. Return the path of the profile read. * indent.c (main): If `verbose' and we've read a profile, tell the user on the stderr. Sat May 2 18:33:14 1992 Joseph Arceneaux (jla at hugo) * args.c: `Bill_Shannon' replaced with `blank_after_sizeof'. indent.c: Likewise. indent.h: Likewise. * args.c: New variable, exp_nip, for new option "-nip", which is equivalent to "-ip0". Long option name is "no-parameter-indentation". * config.sh: New shell script which generates "dirent_def.h", and include file with directory reading definitions. * Makefile: Take "config.sh" and "dirent_def.h" into account. * backup.c: Make only simple backups if we can't read directories (NODIR is defined). Functions for numbered backups conditionally defined. Documented all functions. * indent_globs.h: Broken into two new files, indent.h and sys.h. All files changed accordingly, including the Makefile. Thu Apr 30 14:53:33 1992 Joseph Arceneaux (jla at hugo) * backup.c, backup.h: New files with backup routines. * io.c (make_backup): Moved into backup.c. * io.c (sys_error): No longer static, called from make_backup. Wed Apr 29 14:56:10 1992 Joseph Arceneaux (jla at hugo) * args.c: Make default value for `else_endif_col' 1, as in "-gnu" settings. Tue Apr 28 23:18:07 1992 Joseph Arceneaux (jla at hugo) * indent.c (main): Only output to stdout if stdin is used and no output file is specified, or one input stream is used and -st is specified. * args.c: New variable `use_stdout' set with option "-st". * indent_globs.h: Declare `use_stdout'. Sun Mar 22 14:59:35 1992 Joseph Arceneaux (jla at hugo) * parse.c (init_parser, reset_parser): Two new functions which respectively allocate the neccessary parser data structures, and initialize the parser state. * indent.c (indent): New function which does the actual indenting of it's input, which comes in the form of a file_buffer pointer. (main): Command line scan changed to use new option "-o" and read possibly multiple files into new variable `in_file_names'. Main body changed to use new `indent' function on possibly multiple files, and accomodate default standard io specification. * io.c (make_backup, read_file, read_stdin): All file io routines rewritten (`make_backup' formerly `bakcopy'). read routines return pointer to new structure 'file_buffer'. `make_backup' only makes backup file, no longer sets up original file for writing. * indent_globs.h: Declare struct file_buffer, and io routines. Fri Mar 20 18:33:18 1992 Joseph Arceneaux (jla at hugo) * args.c: Option "-st" and associated variable `use_stdinout' removed. Option "-o" and associated variable `expect_output_file' added. Mon Feb 3 20:22:04 1992 Joseph Arceneaux (jla at churchy.gnu.ai.mit.edu) * args.c: If BERKELEY_DEFAULTS is defined, use the original defaults rather than GNU style. * Version 1.2 released. Thu Jan 23 14:02:06 1992 Joseph Arceneaux (jla at wombat.gnu.ai.mit.edu) * Makefile: info version of manual included in distribution. * args.c: New long options "berkeley-style", "berkeley" added which correspond to original style. * lexi.c (): Added explicit parens in checks for alphanums. * indent.c (main): On switch default when searching brace, added explicit parens to 2nd if statment. * indent_globs.h, io.c: Made variable `in_prog_size' unsigned. Wed Jan 15 11:59:35 1992 Joseph Arceneaux (jla at hugo) * args.c: Accept "-gnu" option. * indent.c (main): In case rbrace, don't use ind_level and il[tos] as criteria for setting search_brace. This allows "-ce" to work more strictly. * indent.c (main): In case lparen, let '(' after an ident which is rw_return begin casts. * lexi.c (lexi): If ident was a reserved word, save it in parser_state_tos->last_rw. Changed "return" from `rw_break' to new enum element `rw_return'. * indent_globs.h: Moved type "enum codes" to this file from lexi.c. New element of parser state `last_rw'. Sun Jan 12 01:40:23 1992 Joseph Arceneaux (jla at hugo) * lexi.c (lexi): if in decl and looking at '(', additionally accept, after closing ')', '(' as constituting a function declaration (along with ';' and ','). Thu Jan 9 18:31:44 1992 Joseph Arceneaux (jla at hugo) * io.c (dump_line): When outputting nonblank lines, if n_real_blanklines is > 1 and swallow_optional_blanklines is set, make n_real_blanklines 1. Wed Jan 8 10:06:43 1992 Joseph Arceneaux (jla at hugo) * args.c (option_prefix): New function to recognize option prefix from table. Now handles both "+" and "--" for long option prefixes. Mon Jan 6 01:15:29 1992 Joseph Arceneaux (jla at hugo) * Makefile: Made more compatible with GNU standards. Unix man file removed from distribution. Fri Dec 27 14:58:13 1991 Joseph Arceneaux (jla at hugo) * parse.c: Correctly handle "do ... while" statements, using new stack symbol DOSTMT. (parse): For semicolon, if code DOSTMT is top of stack, replace it with STMT. (reduce): New reduction => . Also, when reducing , don't change indentation. * indent.c (main): In case rbrace, after parse(rbrace), set force_nl if top of stack is dohead and ! btype_2. (main): Initialize noncast_mask to 0. Mon Dec 23 18:34:11 1991 Joseph Arceneaux (jla at hugo) * args.c (set_option): Recognize long options, using new struct option_conversions, if option begins with POSIX_OPTION_PREFIX. * indent.c (main): Recognize "--no-profile" as well as "-npro". * indent.texinfo: Describe GNU style as default. Section reworded. Sat Dec 21 13:27:07 1991 Joseph Arceneaux (jla at hugo) * indent.c (main): In case preesc (~ line 1282), add !had_eof to second while clause to avoid hanging in weird text (like test file djm-torture-test/t11). * indent.c (main): In case rparen, (~ line 680) if cast mask was set and is reset to zero, then set parser_state_tos->want_blank if cast_space was set. No longer do this (#if 0) in all cases where (!parser_state_tos->cast_mask || cast_space). Wed Dec 4 16:41:13 1991 Joseph Arceneaux (jla at hugo) * version.h: Version changed to be simply 1.1.4. Comments added. Mon Nov 25 15:16:51 1991 Joseph Arceneaux (jla at hugo) * indent.c (main): When handling decl case, don't reset PREFIX_BLANKLINE_REQUESTED if we've just encountered the type of a procedure delcaration. This fixes the -bap bug for procedures which begin with a line declaring their type, following the line with `}' from the last procedure. Fri Nov 22 15:26:59 1991 Joseph Arceneaux (jla at hugo) * args.c: Default is now GNU style. Original obtained by new option "-orig". New variable exp_orig. * indent.texinfo: Describe the new -ts option. Removed the -ss option from GNU style. Thu Nov 21 17:50:48 1991 Joseph Arceneaux (jla at hugo) * args.c: New variables `tabsize' and `exp_ts'. * indent_globs.h: Declare `tabsize'. * io.c (pad_output, count_spaces): Use `tabsize' to calculate padding. * pr_comment.c (pr_comment): Use `tabsize' to compute column. * args.c: Removed the "-ss" option for GNU style. Fri Sep 13 01:30:18 1991 Joseph Arceneaux (jla at hugo) * indent_globs.c: New element to parser_state, `paren_depth', which counts global paren nesting. * indent.c: Use it in main loop to avoid setting `in_or_st' when doing ansii prototyping. Thu Sep 12 15:53:54 1991 Joseph Arceneaux (jla at hugo) * io.c (dump_line): Initialize target_column to 0. * parse.c: New variable debug to control debugging output. indent-2.2.11/src/0000777000177400010010000000000011331331065010641 500000000000000indent-2.2.11/src/indent.dsp0000644000177400010010000001243510776162746012577 00000000000000# Microsoft Developer Studio Project File - Name="indent" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=indent - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "indent.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "indent.mak" CFG="indent - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "indent - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "indent - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "indent" # PROP Scc_LocalPath "." CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "indent - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /c # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "indent - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /c # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "indent - Win32 Release" # Name "indent - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\args.c # End Source File # Begin Source File SOURCE=.\backup.c # End Source File # Begin Source File SOURCE=.\comments.c # End Source File # Begin Source File SOURCE=.\globs.c # End Source File # Begin Source File SOURCE=.\indent.c # End Source File # Begin Source File SOURCE=.\code_io.c # End Source File # Begin Source File SOURCE=.\lexi.c # End Source File # Begin Source File SOURCE=.\parse.c # End Source File # Begin Source File SOURCE=.\wildexp.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\args.h # End Source File # Begin Source File SOURCE=.\backup.h # End Source File # Begin Source File SOURCE=.\comments.h # End Source File # Begin Source File SOURCE=.\config.h # End Source File # Begin Source File SOURCE=.\globs.h # End Source File # Begin Source File SOURCE=.\indent.h # End Source File # Begin Source File SOURCE=.\io.h # End Source File # Begin Source File SOURCE=.\lexi.h # End Source File # Begin Source File SOURCE=.\parse.h # End Source File # Begin Source File SOURCE=.\sys.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project indent-2.2.11/src/config.h.vc++0000644000177400010010000000356511331327560012746 00000000000000/* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE #undef _ALL_SOURCE #endif /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define if on MINIX. */ /* #undef _MINIX */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you have the memcpy function. */ #define HAVE_MEMCPY 1 /* Define if you have the memmove function. */ #define HAVE_MEMMOVE 1 /* Define if you have the strchr function. */ #define HAVE_STRCHR 1 /* Define if you have the utime function. */ #ifndef __MINGW32__ #define HAVE_UTIME_H 1 #endif /* __MINGW32__ */ /* Define if you have the header file. */ #define HAVE_SYS_UTIME_H 1 /* Define if you have the header file. */ /* #undef HAVE_DIRENT_H */ /* Define if you have the header file. */ #define HAVE_MALLOC_H 1 /* Define if you have the header file. */ /* #undef HAVE_NDIR_H */ /* Define if you have the header file. */ #define HAVE_STRING_H 1 /* Define if you have the header file. */ /* #undef HAVE_SYS_DIR_H */ /* Define if you have the header file. */ /* #undef HAVE_SYS_NDIR_H */ /* Define if you have the header file. */ /* #undef HAVE_UNISTD_H */ /* Define if you have the header file. */ /* #undef HAVE_UTIME_H */ /* Name of package */ #define PACKAGE "indent" /* Version number of package */ #define VERSION "2.2.11" /* Define if compiler has function prototypes */ #define PROTOTYPES 1 indent-2.2.11/src/code_io.h0000644000177400010010000000612510775646104012351 00000000000000/** \file * Copyright (c) 1999 Carlo Wood. All rights reserved. * * Copyright (c) 1994 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. * All rights reserved.
* * Copyright (c) 1980, 1993 * The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois.
* Copyright (c) 1985 Sun Microsystems, Inc. * All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef INDENT_CODE_IO_H #define INDENT_CODE_IO_H #include "sys.h" /* for RCSTAG_H */ RCSTAG_H (io, "$Id$"); #include #include "indent.h" extern char * cur_line; extern char * skip_horiz_space(const char * p); extern file_buffer_ty *read_file (char *filename, struct stat *); extern file_buffer_ty *read_stdin (void); extern int current_column (void); extern void fill_buffer (void); extern void skip_buffered_space(void); #endif /* INDENT_IO_H */ indent-2.2.11/src/comments.c0000644000177400010010000006126110775646104012572 00000000000000/** \file * Copyright (c) 1993 - 1998, Joseph Arceneaux. All rights reserved. * * 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 3 * of the License, or (at your option) any later version. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * This software 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. */ #include #include "sys.h" #include "indent.h" #include "code_io.h" #include "output.h" #include "comments.h" #include "globs.h" #include "parse.h" RCSTAG_CC ("$Id$"); /** Check the limits of the comment buffer, and expand as neccessary. */ #define CHECK_COM_SIZE \ if (e_com >= l_com) \ { \ int nsize = l_com - s_com + 400; \ combuf = (char *) xrealloc (combuf, nsize); \ e_com = combuf + (e_com - s_com) + 1; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ } /** * Output a comment. `buf_ptr' is pointing to the character after * the beginning comment delimiter when this is called. This handles * both C and C++ comments. * * As far as indent is concerned, there are basically two types * of comments -- those on lines by themselves and those which are * on lines with other code. Variables (and the options specifying them) * affecting the printing of comments are: * * `format_comments' ("fca"): Ignore newlines in the * comment and perform filling up to `comment_max_col'. Double * newlines indicate paragraph breaks. * * `format_col1_comments' ("fc1"): Format comments which * begin in column 1. * * `unindent_displace' ("d"): The hanging indentation for * comments which do not appear to the right of code. * * `comment_delimiter_on_blankline' ("cdb"): If set, place the comment * delimiters on lines by themselves. This only affects comments * which are not to the right of code. * * `com_ind' ("c"): The column in which to begin * comments that are to the right of code. * * `decl_com_ind' ("cd"): The column in which to begin * comments that are to the right of declarations. * * `else_endif_col' ("cp"): The column in which to begin * comments to the right of preprocessor directives. * * `star_comment_cont' ("sc"): Place a star ('*') to the * left of the comment body. * * `comment_max_col' ("lc"): The length of a comment line. * Formatted comments which extend past this column will be continued on * the following line. If this option is not specified, `max_col' is * used. */ extern void print_comment( int * paren_targ, BOOLEAN * pbreak_line) { int column; int format; codes_ty comment_type; int start_column; int found_column; int first_comment_line; int right_margin; int boxed_comment; int stars; int blankline_delims; int paragraph_break; int merge_blank_comment_lines; int two_contiguous_comments = 0; int save_length = 0; char * save_ptr = NULL; char * text_on_line = NULL; char * line_break_ptr = NULL; char * start_delim = NULL; char * line_preamble = NULL; int line_preamble_length; int visible_preamble; int suppress_cdb = 0; /* GDB_HOOK_print_comment() */ /* Increment the parser stack, as we will store some things * there for dump_line to use. */ inc_pstack (); /* Have to do it this way because this piece of shit program doesn't * always place the last token code on the stack. */ if (*(token + 1) == '/') { comment_type = cplus_comment; } else { comment_type = comment; } /* First, decide what kind of comment this is: C++, C, or boxed C. * Even if this appears to be a normal C comment, we may change our * minds if we find a star in the right column of the second line, * in which case that's a boxed comment too. */ if (comment_type == cplus_comment) { start_delim = "//"; line_preamble = "// "; line_preamble_length = strlen(line_preamble); visible_preamble = 1; boxed_comment = 0; stars = 0; blankline_delims = 0; } else if ((*buf_ptr == '*') || (*buf_ptr == '-') || (*buf_ptr == '=') || (*buf_ptr == '_') || (parser_state_tos->col_1 && !settings.format_col1_comments)) { /* Boxed comment. This block of code will return. */ int comment_lines_count = 1; stars = 0; boxed_comment = 0; blankline_delims = 0; line_preamble_length = 0; visible_preamble = 0; start_column = current_column () - 2; found_column = start_column; parser_state_tos->box_com = 1; parser_state_tos->com_col = found_column; if (settings.blanklines_before_blockcomments) { prefix_blankline_requested = 1; } *e_com++ = '/'; *e_com++ = '*'; while (1) { do { if (*buf_ptr == EOL) /* Count line numbers within comment blocks */ { ++line_no; } *e_com++ = *buf_ptr++; CHECK_COM_SIZE; } while ((*buf_ptr != '*') && (buf_ptr < buf_end)); /* We have reached the end of the comment, and it's all on * this line. */ if ((*buf_ptr == '*') && (*(buf_ptr + 1) == '/')) { if (buf_ptr == buf_end) { fill_buffer(); } buf_ptr += 2; if (buf_ptr == buf_end) { fill_buffer(); } *e_com++ = '*'; *e_com++ = '/'; *e_com = '\0'; parser_state_tos->tos--; /* If this is the only line of a boxed comment, it may * be after some other text (e.g., #if foo ), * in which case we want to specify the correct column. * In the other cases, the leading spaces account for * the columns and we start it in column 1. */ if (comment_lines_count > 1) { parser_state_tos->com_col = 1; } else { parser_state_tos->com_col = found_column; } return; } /* End of the line, or end of file. */ if (buf_ptr == buf_end) { if (*(buf_ptr - 1) == EOL) { *(--e_com) = EOS; dump_line (true, paren_targ, pbreak_line); comment_lines_count++; parser_state_tos->com_col = 1; } fill_buffer(); if (had_eof) { *e_com++ = '\0'; parser_state_tos->tos--; parser_state_tos->com_col = start_column; return; } } } } else { start_delim = "/*"; line_preamble = 0; line_preamble_length = 0; visible_preamble = 0; boxed_comment = 0; stars = settings.star_comment_cont; blankline_delims = settings.comment_delimiter_on_blankline; } paragraph_break = 0; merge_blank_comment_lines = 0; first_comment_line = com_lines; right_margin = settings.comment_max_col; /* Now, compute the correct indentation for this comment * and whether or not it should be formatted. */ found_column = current_column () - 2; if ((s_lab == e_lab) && (s_code == e_code)) { /* First handle comments which begin the line. */ if (parser_state_tos->col_1 && !settings.format_col1_comments) { format = settings.format_col1_comments; start_column = 1; } else { format = settings.format_comments; if ( (parser_state_tos->ind_level <= 0) && (!parser_state_tos->in_stmt || (parser_state_tos->in_decl && (parser_state_tos->paren_level == 0)))) { start_column = found_column; } else { /* This comment is within a procedure or other code. */ start_column = compute_code_target (*paren_targ) - settings.unindent_displace; if (start_column < 0) { start_column = 1; } } } } else { /* This comment follows code of some sort. */ int target; suppress_cdb = 1; /* First, compute where the comment SHOULD go. */ if (parser_state_tos->decl_on_line) { target = settings.decl_com_ind; } else if (else_or_endif) { target = settings.else_endif_col; } else { target = settings.com_ind; } /* Now determine if the code on the line is short enough * to allow the comment to begin where it should. */ if (s_code != e_code) { start_column = count_columns (compute_code_target (*paren_targ), s_code, NULL_CHAR); } else { /* s_lab != e_lab : there is a label here. */ start_column = count_columns (compute_label_target (), s_lab, NULL_CHAR); } if (start_column < target) { start_column = target; } else { /* If the too-long code is a pre-processor command, start the comment 1 space afterwards, otherwise start at the next tab mark. */ if (else_or_endif) { start_column++; else_or_endif = false; } else { start_column += settings.tabsize - ((start_column - 1) % settings.tabsize); } } format = settings.format_comments; } if (!line_preamble) { line_preamble_length = 3; if (stars) { line_preamble = " * "; visible_preamble = 1; } else { line_preamble = " "; visible_preamble = 0; } } /* These are the parser stack variables used to communicate * formatting information to dump_line (). */ parser_state_tos->com_col = (two_contiguous_comments ? 1 : start_column); parser_state_tos->box_com = boxed_comment; /* Output the beginning comment delimiter. They are both two * characters long. */ *e_com++ = *start_delim; *e_com++ = *(start_delim + 1); column = start_column + 2; /* If the user specified -cdb, put the delimiter on one line. */ if (blankline_delims && !suppress_cdb) { char *p = buf_ptr; *e_com = '\0'; dump_line (true, paren_targ, pbreak_line); /* Check if the delimiter was already on a line by itself, and skip whitespace if formating. */ p = skip_horiz_space(p); if (*p == EOL) { buf_ptr = p + 1; } else if (format) { buf_ptr = p; } else { /* what ? */ } if (buf_ptr >= buf_end) { fill_buffer(); } column = start_column; goto begin_line; } else if (format) { *e_com++ = ' '; column = start_column + 3; skip_buffered_space(); /* adjusts buf_ptr */ } else { /* what ? */ } /* Iterate through the lines of the comment */ while (!had_eof) { /* Iterate through the characters on one line */ while (!had_eof) { CHECK_COM_SIZE; switch (*buf_ptr) { case ' ': case TAB: /* If formatting, and previous break marker is * nonexistant, or before text on line, reset * it to here. */ if (format && (line_break_ptr < text_on_line)) { line_break_ptr = e_com; } if (format) { /* Don't write two spaces after another, unless * the first space is preceeded by a dot. */ if ((e_com == s_com) || (e_com[-1] != ' ') || (e_com - 1 == s_com) || (e_com[-2] == '.')) { *e_com++ = ' '; column++; } } else if (*buf_ptr == ' ') { *e_com++ = ' '; column++; } else { /* Convert the tab to the appropriate number of spaces, based on the column we found the comment in, not the one we're printing in. */ int tab_width = (settings.tabsize - ((column + found_column - start_column - 1) % settings.tabsize)); column += tab_width; while (tab_width--) { *e_com++ = ' '; } } break; case EOL: /* We may be at the end of a C++ comment */ if (comment_type == cplus_comment) { cplus_exit: parser_state_tos->tos--; parser_state_tos->com_col = (two_contiguous_comments ? 1 : start_column); parser_state_tos->box_com = boxed_comment; *e_com = 0; return; } if (format) { /* Newline and null are the two characters which end an input line, so check here if we need to get the next line. */ if (*buf_ptr == EOL) { ++line_no; } buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } /* If there are any spaces between the text and this newline character, remove them. */ if ((e_com > line_break_ptr) && (text_on_line < line_break_ptr)) { e_com = line_break_ptr; } /* If this is "\n\n", or "\n\n", * it's a paragraph break. */ skip_buffered_space(); /* adjusts buf_ptr */ if ((*buf_ptr == EOL) || !text_on_line) { paragraph_break = 1; goto end_line; } /* Also need to eat the preamble. */ if (!boxed_comment && (current_column () == found_column + 1) && (buf_ptr[0] == '*') && (buf_ptr[1] != '/')) { if (++buf_ptr >= buf_end) { fill_buffer(); } if ((*buf_ptr == ' ') && (++buf_ptr >= buf_end)) { fill_buffer(); } } /* This is a single newline. Transform it (and any * following whitespace) into a single blank. */ if (e_com[-1] != ' ') { line_break_ptr = e_com; *e_com++ = ' '; column++; } continue; } /* We are printing this line "as is", so output it and continue on to the next line. */ goto end_line; case '*': /* Check if we've reached the end of the comment. */ if (comment_type == comment) { if (*(buf_ptr + 1) == '/') { /* If it's not a boxed comment, put some whitespace * before the ending delimiter. Otherwise, simply * insert the delimiter. */ if (!boxed_comment) { if (text_on_line) { if (blankline_delims && !suppress_cdb) { *e_com = '\0'; dump_line (true, paren_targ, pbreak_line); *e_com++ = ' '; } else { /* Insert space before closing delim */ if ((*(e_com - 1) != ' ') && (*(e_com - 1) != TAB)) { *e_com++ = ' '; } } } else if ((s_com == e_com) || (*s_com != '/')) { /* If no text on line, then line is completely empty * or starts with preamble, or is beginning of * comment and starts with beginning delimiter. */ e_com = s_com; *e_com++ = ' '; } else { /* This is case of first comment line. Test * with: * if (first_comment_line != com_lines) * abort (); */ if ((*(e_com - 1) != ' ') && (*(e_com - 1) != TAB)) { *e_com++ = ' '; } } } /* Now insert the ending delimiter */ *e_com++ = '*'; *e_com++ = '/'; *e_com = '\0'; /* Skip any whitespace following the comment. If * there is only whitespace after it, print the line. * * NOTE: We're not printing the line: TRY IT! */ buf_ptr += 2; buf_ptr = skip_horiz_space(buf_ptr); if (buf_ptr >= buf_end) { fill_buffer(); } parser_state_tos->tos--; parser_state_tos->com_col = (two_contiguous_comments ? 1 : start_column); parser_state_tos->box_com = boxed_comment; return; } /* If this star is on the second line of the * comment in the same column as the star of the * beginning delimiter, then consider it * a boxed comment. */ if ((first_comment_line == com_lines - 1) && (e_com == s_com + line_preamble_length)) { /* Account for change in line_preamble_length: */ column -= line_preamble_length - 1; line_preamble = " "; line_preamble_length = 1; boxed_comment = 1; format = 0; blankline_delims = 0; *s_com = ' '; *(s_com + 1) = '*'; text_on_line = e_com = s_com + 2; column++; break; } } /* If it was not the end of the comment, drop through * and insert the star on the line. */ default: /* Some textual character. */ text_on_line = e_com; *e_com++ = *buf_ptr; column++; break; } /* If we are formatting, check that we haven't exceeded the line length. If we haven't set line_break_ptr, keep going. */ if (format && (column > right_margin) && line_break_ptr) { if (line_break_ptr < e_com - 1) { /* Here if we are really "breaking" the line: the line * break is before some text we've seen. */ *line_break_ptr = '\0'; save_ptr = line_break_ptr + 1; save_length = e_com - save_ptr; e_com = line_break_ptr; /* If we had to go past `right_margin' to print stuff out, * extend `right_margin' out to this point. */ if ((column - save_length) > right_margin) { right_margin = column - save_length; } } else { /* The line break is after the last text; we're really * truncating the line. */ if (comment_type == cplus_comment) { buf_ptr = skip_horiz_space(buf_ptr); buf_ptr--; if (*buf_ptr == EOL) { goto cplus_exit; } } else { while ((*buf_ptr == TAB) || (*buf_ptr == ' ') || (*buf_ptr == EOL)) { if (*buf_ptr == EOL) { ++line_no; } buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } } buf_ptr--; } *e_com = EOS; } goto end_line; } if (*buf_ptr == EOL) { ++line_no; } buf_ptr++; if (buf_ptr == buf_end) { fill_buffer(); } } end_line: /* Compress pure whitespace lines into newlines. */ if (!text_on_line && !visible_preamble && !(first_comment_line == com_lines)) { e_com = s_com; } *e_com = EOS; dump_line (true, paren_targ, pbreak_line); /* We're in the middle of a C-comment, don't add blank lines! */ prefix_blankline_requested = 0; /* If formatting (paragraph_break is only used for formatted * comments) and user wants blank lines merged, kill all white * space after the "\n\n" indicating a paragraph break. */ if (paragraph_break) { if (merge_blank_comment_lines) { while ((*buf_ptr == EOL) || (*buf_ptr == ' ') || (*buf_ptr == TAB)) { if (*buf_ptr == EOL) { ++line_no; } if (++buf_ptr >= buf_end) { fill_buffer(); } } } paragraph_break = 0; } else { /* If it was a paragraph break (`if' clause), we scanned ahead * one character. So, here in the `else' clause, advance buf_ptr. */ if (*buf_ptr == EOL) { ++line_no; } buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } } begin_line: if (had_eof) { break; } /* Indent the line properly. If it's a boxed comment, align with * the '*' in the beginning slash-star and start inserting there. * Otherwise, insert blanks for alignment, or a star if the * user specified -sc. */ if (line_preamble) { (void) memcpy (e_com, line_preamble, line_preamble_length); e_com += line_preamble_length; column = start_column + line_preamble_length; } else { column = start_column; } line_break_ptr = 0; /* If we have broken the line before the end for formatting, * copy the text after the break onto the beginning of this * new comment line. */ if (save_ptr) { while (((*save_ptr == ' ') || (*save_ptr == TAB)) && save_length) { save_ptr++; save_length--; } (void) memcpy (e_com, save_ptr, save_length); text_on_line = e_com; e_com += save_length; /* We only break if formatting, in which cases there * are no tabs, only spaces. */ column += save_length; save_ptr = 0; save_length = 0; } else { skip_buffered_space(); /* adjusts buf_ptr */ text_on_line = 0; } } parser_state_tos->tos--; parser_state_tos->com_col = (two_contiguous_comments ? 1 : start_column); parser_state_tos->box_com = boxed_comment; } indent-2.2.11/src/utils.c0000644000177400010010000000216510775646104012103 00000000000000/** \file * Copyright (c) 2008 Free Software Foundation, Inc. All rights reserved.
* * 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 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License version 3 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. * * HISTORY * - 2008-03-08 DI Creation */ #include #include #include #include "utils.h" /** * */ extern void DieError( int errval, const char * fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); exit(errval); } indent-2.2.11/src/globs.c0000644000177400010010000000550610775646104012053 00000000000000/** \file * Copyright (c) 1993,1994, Joseph Arceneaux. All rights reserved. * * Copyright (C) 1986, 1989, 1992 Free Software Foundation, Inc. All rights * reserved. * * 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 3 * of the License, or (at your option) any later version. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * This software 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. */ #include "sys.h" #include "indent.h" #include "globs.h" #ifdef HAVE_MALLOC_H #include #endif #include #include RCSTAG_CC ("$Id$"); /** * Like malloc but get error if no storage available. size really should be * size_t, but not all systems have size_t, so I hope "unsigned" will work. * It works for GNU style machines, where it is 32 bits, and works on * MS-DOS. */ extern char * xmalloc ( unsigned size) { char *val = (char *) calloc (1, size); if (!val) { fprintf (stderr, _("indent: Virtual memory exhausted.\n")); exit (system_error); } #if defined (DEBUG) /* Fill it with garbage to detect code which depends on stuff being zero-filled. */ memset (val, 'x', size); #endif return val; } /** * Like realloc but get error if no storage available. */ extern char *xrealloc ( char *ptr, unsigned size) { char *val = (char *) realloc (ptr, size); if (!val) { fprintf (stderr, _("indent: Virtual memory exhausted.\n")); exit (system_error); } return val; } /** * */ extern void message( char * kind, char * string, unsigned * a0, unsigned * a1) { if (kind) { fprintf (stderr, _("indent: %s:%d: %s:"), in_name, line_no, kind); } fprintf (stderr, string, a0, a1); fprintf (stderr, "\n"); } /** * Print a fatal error message and exit, or, if compiled with * "DEBUG" defined, abort (). */ extern void fatal ( const char *string, const char *a0) { fprintf (stderr, _("indent: Fatal Error: ")); fprintf (stderr, string, a0); fprintf (stderr, "\n"); #ifdef DEBUG abort (); #endif /* DEBUG */ if (errno) { fprintf (stderr, _("indent: System Error: ")); perror (0); } exit (indent_fatal); } indent-2.2.11/src/code_io.c0000644000177400010010000003250411264427331012335 00000000000000/** \file * Copyright (c) 1999, 2000 Carlo Wood. All rights reserved.
* Copyright (c) 1994 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992 Free Software Foundation, Inc. All rights reserved.
* * Copyright (c) 1985 Sun Microsystems, Inc.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * HISTORY * - 2002-01-17 D.Ingamells Add a final newline if not present in file. */ #include "sys.h" #include #include #if defined (HAVE_UNISTD_H) #include #endif #include #ifdef VMS #include #include #include #else /* not VMS */ #include #include /* POSIX says that should exist. Some systems might need to use * or instead. */ #include #if defined (_WIN32) && !defined (__CYGWIN__) #include #endif #endif /* not VMS */ #include "indent.h" #include "code_io.h" #include "globs.h" #include "output.h" RCSTAG_CC ("$Id$"); /** * Stuff that needs to be shared with the rest of indent. Documented in * indent.h. */ char * in_prog_pos = NULL; /*!< used in output.c code_io.c indent.c */ char * buf_ptr = NULL; /*!< used in output.c lexi.c code_io.c indent.c comments.c */ char * buf_end = NULL; /*!< used in output.c lexi.c code_io.c indent.c comments.c */ BOOLEAN had_eof = false; /*!< used in output.c code_io.c comments.c parse.c */ char * cur_line = NULL; /*!< used in output.c code_io.c */ /** * */ extern char * skip_horiz_space( const char * p) { while ((*p == ' ') || (*p == TAB)) { p++; } return (char *)p; } /******************************************************************************/ extern void skip_buffered_space(void) { while ((*buf_ptr == ' ') || (*buf_ptr == TAB)) { buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } } } /** * */ static BOOLEAN is_comment_start(const char * p) { BOOLEAN ret; if ((*p == '/') && ((*(p + 1) == '*') || (*(p + 1) == '/'))) { ret = true; } else { ret = false; } return ret; } #ifdef VMS /** * Folks say VMS requires its own read routine. Then again, some folks * say it doesn't. Different folks have also sent me conflicting versions * of this function. Who's right? * * Anyway, this version was sent by MEHRDAD@glum.dev.cf.ac.uk and modified * slightly by me. */ static int vms_read ( int file_desc, char * buffer, int nbytes) { char * bufp; int nread; int nleft; bufp = buffer; nread = 0; nleft = nbytes; nread = read (file_desc, bufp, nleft); while (nread > 0) { bufp += nread; nleft -= nread; if (nleft < 0) { fatal (_("Internal buffering error"), 0); } nread = read (file_desc, bufp, nleft); } return nbytes - nleft; } #endif /* VMS */ /** * Return the column we are at in the input line. */ extern int current_column (void) { char *p; int column; /* Use save_com.size here instead of save_com.end, because save_com is * already emptied at this point. */ if ((buf_ptr >= save_com.ptr) && (buf_ptr <= save_com.ptr + save_com.len)) { p = save_com.ptr; column = save_com.start_column; } else { p = cur_line; column = 1; } while (p < buf_ptr) { switch (*p) { case EOL: case 014: /* form feed */ column = 1; break; case TAB: column += settings.tabsize - (column - 1) % settings.tabsize; break; case '\b': /* backspace */ column--; break; default: column++; break; } p++; } return column; } /** * VMS defines it's own read routine, `vms_read' */ #ifndef INDENT_SYS_READ #include #define INDENT_SYS_READ read #endif /** * Read file FILENAME into a `fileptr' structure, and return a pointer to * that structure. */ extern file_buffer_ty * read_file( char * filename, struct stat * file_stats) { static file_buffer_ty fileptr = {NULL}; /* * size is required to be unsigned for MSDOS, * in order to read files larger than 32767 * bytes in a 16-bit world... */ unsigned int size; int namelen = strlen(filename); int fd = open(filename, O_RDONLY, 0777); if (fd < 0) { fatal (_("Can't open input file %s"), filename); } if (fstat(fd, file_stats) < 0) { fatal (_("Can't stat input file %s"), filename); } if (file_stats->st_size == 0) { ERROR (_("Zero-length file %s"), filename, 0); } #if !defined(__DJGPP__) if (sizeof (int) == 2) /* Old MSDOS */ { if ((file_stats->st_size < 0) || (file_stats->st_size > (0xffff - 1))) { fatal(_("File %s is too big to read"), filename); } } else #endif { if (file_stats->st_size < 0) { fatal(_("System problem reading file %s"), filename); } } fileptr.size = file_stats->st_size; if (fileptr.data != 0) { fileptr.data = (char *) xrealloc (fileptr.data, (unsigned) file_stats->st_size + 2); /* add 1 for '\0' and 1 for * potential final added * newline. */ } else { fileptr.data = (char *) xmalloc ((unsigned) file_stats->st_size + 2); /* add 1 for '\0' and 1 for * potential final added * newline. */ } size = INDENT_SYS_READ (fd, fileptr.data, fileptr.size); if (size == (unsigned int) -1) { fatal (_("Error reading input file %s"), filename); } if (close (fd) < 0) { fatal (_("Error closing input file %s"), filename); } /* Apparently, the DOS stores files using CR-LF for newlines, but * then the DOS `read' changes them into '\n'. Thus, the size of the * file on disc is larger than what is read into memory. Thanks, Bill. */ if (size < fileptr.size) { fileptr.size = size; } if (fileptr.name != NULL) { fileptr.name = (char *) xrealloc (fileptr.name, (unsigned) namelen + 1); } else { fileptr.name = (char *) xmalloc (namelen + 1); } (void)strncpy(fileptr.name, filename, namelen); fileptr.name[namelen] = EOS; if (fileptr.data[fileptr.size - 1] != EOL) { fileptr.data[fileptr.size] = EOL; fileptr.size++; } fileptr.data[fileptr.size] = EOS; return &fileptr; } /** * This should come from stdio.h and be some system-optimal number */ #ifndef BUFSIZ #define BUFSIZ 1024 #endif /** * Suck the standard input into a file_buffer structure, and * return a pointer to that structure. */ file_buffer_ty * read_stdin(void) { static file_buffer_ty stdinptr = {NULL}; unsigned int size = 15 * BUFSIZ; int ch = EOF; char * p = NULL; if (stdinptr.data != 0) { free (stdinptr.data); } stdinptr.data = (char *) xmalloc (size + 1); stdinptr.size = 0; p = stdinptr.data; do { while (stdinptr.size < size) { ch = getc (stdin); if (ch == EOF) { break; } *p++ = ch; stdinptr.size++; } if (ch != EOF) { size += (2 * BUFSIZ); stdinptr.data = xrealloc (stdinptr.data, (unsigned) size); p = stdinptr.data + stdinptr.size; } } while (ch != EOF); stdinptr.name = "Standard Input"; stdinptr.data[stdinptr.size] = EOS; return &stdinptr; } /* * Advance `buf_ptr' so that it points to the next line of input. * * If the next input line contains an indent control comment turning * off formatting (a comment, C or C++, beginning with *INDENT-OFF*), * disable indenting by calling inhibit_indenting() which will cause * `dump_line ()' to simply print out all input lines without formatting * until it finds a corresponding comment containing *INDENT-0N* which * re-enables formatting. * * Note that if this is a C comment we do not look for the closing * delimiter. Note also that older versions of this program also * skipped lines containing *INDENT** which represented errors * generated by indent in some previous formatting. This version does * not recognize such lines. */ void fill_buffer(void) { char * p = NULL; BOOLEAN finished_a_line = false; /* indent() may be saving the text between "if (...)" and the following * statement. To do so, it uses another buffer (`save_com'). Switch * back to the previous buffer here. */ if (bp_save != 0) { buf_ptr = bp_save; buf_end = be_save; bp_save = be_save = 0; /* only return if there is really something in this buffer */ if (buf_ptr < buf_end) { return; } } if (*in_prog_pos == EOS) { buf_ptr = in_prog_pos; cur_line = buf_ptr; had_eof = true; } else { /* Here if we know there are chars to read. The file is * NULL-terminated, so we can always look one character ahead * safely. */ cur_line = in_prog_pos; p = cur_line; finished_a_line = false; do { p = skip_horiz_space(p); /* If we are looking at the beginning of a comment, see * if it turns off formatting with off-on directives. */ if (is_comment_start(p)) { p += 2; p = skip_horiz_space(p); /* Skip all lines between the indent off and on directives. */ if (strncmp (p, "*INDENT-OFF*", 12) == 0) { inhibit_indenting(true); } } while ((*p != EOS) && *p != EOL) { p++; } /* Here for newline -- finish up unless formatting is off */ if (*p == EOL) { finished_a_line = true; in_prog_pos = p + 1; } /* Here for embedded NULLs */ else if ((unsigned int) (p - current_input->data) < current_input->size) { ERROR (_("File %s contains NULL-characters: cannot proceed\n"), current_input->name, 0); exit(1); p++; } /* Here for EOF with no terminating newline char. */ else { in_prog_pos = p; finished_a_line = true; } } while (!finished_a_line); buf_ptr = cur_line; buf_end = in_prog_pos; } } indent-2.2.11/src/indent-cc.gperf0000644000177400010010000000156110775646104013467 00000000000000templ_ty; %% switch, rw_switch, case, rw_case, break, rw_break, struct, rw_struct_like, union, rw_struct_like, enum, rw_enum, default, rw_case, int, rw_decl, char, rw_decl, const, rw_decl, float, rw_decl, double, rw_decl, long, rw_decl, short, rw_decl, typedef, rw_decl, unsigned, rw_decl, signed, rw_decl, register, rw_decl, static, rw_decl, global, rw_decl, extern, rw_decl, void, rw_decl, volatile, rw_decl, va_dcl, rw_decl, goto, rw_break, return, rw_return, if, rw_sp_paren, while, rw_sp_paren, for, rw_sp_paren, else, rw_sp_else, do, rw_sp_nparen, sizeof, rw_sizeof, catch, rw_sp_paren, class, rw_struct_like, delete, rw_return, new, rw_return, throw, rw_return, friend, rw_decl, inline, rw_decl, template, rw_decl, virtual, rw_decl, signature, rw_struct_like, typeof, rw_sizeof, classof, rw_sizeof, headof, rw_sizeof, sigof, rw_sizeof, bool, rw_decl, operator, rw_operator, indent-2.2.11/src/indent.gperf0000644000177400010010000000107510775646104013104 00000000000000templ_ty; %% switch, rw_switch, case, rw_case, break, rw_break, struct, rw_struct_like, union, rw_struct_like, enum, rw_enum, default, rw_case, int, rw_decl, char, rw_decl, const, rw_decl, float, rw_decl, double, rw_decl, long, rw_decl, short, rw_decl, typedef, rw_decl, unsigned, rw_decl, signed, rw_decl, register, rw_decl, static, rw_decl, global, rw_decl, extern, rw_decl, void, rw_decl, volatile, rw_decl, va_dcl, rw_decl, goto, rw_break, return, rw_return, if, rw_sp_paren, while, rw_sp_paren, for, rw_sp_paren, else, rw_sp_else, do, rw_sp_nparen, sizeof, rw_sizeof, indent-2.2.11/src/wildexp.c0000644000177400010010000001773010775646104012423 00000000000000/** \file * Wildcard expansion for WIN32 version * * Copyright (c) 2000 John Bridges. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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 3 * of the License, or (at your option) any later version. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * Please send bug reports about this file to indent@peekpoke.com */ #if defined (_WIN32) && !defined (__CYGWIN__) #include #include #include #include #include #include #include "sys.h" #include "code_io.h" #include "indent.h" #define MAX_PATH 1024 struct arginfo { int nargc; int argpos; char *argbuf; int bufsize; }; /** * */ static void myabort ( char *str) { puts (""); puts (str); exit (1); } static void fparms (struct arginfo *arg, char *fname); static void chkparm (struct arginfo *arg, char *str); /** * */ static void addarg ( struct arginfo *arg, char *str) { int cnt; if (*str == '@') { fparms (arg, str + 1); } else { cnt = strlen (str) + 1; if (arg->argpos + cnt >= arg->bufsize) { arg->bufsize += 8192; arg->argbuf = realloc (arg->argbuf, arg->bufsize); } strcpy (arg->argbuf + arg->argpos, str); arg->argpos += cnt; ++arg->nargc; } } /** * */ static void fparms ( struct arginfo *arg, char *fname) { char * buf = NULL; char * cp = NULL; char * ecp = NULL; unsigned int cnt; short quoted = 0; FILE * fs = fopen (fname, "rb"); if (!fs) { myabort (_("CANNOT FIND '@' FILE!")); } fseek (fs, 0l, 2); cnt = ftell (fs); fseek (fs, 0l, 0); buf = malloc (cnt + 1); fread (buf, 1, cnt, fs); fclose (fs); *(ecp = buf + cnt) = 0; cp = buf; while (cp < ecp) { if (*cp == ';') { while (cp < ecp && *cp != '\r' && *cp != '\n') { *cp++ = 0; } } if (*cp < ' ') { *cp = 0; } if (*cp == '"') { *cp = 0; quoted = !quoted; } if (!quoted) { if (*cp == ' ') { *cp = 0; /* set spaces to null */ } if (*cp >= 'A' && *cp <= 'Z') { *cp += 32; } } ++cp; } cp = buf; while (cp < ecp) { if (*cp) { chkparm (arg, cp); cp += strlen (cp); } ++cp; } free (buf); } /** * */ static int wildmatch( const char *s1, const char *s2) { if (s1 == NULL) { s1 = ""; } if (s2 == NULL) { s2 = ""; } while (*s1 && (*s2 || *s1 == '*')) { if (tolower (*s1) != tolower (*s2) && *s1 != '?' && *s1 != '*') { return 0; } if (*s2) { if (*s1 == '*') { ++s1; if (!*s1) { return 1; } while (*s2) { if (wildmatch (s1, s2)) { return 1; } ++s2; } return 0; } ++s2; } ++s1; } if (*s1 || *s2) { return 0; } else { return 1; } } /** * */ static short removearg ( struct arginfo *arg, char *str) { char *cp = NULL; int i; int cnt; i = arg->nargc; cp = arg->argbuf; while (i-- > 0) { cnt = strlen (cp) + 1; if (wildmatch (str, cp)) { arg->argpos -= cnt; memcpy (cp, cp + cnt, arg->argpos - (cp - arg->argbuf)); --arg->nargc; } else { cp += cnt; } } return 0; } /** * */ static void chkparm ( struct arginfo *arg, char *str) { char tmpstr[MAX_PATH + 1]; char * cp = NULL; char * pnt2 = NULL; short remarg = 0; long hFile; struct _finddata_t c_file; if (*str == '!') { remarg = 1; ++str; } if (strchr (str, '?') || strchr (str, '*')) { if (remarg) { removearg (arg, str); } else { strcpy (tmpstr, str); if (!(cp = strrchr (tmpstr, '\\'))) { if (!(cp = strrchr (tmpstr, '/'))) { if (!(cp = strrchr (tmpstr, ':'))) { cp = tmpstr - 1; } } } pnt2 = cp + 1; hFile = _findfirst (str, &c_file); while (hFile > 0) { if (!(c_file.attrib & _A_SUBDIR)) { cp = pnt2; strcpy (pnt2, c_file.name); while (*cp) { if (islower (*cp)) { strcpy (pnt2, c_file.name); break; } *cp = tolower (*cp); ++cp; } addarg (arg, tmpstr); } if (_findnext (hFile, &c_file)) { _findclose (hFile); hFile = 0; } } } } else { if (remarg) { removearg (arg, str); } else { addarg (arg, str); } } } /** * */ extern void wildexp ( int *argc, char ***argv) { char * cp = NULL; char ** pnt; char ** nargv; struct arginfo arg; int i; arg.bufsize = 8192; arg.argpos = 0; arg.argbuf = malloc (arg.bufsize); arg.nargc = 0; i = *argc; pnt = *argv; while (i--) { chkparm (&arg, *pnt++); } arg.argbuf = realloc (arg.argbuf, arg.argpos); cp = arg.argbuf; i = *argc = arg.nargc; if (arg.nargc < 32) { arg.nargc = 32; } *argv = nargv = malloc (arg.nargc * sizeof (nargv[0])); while (i--) { *nargv++ = cp; cp += strlen (cp) + 1; } } #endif /* defined (_WIN32) && !defined (__CYGWIN__) */ indent-2.2.11/src/args.h0000644000177400010010000000445110775646104011704 00000000000000/** \file * Copyright (c) 1999 Carlo Wood. All rights reserved. * * Copyright (c) 1994 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. * All rights reserved.
* * Copyright (c) 1980, 1993 * The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois.
* Copyright (c) 1985 Sun Microsystems, Inc. * All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef INDENT_ARGS_H #define INDENT_ARGS_H #include "sys.h" /* for RCSTAG_H */ RCSTAG_H (args, "$Id$"); extern void set_defaults (void); extern void set_defaults_after (void); extern int set_option ( const char * option, const char * param, int explicit, const char * option_source); extern char *set_profile (void); #endif /* INDENT_ARGS_H */ indent-2.2.11/src/globs.h0000644000177400010010000000273710775646104012063 00000000000000/** \file * Copyright (c) 1999 Carlo Wood. All rights reserved. * * 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 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef INDENT_GLOBS_H #define INDENT_GLOBS_H #include "sys.h" /* for RCSTAG_H */ RCSTAG_H (globs, "$Id$"); /* *Warning messages: indent continues */ #define WARNING(s, a, b) \ message (_("Warning"), s, (unsigned int *)(a), (unsigned int *)(b)) /** Error messages: indent stops processing the current file. */ #define ERROR(s, a, b) \ message (_("Error"), s, (unsigned int *)(a), (unsigned int *)(b)) extern char *xmalloc( unsigned int size); extern char *xrealloc( char *ptr, unsigned int size); extern void fatal( const char *string, const char *a0); extern void message( char *kind, char *string, unsigned int *a0, unsigned int *a1); #endif /* INDENT_GLOBS_H */ indent-2.2.11/src/lexi.c0000644000177400010010000010072711276611100011670 00000000000000/** \file * Copyright (c) 1999, 2000 Carlo Wood. All rights reserved.
* Copyright (c) 1994, 1996, 1997 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. All rights reserved.
* * Copyright (c) 1980 The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. * Copyright (c) 1985 Sun Microsystems, Inc. * All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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. * */ /* Here we have the token scanner for indent. It scans off one token and * puts it in the global variable "token". It returns a code, indicating the * type of token scanned. */ #include "sys.h" #include #if defined (HAVE_UNISTD_H) #include #endif #include #include "indent.h" #include "code_io.h" #include "globs.h" RCSTAG_CC ("$Id$"); /** Stuff that needs to be shared with the rest of indent. Documented in * indent.h. */ char *token; char *token_end; #define alphanum 1 #define opchar 3 typedef struct { char * rwd; rwcodes_ty rwcode; } templ_ty; /** Pointer to a vector of keywords specified by the user. */ static templ_ty *user_specials = 0; /** Allocated size of user_specials. */ static unsigned int user_specials_max = 0; /** Index in user_specials of the first unused entry. */ static unsigned int user_specials_idx = 0; char chartype[] = { /* this is used to facilitate the decision of * what type (alphanumeric, operator) each * character is */ #ifndef CHARSET_EBCDIC 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 3, 3, 0, 0, 0, 3, 3, 0, 3, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 3, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 3, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #else /* CHARSET_EBCDIC */ /* * The following table was generated by the program given just below */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*| .......| */ 0, 0, 0, 0, 3, 0, 3, 3, /*|..`.<(+|| */ 3, 0, 0, 0, 0, 0, 0, 0, /*|&.......| */ 0, 0, 3, 1, 3, 0, 0, 0, /*|..!$*);.| */ 3, 3, 0, 0, 0, 0, 0, 0, /*|-/......| */ 0, 0, 3, 0, 3, 1, 3, 3, /*|..^,%_>?| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 3, 0, /*|..:#@'="| */ 0, 1, 1, 1, 1, 1, 1, 1, /*|.abcdefg| */ 1, 1, 0, 0, 0, 0, 0, 0, /*|hi......| */ 0, 1, 1, 1, 1, 1, 1, 1, /*|.jklmnop| */ 1, 1, 0, 0, 0, 0, 0, 0, /*|qr......| */ 0, 0, 1, 1, 1, 1, 1, 1, /*|..stuvwx| */ 1, 1, 0, 0, 0, 0, 0, 0, /*|yz......| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|........| */ 0, 0, 0, 0, 0, 0, 0, 0, /*|...[\]..| */ 0, 1, 1, 1, 1, 1, 1, 1, /*|.ABCDEFG| */ 1, 1, 0, 0, 0, 0, 0, 0, /*|HI......| */ 0, 1, 1, 1, 1, 1, 1, 1, /*|.JKLMNOP| */ 1, 1, 0, 0, 0, 0, 0, 0, /*|QR......| */ 0, 0, 1, 1, 1, 1, 1, 1, /*|..STUVWX| */ 1, 1, 0, 0, 0, 0, 0, 0, /*|YZ......| */ 1, 1, 1, 1, 1, 1, 1, 1, /*|01234567| */ 1, 1, 0, 0, 0, 0, 0, 3, /*|89.{.}.~| */ #endif /* CHARSET_EBCDIC */ }; #if 0 /** * The table above was generated by the following program from * the ASCII version of the chartype[] array above, where the * unsigned char os_toascii[] array can be found in the source * for the Apache Web Server version 1.3.x, in the directories... * src/os/bs2000/ebcdic.c for the SIEMENS BS2000 mainframes, * src/os/tpf/ebcdic.c for the IBM TPF server line. * The following table was created for BS2000 EBCDIC character set, * but the few non-zero places should be compatible with IBM's EBCDIC. */ int main (void) { const int GAP = 8; int i; int j; for (i = 0; i < 256; i += GAP) { printf (" "); for (j = 0; j < GAP; ++j) { printf ("%d, ", chartype[os_toascii[i + j]]); } printf (" /*|"); for (j = 0; j < GAP; ++j) { printf ("%c", isprint (i + j) ? (i + j) : '.'); } printf ("|*/\n"); } return 0; } #endif /* Include code generated by gperf */ #ifdef __GNUC__ __inline #endif templ_ty *is_reserved (const char *str, unsigned int len); #include "gperf.c" /* Include code generated by gperf for C++ keyword set */ #undef MIN_HASH_VALUE /* remove old defs */ #undef MAX_HASH_VALUE #undef TOTAL_KEYWORDS #undef MIN_WORD_LENGTH #undef MAX_WORD_LENGTH #ifdef __GNUC__ __inline #endif templ_ty *is_reserved_cc (register const char *str, register unsigned int len); #include "gperf-cc.c" /** * */ extern codes_ty lexi(void) { int unary_delim = false; /* this is set to 1 if the current token * forces a following operator to be unary */ static codes_ty last_code = code_eof; /* the last token type returned */ static int l_struct = 0; /* set to 1 if the last token was 'struct' */ static int l_enum = 0; /* set to 1 if the last token was `enum' */ codes_ty code; /* internal code to be returned */ char qchar; /* the delimiter character for a string */ static int count = 0; /* debugging counter */ count++; /* tell world that this token started in column 1 iff the last * thing scanned was nl */ parser_state_tos->col_1 = parser_state_tos->last_nl; parser_state_tos->last_saw_nl = parser_state_tos->last_nl; parser_state_tos->last_nl = false; if (buf_ptr >= buf_end) { fill_buffer(); } if (*buf_ptr == ' ' || *buf_ptr == TAB) { parser_state_tos->col_1 = false; skip_buffered_space(); /* adjusts buf_ptr */ } /* INCREDIBLY IMPORTANT WARNING!!! * * Note that subsequent calls to `fill_buffer ()' may switch `buf_ptr' * to a different buffer. Thus when `token_end' gets set later, it * may be pointing into a different buffer than `token'. */ token = buf_ptr; /* Scan an alphanumeric token */ if ((!((buf_ptr[0] == 'L') && ((buf_ptr[1] == '"') || (buf_ptr[1] == '\''))) && (chartype[0xff & (int) *buf_ptr] == alphanum)) || ((buf_ptr[0] == '.') && isdigit (buf_ptr[1]))) { /* we have a character or number */ templ_ty *p; if (isdigit (*buf_ptr) || ((buf_ptr[0] == '.') && isdigit (buf_ptr[1]))) { int seendot = 0, seenexp = 0; if ((*buf_ptr == '0') && ((buf_ptr[1] == 'x') || (buf_ptr[1] == 'X'))) { buf_ptr += 2; while (isxdigit (*buf_ptr)) { buf_ptr++; } } else { while (1) { if (*buf_ptr == '.') { if (seendot) { break; } else { seendot++; } } buf_ptr++; if (!isdigit (*buf_ptr) && *buf_ptr != '.') { if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp) { break; } else { seenexp++; seendot++; buf_ptr++; if (*buf_ptr == '+' || *buf_ptr == '-') { buf_ptr++; } } } } } if (*buf_ptr == 'F' || *buf_ptr == 'f' || *buf_ptr == 'i' || *buf_ptr == 'j') { buf_ptr++; } else { while (*buf_ptr == 'U' || *buf_ptr == 'u' || *buf_ptr == 'L' || *buf_ptr == 'l') { buf_ptr++; } } } else while (chartype[0xff & (int) *buf_ptr] == alphanum) { /* copy it over */ buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } } token_end = buf_ptr; if (token_end - token == 13 && !strncmp (token, "__attribute__", 13)) { last_code = decl; parser_state_tos->last_u_d = true; return (attribute); } skip_buffered_space(); /* adjusts buf_ptr */ /* Handle operator declarations. */ if (token_end - token == 8 && !strncmp (token, "operator", 8)) { while (chartype[0xff & (int) *buf_ptr] == opchar) { buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } } token_end = buf_ptr; skip_buffered_space(); /* adjusts buf_ptr */ } parser_state_tos->its_a_keyword = false; parser_state_tos->sizeof_keyword = false; /* if last token was 'struct', then this token should be treated as a declaration */ if (l_struct) { l_struct = false; last_code = ident; parser_state_tos->last_u_d = true; if (parser_state_tos->last_token == cpp_operator) { return overloaded; } return (decl); } /* Operator after indentifier is binary */ parser_state_tos->last_u_d = false; last_code = ident; /* Check whether the token is a reserved word. Use perfect hashing... */ if (settings.c_plus_plus) { p = is_reserved_cc (token, token_end - token); } else { p = is_reserved (token, token_end - token); } if ((p == NULL) && (user_specials != 0)) { for (p = &user_specials[0]; p < &user_specials[0] + user_specials_idx; p++) { char *q = token; char *r = p->rwd; /* This string compare is a little nonstandard because token * ends at the character before token_end and p->rwd is * null-terminated. */ while (1) { /* If we have come to the end of both the keyword in * user_specials and the keyword in token they are equal. */ if (q >= token_end && !*r) { goto found_keyword; } /* If we have come to the end of just one, they are not * equal. */ if (q >= token_end || !*r) { break; } /* If the characters in corresponding characters are not * equal, the strings are not equal. */ if (*q++ != *r++) { break; } } } /* Didn't find anything in user_specials. */ p = NULL; } found_keyword: if (p) { /* we have a keyword */ codes_ty value; value = ident; parser_state_tos->its_a_keyword = true; parser_state_tos->last_u_d = true; parser_state_tos->last_rw = p->rwcode; parser_state_tos->last_rw_depth = parser_state_tos->paren_depth; switch (p->rwcode) { case rw_operator: /* C++ operator overloading. */ value = cpp_operator; parser_state_tos->in_parameter_declaration = 1; break; case rw_switch: /* it is a switch */ value = (swstmt); break; case rw_case: /* a case or default */ value = (casestmt); break; case rw_enum: l_enum = true; /* reset on '(' ')' '{' '}' or ';' */ /* fall through */ case rw_struct_like: /* a "struct" */ if (parser_state_tos->p_l_follow && !(parser_state_tos->noncast_mask & 1 << parser_state_tos->p_l_follow)) /* inside parens: cast */ { parser_state_tos->cast_mask |= 1 << parser_state_tos->p_l_follow; break; } l_struct = true; /* Next time around, we will want to know that we have had a 'struct' */ case rw_decl: /* one of the declaration keywords */ if (parser_state_tos->p_l_follow && !(parser_state_tos->noncast_mask & 1 << parser_state_tos->p_l_follow)) /* inside parens: cast */ { parser_state_tos->cast_mask |= 1 << parser_state_tos->p_l_follow; break; } last_code = decl; value = (decl); break; case rw_sp_paren: /* if, while, for */ value = (sp_paren); if (*token == 'i' && parser_state_tos->last_token == sp_else) { parser_state_tos->i_l_follow -= settings.ind_size; } break; case rw_sp_nparen: /* do */ value = (sp_nparen); break; case rw_sp_else: /* else */ value = (sp_else); break; case rw_sizeof: parser_state_tos->sizeof_keyword = true; value = (ident); break; case rw_return: case rw_break: default: /* all others are treated like any other identifier */ value = (ident); } /* end of switch */ if (parser_state_tos->last_token == cpp_operator) { return overloaded; } return value; } /* end of if (found_it) */ else if ((*buf_ptr == '(') && (parser_state_tos->tos <= 1) && (parser_state_tos->ind_level == 0) && (parser_state_tos->paren_depth == 0)) { /* We have found something which might be the name in a function * definition. */ char *tp; int paren_count = 1; /* If the return type of this function definition was not defined * with a -T commandline option, then the output of indent would * alternate on subsequent calls. In order to avoid that we try * to detect that case here and make a minimal change to cause * the correct behaviour. */ if (parser_state_tos->last_token == ident && parser_state_tos->last_saw_nl) { parser_state_tos->in_decl = true; } /* Skip to the matching ')'. */ for (tp = buf_ptr + 1; (paren_count > 0) && (tp < in_prog + in_prog_size); tp++) { if (*tp == '(') { paren_count++; } if (*tp == ')') { paren_count--; } /* Can't occur in parameter list; this way we don't search the * whole file in the case of unbalanced parens. */ if (*tp == ';') { goto not_proc; } } if (paren_count == 0) { parser_state_tos->procname = token; parser_state_tos->procname_end = token_end; while (isspace (*tp)) { tp++; } if ((*tp == '_') && (in_prog + in_prog_size - tp >= 13) && !strncmp (tp, "__attribute__", 13)) { /* Found an __attribute__ after a function declaration */ /* Must be a declaration */ } else { /* If the next char is ';' or ',' or '(' we have a function * declaration, not a definition. * * I've added '=' to this list to keep from breaking * a non-valid C macro from libc. -jla */ if (*tp != ';' && *tp != ',' && *tp != '(' && *tp != '=') { parser_state_tos->in_parameter_declaration = 1; } } } not_proc:; } else if ((*buf_ptr == ':') && (*(buf_ptr + 1) == ':') && (parser_state_tos->tos <= 1) && (parser_state_tos->ind_level == 0) && (parser_state_tos->paren_depth == 0)) { parser_state_tos->classname = token; parser_state_tos->classname_end = token_end; } /* The following hack attempts to guess whether or not the * current token is in fact a declaration keyword -- one that * has been typedef'd */ else if ( ( ((*buf_ptr == '*') && (buf_ptr[1] != '=')) || isalpha (*buf_ptr) || (*buf_ptr == '_')) && !parser_state_tos->p_l_follow && !parser_state_tos->block_init && ( (parser_state_tos->last_token == rparen) || (parser_state_tos->last_token == semicolon) || (parser_state_tos->last_token == rbrace) || (parser_state_tos->last_token == decl) || (parser_state_tos->last_token == lbrace) || (parser_state_tos->last_token == start_token))) { parser_state_tos->its_a_keyword = true; parser_state_tos->last_u_d = true; last_code = decl; if (parser_state_tos->last_token == cpp_operator) { return overloaded; } return decl; } else { /* what ? */ } if (last_code == decl) { /* if this is a declared variable, then following sign is unary */ parser_state_tos->last_u_d = true; /* will make "int a -1" work */ } last_code = ident; if (parser_state_tos->last_token == cpp_operator) { return overloaded; } return (ident); /* the ident is not in the list */ } /* end of procesing for alpanum character */ /* Scan a non-alphanumeric token */ /* If it is not a one character token, token_end will get changed later. */ token_end = buf_ptr + 1; /* THIS MAY KILL YOU!!! * * Note that it may be possible for this to kill us--if `fill_buffer' * at any time switches `buf_ptr' to the other input buffer, `token' * and `token_end' will point to different storage areas!!! */ if (++buf_ptr >= buf_end) { fill_buffer(); } /* If it is a backslash new-line, just eat the backslash */ if ((*token == '\\') && (buf_ptr[0] == EOL)) { token = buf_ptr; if (++buf_ptr >= buf_end) { fill_buffer(); } } switch (*token) { case '\0': code = code_eof; break; case EOL: parser_state_tos->matching_brace_on_same_line = -1; unary_delim = parser_state_tos->last_u_d; parser_state_tos->last_nl = true; code = newline; break; /* Handle wide strings and chars. */ case 'L': if (buf_ptr[0] != '"' && buf_ptr[0] != '\'') { token_end = buf_ptr; code = ident; break; } qchar = buf_ptr[0]; buf_ptr++; goto handle_string; case '\'': /* start of quoted character */ case '"': /* start of string */ qchar = *token; handle_string: /* Find out how big the literal is so we can set token_end. */ /* Invariant: before loop test buf_ptr points to the next * character that we have not yet checked. */ while ((*buf_ptr != qchar) && (*buf_ptr != 0)) /* && *buf_ptr != EOL) */ { if (*buf_ptr == EOL) { ++line_no; } if (*buf_ptr == '\\') { buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } if (*buf_ptr == EOL) { ++line_no; } if (*buf_ptr == 0) { break; } } buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } } if (*buf_ptr == EOL || *buf_ptr == 0) { WARNING ((qchar == '\'' ? _("Unterminated character constant") : _("Unterminated string constant")), 0, 0); } else { /* Advance over end quote char. */ buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } } token_end = buf_ptr; code = ident; break; case '(': l_enum = false; unary_delim = true; code = lparen; break; case '[': if (parser_state_tos->in_or_st) { parser_state_tos->in_or_st++; } unary_delim = true; code = lparen; break; case ')': l_enum = false; code = rparen; break; case ']': if (parser_state_tos->in_or_st > 1) { parser_state_tos->in_or_st--; } code = rparen; break; case '#': unary_delim = parser_state_tos->last_u_d; code = preesc; /* Make spaces between '#' and the directive be part of * the token if user specified "-lps" */ while (*buf_ptr == ' ' && buf_ptr < buf_end) { buf_ptr++; } if (settings.leave_preproc_space) { token_end = buf_ptr; } break; case '?': unary_delim = true; code = question; break; case ':': /* Deal with C++ class::method */ if (*buf_ptr == ':') { code = doublecolon; buf_ptr++; token_end = buf_ptr; break; } code = colon; unary_delim = true; if (squest && *e_com != ' ') { if (e_code == s_code) { parser_state_tos->want_blank = false; } else { parser_state_tos->want_blank = true; } } break; case ';': l_enum = false; unary_delim = true; code = semicolon; break; case '{': if (parser_state_tos->matching_brace_on_same_line < 0) { parser_state_tos->matching_brace_on_same_line = 1; } else { parser_state_tos->matching_brace_on_same_line++; } if (l_enum) { /* Keep all variables in the same column: * ONE, * TWO, etc * instead of * ONE, * TWO, * Use a special code for `block_init' however, because we still * want to do the line breaks when `settings.braces_on_struct_decl_line' * is not set. */ parser_state_tos->block_init = 2; parser_state_tos->block_init_level = 0; l_enum = false; } unary_delim = true; code = lbrace; break; case '}': parser_state_tos->matching_brace_on_same_line--; l_enum = false; unary_delim = true; code = rbrace; break; case 014: /* a form feed */ unary_delim = parser_state_tos->last_u_d; parser_state_tos->last_nl = true; /* remember this so we can set 'parser_state_tos->col_1' right */ code = form_feed; break; case ',': unary_delim = true; code = comma; break; case '.': if ((buf_ptr[0] == '.') && (buf_ptr[1] == '.')) { /* '...' */ if ((buf_ptr += 2) >= buf_end) { fill_buffer(); } unary_delim = true; token_end = buf_ptr; if (parser_state_tos->in_decl) { /* '...' in a declaration */ code = decl; } else { code = binary_op; } } else { unary_delim = false; code = struct_delim; if (*buf_ptr == '*') /* object .* pointer-to-member */ { ++buf_ptr; token_end = buf_ptr; } } break; case '-': case '+': /* check for -, +, --, ++ */ code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; if (*buf_ptr == token[0]) { /* check for doubled character */ buf_ptr++; /* buffer overflow will be checked at end of loop */ if (last_code == ident || last_code == rparen) { code = (parser_state_tos->last_u_d ? unary_op : postop); /* check for following ++ or -- */ unary_delim = false; } } else if (*buf_ptr == '=') { /* check for operator += */ buf_ptr++; } else if (*buf_ptr == '>') { /* check for operator -> */ buf_ptr++; code = struct_delim; /* check for operator ->* */ if (*buf_ptr == '*') { buf_ptr++; } } else { /* what ? */ } token_end = buf_ptr; break; /* buffer overflow will be checked at end of switch */ case '=': if (parser_state_tos->in_or_st && (parser_state_tos->last_token != cpp_operator)) { parser_state_tos->block_init = 1; parser_state_tos->block_init_level = 0; } if (*buf_ptr == '=') /* == */ { buf_ptr++; } else if ((*buf_ptr == '-') || (*buf_ptr == '+') || (*buf_ptr == '*') || (*buf_ptr == '&')) { /* Something like x=-1, which can mean x -= 1 ("old style" in K&R1) * or x = -1 (ANSI). Note that this is only an ambiguity if the * character can also be a unary operator. If not, just produce * output code that produces a syntax error (the theory being that * people want to detect and eliminate old style assignments but * they don't want indent to silently change the meaning of their * code). */ WARNING (_("old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n"), (unsigned long) *((unsigned char *) buf_ptr), (unsigned long) *((unsigned char *) buf_ptr)); } else { /* what ? */ } code = binary_op; unary_delim = true; token_end = buf_ptr; break; /* can drop thru!!! */ case '>': case '<': case '!': /* ops like <, <<, <=, !=, <<=, etc */ /* This will of course scan sequences like "<=>", "!=>", "<<>", etc. as * one token, but I don't think that will cause any harm. */ /* in C++ mode also scan ?[=] GNU C++ operators * maybe some flag to them ? */ while (*buf_ptr == '>' || *buf_ptr == '<' || *buf_ptr == '=' || (settings.c_plus_plus && *buf_ptr == '?')) { if (++buf_ptr >= buf_end) { fill_buffer(); } if (*buf_ptr == '=') { if (++buf_ptr >= buf_end) { fill_buffer(); } } } code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; token_end = buf_ptr; break; default: if (token[0] == '/' && (*buf_ptr == '*' || *buf_ptr == '/')) { /* A C or C++ comment */ if (*buf_ptr == '*') { code = comment; } else { code = cplus_comment; } if (++buf_ptr >= buf_end) { fill_buffer(); } if (code == comment) { /* Threat comments of type / *UPPERCASE* / not as comments */ char *p = buf_ptr; while (isupper (*p++)) { /* There is always at least one * newline in the buffer; so no * need to check for buf_end. */ } if (p < buf_end && p[-1] == '*' && *p == '/') { buf_ptr = p + 1; code = ident; parser_state_tos->want_blank = true; } } unary_delim = parser_state_tos->last_u_d; } else if (parser_state_tos->last_token == cpp_operator) { /* For C++ overloaded operators. */ code = overloaded; last_code = overloaded; } else { while (*(buf_ptr - 1) == *buf_ptr || *buf_ptr == '=') { /* handle ||, &&, etc, and also things as in int *****i */ if (++buf_ptr >= buf_end) { fill_buffer(); } } code = (parser_state_tos->last_u_d ? unary_op : binary_op); unary_delim = true; } token_end = buf_ptr; } /* end of switch */ if (code != newline) { l_struct = false; last_code = code; } if (buf_ptr >= buf_end) { fill_buffer(); } parser_state_tos->last_u_d = unary_delim; if (parser_state_tos->last_token == cpp_operator) { return overloaded; } return (code); } /** * Add the given keyword to the keyword table, using val as * the keyword type */ extern void addkey ( char *key, rwcodes_ty val) { templ_ty *p; /* Check to see whether key is a reserved word or not. */ if ( (settings.c_plus_plus && is_reserved_cc (key, strlen (key)) != 0) || (!settings.c_plus_plus && is_reserved (key, strlen (key)) != 0)) { } else { if (user_specials == 0) { user_specials = (templ_ty *) xmalloc (5 * sizeof (templ_ty)); user_specials_max = 5; user_specials_idx = 0; } else if (user_specials_idx == user_specials_max) { user_specials_max += 5; user_specials = (templ_ty *) xrealloc ((char *) user_specials, user_specials_max * sizeof (templ_ty)); } else { /* what ? */ } p = &user_specials[user_specials_idx++]; p->rwd = key; p->rwcode = val; } } indent-2.2.11/src/indent.c0000644000177400010010000010223111016323716012205 00000000000000/** \file * Copyright (c) 1999, 2000 Carlo Wood. All rights reserved.
* Copyright (c) 1994, 1996, 1997 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. All rights reserved.
* * Copyright (c) 1980 The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. * Copyright (c) 1985 Sun Microsystems, Inc. * All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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. * * Updates: * - 2002-08-05: Matthias and Eric Lloyd * Added support for -brf to place function opening brace after function * declaration. * - 28 Sep 2003 Erik de Castro Lopo * Fixed Bug#212320: --blank-lines-after-proceduresdoes not work * - 28 Sep 2003 Erik de Castro Lopo * Fixed Bug#206785: indent segfaults on the attached file * - 28 Sep 2003 Geoffrey Lee * Fixed Bug#205692: indent: [patch] fix garble shown in locale(fwd) * - 2008-03-08 DI Re-baselined on the more acceptable (license-wise) OpenBSD release 3.4. */ #include "sys.h" #if defined (HAVE_UNISTD_H) #include #endif #ifdef PRESERVE_MTIME #include #ifdef HAVE_UTIME_H #include #elif defined(HAVE_SYS_UTIME_H) #include #endif #endif #include #include #include #include #ifdef HAVE_LOCALE_H #include #endif #include "indent.h" #include "backup.h" #include "code_io.h" #include "globs.h" #include "parse.h" #include "comments.h" #include "args.h" #include "output.h" #include "handletoken.h" RCSTAG_CC ("$GNU$"); /* Stuff that needs to be shared with the rest of indent. * Documented in indent.h. */ char * labbuf = NULL; char * s_lab = NULL; char * e_lab = NULL; char * l_lab = NULL; char * codebuf = NULL; char * s_code = NULL; char * e_code = NULL; char * l_code = NULL; char * combuf = NULL; char * s_com = NULL; char * e_com = NULL; char * l_com = NULL; char * s_code_corresponds_to = NULL; buf_ty save_com; char * bp_save = NULL; char * be_save = NULL; int code_lines = 0; int line_no = 0; int break_comma = 0; int n_real_blanklines = 0; int prefix_blankline_requested = 0; codes_ty prefix_blankline_requested_code; int postfix_blankline_requested = 0; codes_ty postfix_blankline_requested_code; char * in_name = 0; /*!< Points to current input file name */ file_buffer_ty * current_input = 0; /*!< Points to the current input buffer */ int embedded_comment_on_line = 0; /*!< True if there is an embedded comment on this code line */ int else_or_endif = 0; int * di_stack = NULL; /*!< structure indentation levels */ int di_stack_alloc = 0; /*!< Currently allocated size of di_stack. */ int squest = 0; /*!< when this is positive, we have seen a ? without * the matching : in a [c]?[s]:[s] construct */ unsigned long in_prog_size = 0U; char * in_prog = NULL; /** The position that we will line the current line up with when it comes time * to print it (if we are lining up to parentheses). */ int paren_target = 0; #ifdef DEBUG int debug = 1; #endif /** * */ static void sw_buffer(void) { parser_state_tos->search_brace = false; bp_save = buf_ptr; be_save = buf_end; buf_ptr = save_com.ptr; need_chars (&save_com, 1); buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ } /** * */ static BOOLEAN search_brace( codes_ty * type_code, BOOLEAN * force_nl, BOOLEAN * flushed_nl, BOOLEAN * last_else, BOOLEAN * is_procname_definition, BOOLEAN * pbreak_line) { while (parser_state_tos->search_brace) { /* After scanning an if(), while (), etc., it might be necessary to * keep track of the text between the if() and the start of the * statement which follows. Use save_com to do so. */ switch (*type_code) { case newline: ++line_no; *flushed_nl = true; break; case form_feed: break; /* form feeds and newlines found here will be * ignored */ case lbrace: /* Ignore buffering if no comment stored. */ if (save_com.end == save_com.ptr) { parser_state_tos->search_brace = false; return true; /* RETURN */ } /* We need to put the '{' back into save_com somewhere. */ if (settings.btype_2 && (parser_state_tos->last_token != rbrace)) { /* Kludge to get my newline back */ if ((parser_state_tos->last_token == sp_else) && (save_com.end > &save_com.ptr[4]) && (save_com.end[-2] == '*') && (save_com.end[-1] == '/') && (save_com.ptr[2] == '/') && (save_com.ptr[3] == '*')) { char *p; for (p = &save_com.ptr[4]; *p != '\n' && p < &save_com.end[-2]; ++p) { } if (*p != '\n') { *save_com.end++ = EOL; } } /* Put the brace at the beginning of the saved buffer */ save_com.ptr[0] = '{'; save_com.len = 1; save_com.column = current_column (); } else { /* Put the brace at the end of the saved buffer, after * a newline character. The newline char will cause * a `dump_line' call, thus ensuring that the brace * will go into the right column. */ *save_com.end++ = EOL; *save_com.end++ = '{'; save_com.len += 2; } /* Go to common code to get out of this loop. */ sw_buffer(); break; case comment: /* Save this comment in the `save_com' buffer, for * possible re-insertion in the output stream later. */ if (!*flushed_nl || (save_com.end != save_com.ptr)) { need_chars (&save_com, 10); if (save_com.end == save_com.ptr) { /* if this is the first comment, we must set * up the buffer */ save_com.start_column = current_column (); save_com.ptr[0] = save_com.ptr[1] = ' '; save_com.end = save_com.ptr + 2; save_com.len = 2; save_com.column = current_column (); } else { *save_com.end++ = EOL; /* add newline between * comments */ *save_com.end++ = ' '; save_com.len += 2; --line_no; } *save_com.end++ = '/'; /* copy in start of comment */ *save_com.end++ = '*'; for (;;) { /* loop until we get to the end of the * comment */ /* make sure there is room for this character and * (while we're at it) the '/' we might add at the end * of the loop. */ need_chars (&save_com, 2); *save_com.end = *buf_ptr++; save_com.len++; if (buf_ptr >= buf_end) { fill_buffer(); if (had_eof) { ERROR (_("EOF encountered in comment"), 0, 0); return indent_punt; /* RETURN */ } } if (*save_com.end++ == '*' && *buf_ptr == '/') { break; /* we are at end of comment */ } } *save_com.end++ = '/'; /* add ending slash */ save_com.len++; if (++buf_ptr >= buf_end) /* get past / in buffer */ { fill_buffer(); } break; } /* Just some statement. */ default: /* Some statement. Unless it's special, arrange * to break the line. */ if (((*type_code == sp_paren) && (*token == 'i') && /* "if" statement */ *last_else) || ((*type_code == sp_else) && /* "else" statement */ (e_code != s_code) && (e_code[-1] == '}'))) /* The "else" follows '}' */ { *force_nl = false; } else if (*flushed_nl) { *force_nl = true; } else { /* what ? */ } if (save_com.end == save_com.ptr) { /* ignore buffering if comment wasnt saved up */ parser_state_tos->search_brace = false; return true; /* RETURN */ } if (*force_nl) { *force_nl = false; --line_no; /* this will be re-increased when the nl is read from the buffer */ need_chars (&save_com, 2); *save_com.end++ = EOL; save_com.len++; if (settings.verbose && !*flushed_nl) { WARNING (_("Line broken"), 0, 0); } *flushed_nl = false; } /* Now copy this token we just found into the saved buffer. */ *save_com.end++ = ' '; save_com.len++; buf_ptr = token; /* A total nightmare is created by trying to get the * next token into this save buffer. Rather than that, * I've just backed up the buffer pointer to point * at `token'. --jla 9/95 */ parser_state_tos->procname = "\0"; parser_state_tos->procname_end = "\0"; parser_state_tos->classname = "\0"; parser_state_tos->classname_end = "\0"; /* Switch input buffers so that calls to lexi() will * read from our save buffer. */ sw_buffer(); break; } /* end of switch */ if (*type_code != code_eof) { int just_saw_nl = false; if (*type_code == newline) { just_saw_nl = true; } *type_code = lexi (); if ( ( (*type_code == newline) && (just_saw_nl == true)) || ( (*type_code == comment) && parser_state_tos->last_saw_nl && (parser_state_tos->last_token != sp_else))) { dump_line(true, &paren_target, pbreak_line); *flushed_nl = true; } *is_procname_definition = ((parser_state_tos->procname[0] != '\0') && parser_state_tos->in_parameter_declaration); } if ((*type_code == ident) && *flushed_nl && !settings.procnames_start_line && parser_state_tos->in_decl && (parser_state_tos->procname[0] != '\0')) { *flushed_nl = 0; } } /* end of while (search_brace) */ *last_else = 0; return true; } /** * */ static exit_values_ty indent_main_loop( BOOLEAN * pbreak_line) { codes_ty hd_type = code_eof; char * t_ptr = NULL; codes_ty type_code = start_token; exit_values_ty file_exit_value = total_success; int dec_ind = 0; /* current indentation for declarations */ BOOLEAN scase = false; /* true when we've just see a "case"; * determines what to do with the * following colon */ BOOLEAN flushed_nl; /* Used when buffering up comments to remember that * a newline was passed over */ BOOLEAN sp_sw = false; /* true when in the expression part of if(...), * while(...), etc. */ BOOLEAN force_nl = false; /* last_token_ends_sp: True if we have just encountered the end of an if (...), * etc. (i.e. the ')' of the if (...) was the last token). The variable is * set to 2 in the middle of the main token reading loop and is decremented * at the beginning of the loop, so it will reach zero when the second token * after the ')' is read. */ BOOLEAN last_token_ends_sp = false; BOOLEAN last_else = false; /* true if last keyword was an else */ for (;;) { /* this is the main loop. it will go until * we reach eof */ BOOLEAN is_procname_definition; bb_code_ty can_break = bb_none; if (type_code != newline) { can_break = parser_state_tos->can_break; } parser_state_tos->last_saw_nl = false; parser_state_tos->can_break = bb_none; type_code = lexi (); /* lexi reads one token. "token" points to * the actual characters. lexi returns a code * indicating the type of token */ /* If the last time around we output an identifier or * a paren, then consider breaking the line here if it's * too long. * * A similar check is performed at the end of the loop, after * we've put the token on the line. */ if ((settings.max_col > 0) && (buf_break != NULL) && ( ( (parser_state_tos->last_token == ident) && (type_code != comma) && (type_code != semicolon) && (type_code != newline) && (type_code != form_feed) && (type_code != rparen) && (type_code != struct_delim)) || ( (parser_state_tos->last_token == rparen) && (type_code != comma) && (type_code != rparen) ) ) && (output_line_length () > settings.max_col)) { *pbreak_line = true; } if (last_token_ends_sp > 0) { last_token_ends_sp--; } is_procname_definition = (((parser_state_tos->procname[0] != '\0') && parser_state_tos->in_parameter_declaration) || (parser_state_tos->classname[0] != '\0')); /* The following code moves everything following an if (), while (), * else, etc. up to the start of the following stmt to a buffer. This * allows proper handling of both kinds of brace placement. */ flushed_nl = false; if (!search_brace(&type_code, &force_nl, &flushed_nl, &last_else, &is_procname_definition, pbreak_line)) { /* Hit EOF unexpectedly in comment. */ return indent_punt; } if (type_code == code_eof) { /* we got eof */ if (s_lab != e_lab || s_code != e_code || s_com != e_com) /* must dump end of line */ { dump_line(true, &paren_target, pbreak_line); } if (parser_state_tos->tos > 1) /* check for balanced braces */ { ERROR (_("Unexpected end of file"), 0, 0); file_exit_value = indent_error; } if (settings.verbose) { printf (_("There were %d non-blank output lines and %d comments\n"), (int) out_lines, (int) com_lines); if (com_lines > 0 && code_lines > 0) { printf (_("(Lines with comments)/(Lines with code): %6.3f\n"), (1.0 * com_lines) / code_lines); } } flush_output (); return file_exit_value; /* RETURN */ } if ((type_code != comment) && (type_code != cplus_comment) && (type_code != newline) && (type_code != preesc) && (type_code != form_feed)) { if (force_nl && (type_code != semicolon) && ( (type_code != lbrace) || (!parser_state_tos->in_decl && !settings.btype_2) || (parser_state_tos->in_decl && !settings.braces_on_struct_decl_line) || (parser_state_tos->last_token == rbrace))) { if (settings.verbose && !flushed_nl) { WARNING (_("Line broken 2"), 0, 0); } flushed_nl = false; dump_line(true, &paren_target, pbreak_line); parser_state_tos->want_blank = false; force_nl = false; } parser_state_tos->in_stmt = true; /* turn on flag which causes * an extra level of * indentation. this is * turned off by a ; or } */ if (s_com != e_com) { /* the code has an embedded comment in the * line. Move it from the com buffer to the * code buffer. * * Do not add a space before the comment if it is the first * thing on the line. */ if (e_code != s_code) { set_buf_break (bb_embedded_comment_start, paren_target); *e_code++ = ' '; embedded_comment_on_line = 2; } else { embedded_comment_on_line = 1; } for (t_ptr = s_com; *t_ptr; ++t_ptr) { check_code_size(); *e_code++ = *t_ptr; } set_buf_break (bb_embedded_comment_end, paren_target); *e_code++ = ' '; *e_code = '\0'; /* null terminate code sect */ parser_state_tos->want_blank = false; e_com = s_com; } } else if ((type_code != comment) && (type_code != cplus_comment) && !(settings.break_function_decl_args && (parser_state_tos->last_token == comma)) && !( (parser_state_tos->last_token == comma) && !settings.leave_comma)) { /* preserve force_nl thru a comment but * cancel forced newline after newline, form feed, etc. * however, don't cancel if last thing seen was comma-newline * and -bc flag is on. */ force_nl = false; } else { /* what ? */ } /* Main switch on type of token scanned */ check_code_size(); /* now, decide what to do with the token */ handle_the_token(type_code, &scase, &force_nl, &sp_sw, &flushed_nl, &hd_type, &dec_ind, &last_token_ends_sp, &file_exit_value, can_break, &last_else, is_procname_definition, pbreak_line); *e_code = '\0'; /* make sure code section is null terminated */ if ((type_code != comment) && (type_code != cplus_comment) && (type_code != newline) && (type_code != preesc) && (type_code != form_feed)) { parser_state_tos->last_token = type_code; } /* Now that we've put the token on the line (in most cases), * consider breaking the line because it's too long. * * Don't consider the cases of `unary_op', newlines, * declaration types (int, etc.), if, while, for, * identifiers (handled at the beginning of the loop), * periods, or preprocessor commands. */ if ((settings.max_col > 0) && (buf_break != NULL)) { if ( ( (type_code == binary_op) || (type_code == postop) || (type_code == question) || ((type_code == colon) && (scase || (squest <= 0))) || (type_code == semicolon) || (type_code == sp_nparen) || (type_code == sp_else) || ((type_code == ident) && (*token == '\"')) || (type_code == struct_delim) || (type_code == comma)) && (output_line_length () > settings.max_col)) { *pbreak_line = true; } } } /* end of main infinite loop */ } /** * */ static exit_values_ty indent ( file_buffer_ty * this_file) { BOOLEAN break_line = false; /* Whether or not we should break the line. */ in_prog = this_file->data; in_prog_pos = this_file->data; in_prog_size = this_file->size; squest = false; n_real_blanklines = 0; postfix_blankline_requested = 0; clear_buf_break_list (&break_line); if (settings.decl_com_ind <= 0) /* if not specified by user, set this */ { settings.decl_com_ind = settings.ljust_decl ? (settings.com_ind <= 10 ? 2 : settings.com_ind - 8) : settings.com_ind; } if (settings.continuation_indent == 0) { settings.continuation_indent = settings.ind_size; } if (settings.paren_indent == -1) { settings.paren_indent = settings.continuation_indent; } if (settings.case_brace_indent == -1) { settings.case_brace_indent = settings.ind_size; /* This was the previous default */ } fill_buffer(); /* Fill the input buffer */ return indent_main_loop(&break_line); /* do the work. */ } /** * */ static char * handle_profile ( int argc, char * argv[]) { int i; char *profile_pathname = NULL; for (i = 1; i < argc; ++i) { if ((strcmp (argv[i], "-npro") == 0) || (strcmp (argv[i], "--ignore-profile") == 0) || (strcmp (argv[i], "+ignore-profile") == 0)) { break; } } if (i >= argc) { profile_pathname = set_profile (); } return profile_pathname; } /** * */ static char * out_name = 0; /* Points to the name of the output file */ static int input_files = 0; /* How many input files were specified */ static char ** in_file_names = NULL; /* Names of all input files */ static int max_input_files = 128; /* Initial number of input filenames to allocate. */ /** * */ static exit_values_ty process_args ( int argc, char * argv[], BOOLEAN * using_stdin) { int i; exit_values_ty exit_status = total_success; for (i = 1; i < argc; ++i) { if ((*argv[i] != '-') && (*argv[i] != '+')) /* Filename */ { if (settings.expect_output_file == true) /* Last arg was "-o" */ { if (out_name != 0) { fprintf (stderr, _("indent: only one output file (2nd was %s)\n"), argv[i]); exit_status = invocation_error; break; } if (input_files > 1) { fprintf (stderr, _("indent: only one input file when output file is specified\n")); exit_status = invocation_error; break; } out_name = argv[i]; settings.expect_output_file = false; continue; } else { if (*using_stdin) { fprintf (stderr, _("indent: can't have filenames when specifying standard input\n")); exit_status = invocation_error; break; } input_files++; if (input_files > 1) { if (out_name != 0) { fprintf (stderr, _("indent: only one input file when output file is specified\n")); exit_status = invocation_error; break; } if (settings.use_stdout != 0) { fprintf (stderr, _("indent: only one input file when stdout is used\n")); exit_status = invocation_error; break; } if (input_files > max_input_files) { max_input_files = 2 * max_input_files; in_file_names = (char **) xrealloc ((char *) in_file_names, (max_input_files * sizeof (char *))); } } in_file_names[input_files - 1] = argv[i]; } } else { /* '-' as filename means stdin. */ if (strcmp (argv[i], "-") == 0) { if (input_files > 0) { fprintf (stderr, _("indent: can't have filenames when specifying standard input\n")); exit_status = invocation_error; break; } *using_stdin = true; } else { i += set_option(argv[i], (i < argc ? argv[i + 1] : 0), 1, _("command line")); } } } return exit_status; } /** * */ static exit_values_ty indent_multiple_files(void) { exit_values_ty exit_status = total_success; int i; /* When multiple input files are specified, make a backup copy * and then output the indented code into the same filename. */ for (i = 0; input_files; i++, input_files--) { exit_values_ty status; struct stat file_stats; in_name = in_file_names[i]; out_name = in_file_names[i]; current_input = read_file(in_file_names[i], &file_stats); open_output(out_name, "r+"); make_backup(current_input, &file_stats); /* Aborts on failure. */ /* We have safely made a backup so the open file can be truncated. */ reopen_output_trunc(out_name); reset_parser(); status = indent (current_input); if (status > exit_status) { exit_status = status; } if (settings.preserve_mtime) { close_output(&file_stats, out_name); } else { close_output(NULL, out_name); } } return exit_status; } /** * */ static exit_values_ty indent_single_file(BOOLEAN using_stdin) { exit_values_ty exit_status = total_success; struct stat file_stats; if ((input_files == 0) || using_stdin) { input_files = 1; in_file_names[0] = "Standard input"; in_name = in_file_names[0]; current_input = read_stdin (); } else { /* 1 input file */ in_name = in_file_names[0]; current_input = read_file(in_file_names[0], &file_stats); if (!out_name && !settings.use_stdout) { out_name = in_file_names[0]; make_backup(current_input, &file_stats); } } /* Use stdout if it was specified ("-st"), or neither input * nor output file was specified. */ if (settings.use_stdout || !out_name) { open_output(NULL, NULL); } else { open_output(out_name, "w"); } reset_parser (); exit_status = indent (current_input); if (input_files > 0 && !using_stdin && settings.preserve_mtime) { close_output(&file_stats, out_name); } else { close_output(NULL, out_name); } return exit_status; } /** * */ static exit_values_ty indent_all( BOOLEAN using_stdin) { exit_values_ty exit_status = total_success; if (input_files > 1) { exit_status = indent_multiple_files(); } else { /* One input stream -- specified file, or stdin */ exit_status = indent_single_file(using_stdin); } return exit_status; } /** * */ int main( int argc, char ** argv) { char *profile_pathname = 0; BOOLEAN using_stdin = false; exit_values_ty exit_status; #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) && defined (HAVE_LCCTYPES) setlocale(LC_MESSAGES, ""); #endif bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); #if defined (_WIN32) && !defined (__CYGWIN__) /* wildcard expansion of commandline arguments, see wildexp.c */ extern void wildexp(int *argc, char ***argv); wildexp(&argc, &argv); #endif /* defined (_WIN32) && !defined (__CYGWIN__) */ #ifdef DEBUG if (debug) { debug_init(); } #endif init_parser (); initialize_backups (); exit_status = total_success; input_files = 0; in_file_names = (char **) xmalloc(max_input_files * sizeof (char *)); set_defaults(); profile_pathname = handle_profile(argc, argv); exit_status = process_args(argc, argv, &using_stdin); if (exit_status == total_success) { if (settings.verbose && profile_pathname) { fprintf (stderr, _("Read profile %s\n"), profile_pathname); } set_defaults_after(); exit_status = indent_all(using_stdin); } return (exit_status); } indent-2.2.11/src/Makefile.am0000644000177400010010000000233611015101347012612 00000000000000AUTOMAKE_OPTIONS = 1.2 gnits bin_PROGRAMS = indent indent_SOURCES = indent.c args.c backup.c comments.c lexi.c parse.c globs.c code_io.c output.c utils.c handletoken.c noinst_HEADERS = indent.h args.h backup.h comments.h lexi.h parse.h globs.h code_io.h output.h utils.h sys.h libgettext.h handletoken.h indent_LDADD = $(INTLLIBS) EXTRA_DIST = @PACKAGE@.gperf @PACKAGE@-cc.gperf wildexp.c gperf.c gperf-cc.c \ @PACKAGE@.dsp \ config.h.vc++ \ config.h.vms BUILT_SOURCES = gperf.c gperf-cc.c INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/intl DEFS = @DEFS@ -DLOCALEDIR=\"${localedir}\" LIBS = @LIBINTL@ @LIBS@ MAINTAINERCLEANFILES= Makefile.in libgettext.h ## Use -g when in maintainer mode if MAINTAINER_MODE AM_CFLAGS= -g -Wall -I. else AM_CFLAGS= -I. endif gperf.c: indent.gperf gperf -D -c -l -p -t -T -g -j1 -o -K rwd -N is_reserved indent.gperf > gperf.c gperf-cc.c: indent-cc.gperf gperf -D -c -l -p -t -T -g -j1 -o -K rwd -N is_reserved_cc -H hash_cc indent-cc.gperf > gperf-cc.c if MAINTAINER_MODE config.h.vc++ config.h.vms @PACKAGE@.lsm :%: Makefile %.in sed -e 's%!VERSION!%@VERSION@%g' $@.in > $@ @PACKAGE@.dsp: @PACKAGE@.dsp.in cat $< | perl -e 'while (<>) {chomp; print "$$_\015\012"; }' > $@ endif indent-2.2.11/src/indent.h0000644000177400010010000005634411264427326012236 00000000000000/** \file * Copyright (c) 1999 Carlo Wood. All rights reserved.
* Copyright (c) 1994 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. All rights reserved.
* * Copyright (c) 1985 Sun Microsystems, Inc.
* Copyright (c) 1980 The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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. * * History: * - 2002-11-10 Cristalle Azundris Sabon * Added --preprocessor-indentation (ppi) if set, will indent nested * preprocessor-statements with n spaces per level. overrides -lps. * -2007-11-11 Jean-Christophe Dubois * Added --indent-label and --linux-style options. * */ #ifndef INDENT_INDENT_H #define INDENT_INDENT_H #include "sys.h" RCSTAG_H (indent, "$Id$"); #include #include #ifdef ENABLE_NLS #define _(X) gettext(X) #else #define _(X) X #endif #include "lexi.h" /** * Round up P to be a multiple of SIZE. */ #ifndef ROUND_UP #define ROUND_UP(p, size) (((unsigned long) (p) + (size) - 1) & ~((size) - 1)) #endif /** Values that `indent' can return for exit status. * * `total_success' means no errors or warnings were found during a successful * invocation of the program. * * `invocation_error' is returned if an invocation problem (like an incorrect * option) prevents any formatting to occur. * * `indent_error' is returned if errors occur during formatting which * do not prevent completion of the formatting, but which appear to be * manifested by incorrect code (i.e, code which wouldn't compile). * * `indent_punt' is returned if formatting of a file is halted because of * an error with the file which prevents completion of formatting. If more * than one input file was specified, indent continues to the next file. * * `indent_fatal' is returned if a serious internal problem occurs and * the entire indent process is terminated, even if all specified files * have not been processed. */ typedef enum exit_values { total_success = 0, invocation_error = 1, indent_error = 2, indent_punt = 3, indent_fatal = 4, system_error = 5 } exit_values_ty; typedef unsigned char BOOLEAN; #define false 0 #define true 1 typedef struct file_buffer { char *name; unsigned long size; char *data; } file_buffer_ty; typedef enum bb_code { bb_none, bb_comma, bb_embedded_comment_start, bb_embedded_comment_end, bb_proc_call, bb_dec_ind, bb_unary_op, bb_binary_op, bb_before_boolean_binary_op, bb_after_boolean_binary_op, bb_after_equal_sign, bb_comparisation, bb_question, bb_colon, bb_label, bb_semicolon, bb_lbrace, bb_rbrace, bb_overloaded, bb_const_qualifier, bb_ident, bb_attribute, bb_struct_delim, bb_operator2, /* member selection (bb_struct_delim `.' or `->') */ bb_operator4, /* member selection (bb_struct_delim `.*' or `->*') */ bb_operator5, /* multiply, divide or modulo */ bb_operator6, /* add or subtract */ bb_doublecolon, bb_cast } bb_code_ty; #define DEFAULT_RIGHT_MARGIN 78 #define DEFAULT_RIGHT_COMMENT_MARGIN 78 #define DEFAULT_LABEL_INDENT -2 /* Name of input file. */ extern char *in_name; extern char *in_prog; /*!< pointer to the null-terminated input program */ /** Point to the position in the input program which we are currently looking * at. */ extern char *in_prog_pos; /** Point to the start of the current line. */ extern char *cur_line; /** Size of the input program, not including the NEWLINE EOS we add at the end */ extern unsigned long in_prog_size; extern char *labbuf; /*!< buffer for label */ extern char *s_lab; /*!< start of stored label */ extern char *e_lab; /*!< end of stored label */ extern char *l_lab; /*!< limit of label buffer */ extern char *codebuf; /*!< buffer for code section */ extern char *s_code; /*!< start of stored code */ extern char *s_code_corresponds_to; /*!< If set, start of corresponding * code in token buffer... */ extern char *e_code; /*!< end of stored code */ extern char *l_code; /*!< limit of code section */ extern char *combuf; /*!< buffer for comments */ extern char *s_com; /*!< start of stored comments */ extern char *e_com; /*!< end of stored comments */ extern char *l_com; /*!< limit of comment buffer */ extern char *buf_ptr; /*!< ptr to next character to be taken from * in_buffer */ extern char *buf_end; /*!< ptr to first after last char in in_buffer */ /** pointer to the token that lexi() has just found */ extern char *token; /** points to the first char after the end of token */ extern char *token_end; extern int squest; extern file_buffer_ty *current_input; /** Used to keep track of buffers. */ typedef struct buf { char *ptr; /*!< points to the start of the buffer */ char *end; /*!< points to the character beyond the last * one (e.g. is equal to ptr if the buffer is * (empty). */ int size; /*!< how many chars are currently allocated. */ int len; /*!< how many chars we're actually using. */ int start_column; /*!< corresponding column of first character * in the buffer. */ int column; /*!< Column we were in when we switched buffers. */ } buf_ty; /** Buffer in which to save a comment which occurs between an if(), while(), * etc., and the statement following it. Note: the fact that we point into * this buffer, and that we might realloc() it (via the need_chars macro) is * a bad thing (since when the buffer is realloc'd its address might change, * making any pointers into it point to garbage), but since the filling of * the buffer (hence the need_chars) and the using of the buffer (where * buf_ptr points into it) occur at different times, we can get away with it * (it would not be trivial to fix). */ extern buf_ty save_com; extern char *bp_save; /*!< saved value of buf_ptr when taking input from save_com */ extern char *be_save; /*!< similarly saved value of buf_end */ extern int pointer_as_binop; extern int n_real_blanklines; extern int prefix_blankline_requested; extern codes_ty prefix_blankline_requested_code; /*!< The code that caused the blank line to be requested */ extern int postfix_blankline_requested; extern codes_ty postfix_blankline_requested_code; /*!< The code that caused * the blank line to be * requested */ extern int break_comma; /*!< when true and not in parens, break after a * comma */ /** * This structure stores all the user options that come from (e.g.) * command line flags. */ typedef struct user_options_st { int verbose; /*!< when true, non-essential error messages are printed */ int use_tabs; /*!< does indent convert tabs to spaces or not */ int tabsize; /*!< The number of columns a tab character generates. */ int use_stdout; /*!< Where does output go. */ int space_sp_semicolon; /*!< If true, a space is inserted between if, while, or for, and a semicolon * for example while (*p++ == ' ') ; */ int swallow_optional_blanklines; int star_comment_cont; /*!< true if comment continuation lines should have stars at the beginning of each line. */ int struct_brace_indent; /*!< Indentation level to be used for a '{' directly following a struct, union or enum */ int space_after_while; /*!< Put a space after `while' */ int space_after_if; /*!< Put a space after `if' */ int space_after_for; /*!< Put a space after `for' */ int procnames_start_line; /*!< if true, the names of procedures being defined get placed in column 1 (ie. a * newline is placed between the type of the procedure and its name) */ int parentheses_space; /*!< If true, parentheses will look like: ( foo ) rather than (foo) */ int preserve_mtime; /*!< True when the modification time of the files should be preserved. */ int paren_indent; /*!< set to the indentation per open parens */ int proc_calls_space; /*!< If true, procedure calls look like: foo (bar) rather than foo(bar) */ int leave_preproc_space; /*!< if true, leave the spaces between '#' and preprocessor commands. */ int force_preproc_width; /*!< if this is >0, this becomes the preproc indent-level */ int lineup_to_parens; /*!< if true, continued code within parens will be lined up to the open paren */ int honour_newlines; /*!< True when positions at which we read a newline in the input file, should get * a high priority to break long lines at. */ int format_comments; /*!< If any comments are to be reformatted */ int format_col1_comments; /*!< If comments which start in column 1 are to be magically reformatted */ int extra_expression_indent; /*!< True if continuation lines from the expression part of "if(e)", * "while(e)", "for(e;e;e)" should be indented an extra tab stop so that * they don't conflict with the code that follows */ int ljust_decl; /*!< true if declarations should be left justified */ int cast_space; /*!< If true, casts look like: (char *) bar rather than (char *)bar */ int cuddle_else; /*!< true if else should cuddle up to '}' */ int cuddle_do_while; /*!< true if '}' should cuddle up to while in do loop */ int comment_delimiter_on_blankline; int blank_after_sizeof; /*!< true iff a blank should always be inserted after sizeof */ int break_function_decl_args; /*!< true if declarations should have args on new lines */ int break_function_decl_args_end; /*!< true if declarations should have * ")" after args on new lines */ int leave_comma; /*!< if true, never break declarations after commas */ int break_before_boolean_operator; /*!< True when we prefer to break a long line * before a '&&' or '||', instead of behind it. */ int blanklines_before_blockcomments; int blanklines_after_declarations; int blanklines_after_procs; int blanklines_after_declarations_at_proctop; /*!< This is vaguely similar to blanklines_after_declarations except that * it only applies to the first set of declarations in a procedure (just after * the first '{') and it causes a blank line to be generated even * if there are no declarations */ int blanklines_around_conditional_compilation; int comment_max_col; int max_col; /*!< the maximum allowable line length */ int label_offset; /* offset of labels */ int ind_size; /* !< The size of one indentation level in spaces. */ int indent_parameters; /*!< Number of spaces to indent parameters. */ int decl_indent; /*!< column to indent declared identifiers to */ int unindent_displace; /*!< comments not to the right of code will be * placed this many indentation levels to the * left of code */ int else_endif_col; /*!< The column in which comments to the right of # else and # endif should start. */ int case_indent; /*!< The distance to indent case labels from the switch statement */ int continuation_indent; /*!< set to the indentation between the edge of code and continuation lines in spaces */ int decl_com_ind; /*!< the column in which comments after declarations should be put */ int case_brace_indent; /*!< Indentation level to be used for a '{' * directly following a case label. */ int c_plus_plus; /*!< True if we're handling C++ code. */ int com_ind; /*!< the column in which comments to the right of code should start */ int braces_on_struct_decl_line; /*!< when true, brace should be on same line as the struct declaration */ int braces_on_func_def_line; /*!< when true, brace should be on same line as the function definition */ int btype_2; /* when true, brace should be on same line as if, while, etc */ int brace_indent; /*!< number of spaces to indent braces from the suround if, while, etc. in -bl * (bype_2 == 0) code */ int expect_output_file; /*!< Means "-o" was specified. */ } user_options_ty; extern user_options_ty settings; /** True if there is an embedded comment on this code line */ extern int embedded_comment_on_line; extern int else_or_endif; extern int di_stack_alloc; extern int *di_stack; extern int else_or_endif; /*!< True if a # else or # endif has been encountered. */ extern int code_lines; /*!< count of lines with code */ extern int out_lines; /*!< the number of lines written, set by * dump_line */ extern int com_lines; /*!< the number of lines with comments, set by * dump_line */ extern BOOLEAN had_eof; /*!< set to true when input is exhausted */ extern int line_no; /*!< the current input line number. */ extern int paren_target; extern int use_stdinout; /*!< Nonzero if we should use standard input/output when files are not * explicitly specified. */ /** * This structure contains information relating to the state of parsing the * code. The difference is that the state is saved on # if and restored on * # else. */ typedef struct parser_state { struct parser_state * next; codes_ty last_token; /** This is the parsers stack, and the current allocated size. */ codes_ty * p_stack; int p_stack_size; /** This stack stores indentation levels * Currently allocated size is stored in p_stack_size. */ int * il; /** If the last token was an ident and is a reserved word, * remember the type. */ rwcodes_ty last_rw; /** also, remember its depth in parentheses */ int last_rw_depth; /** Used to store case stmt indentation levels. * Currently allocated size is stored in p_stack_size. */ int *cstk; /** Pointer to the top of stack of the p_stack, il and cstk arrays. */ int tos; int box_com; /*!< set to true when we are in a * "boxed" comment. In that case, the * first non-blank char should be * lined up with the / in the comment * closing delimiter */ int cast_mask; /*!< indicates which close parens close off * casts */ /** A bit for each paren level, set if the open paren was in a context which indicates that this pair of parentheses is not a cast. */ int noncast_mask; int sizeof_mask; /*!< indicates which close parens close off * sizeof''s */ int block_init; /*!< set to 1 if inside a block initialization * set to 2 if inside an enum declaration */ int block_init_level; /*!< The level of brace nesting in an * initialization (0 in an enum decl) */ int last_nl; /*!< this is true if the last thing scanned was * a newline */ int last_saw_nl; /*!< this is true if the last non white space * scanned was a newline */ int saw_double_colon; /*!< set when we see a ::, reset at first semi- * colon or left brace */ int broken_at_non_nl; /*!< true when a line was broken at a place * where there was no newline in the input file */ int in_or_st; /*!< Will be true iff there has been a * declarator (e.g. int or char) and no left * paren since the last semicolon. When true, * a '{' is starting a structure definition * or an initialization list */ int col_1; /*!< set to true if the last token started in * column 1 */ int com_col; /*!< this is the column in which the current * coment should start */ int dec_nest; /*!< current nesting level for structure or * init */ int decl_on_line; /*!< set to true if this line of code has part * of a declaration on it */ int i_l_follow; /*!< the level in spaces to which ind_level * should be set after the current line is * printed */ BOOLEAN in_decl; /*!< set to true when we are in a declaration * statement. The processing of braces is then * slightly different */ int in_stmt; /*!< set to 1 while in a stmt */ int in_parameter_declaration; int ind_level; /*!< the current indentation level in spaces */ int ind_stmt; /*!< set to 1 if next line should have an extra * indentation level because we are in the * middle of a stmt */ int last_u_d; /*!< set to true after scanning a token which * forces a following operator to be unary */ int p_l_follow; /*!< used to remember how to indent following * statement */ int paren_level; /*!< parenthesization level. used to indent * within stmts */ int paren_depth; /*!< Depth of paren nesting anywhere. */ /** Column positions of paren at each level. If positive, it contains just * the number of characters of code on the line up to and including the * right parenthesis character. If negative, it contains the opposite of * the actual level of indentation in characters (that is, the indentation * of the line has been added to the number of characters and the sign has * been reversed to indicate that this has been done). */ short *paren_indents; /*!< column positions of each paren */ int paren_indents_size; /*!< Currently allocated size. */ int pcase; /*!< set to 1 if the current line label is a * case. It is printed differently from a * regular label */ int search_brace; /*!< set to true by parse when it is necessary * to buffer up all info up to the start of a * stmt after an if, while, etc */ int use_ff; /*!< set to one if the current line should be * terminated with a form feed */ int want_blank; /*!< set to true when the following token * should be prefixed by a blank. (Said * prefixing is ignored in some cases.) */ bb_code_ty can_break; /*!< set when a break is ok before the following * token (is automatically implied by * `want_blank'. */ int its_a_keyword; int sizeof_keyword; char *procname; /*!< The name of the current procedure */ char *procname_end; /*!< One char past the last one in procname */ char *classname; /*!< The name of the current C++ class */ char *classname_end; /*!< One char past the last one in classname */ int just_saw_decl; int matching_brace_on_same_line; /*!< Set to a value >= 0 if the the current '}' has a matching '{' on the same input line */ } parser_state_ty; /** All manipulations of the parser state occur at the top of stack (tos). A * stack is kept for conditional compilation (unrelated to the p_stack, il, & * cstk stacks)--it is implemented as a linked list via the next field. */ extern parser_state_ty *parser_state_tos; #endif /* INDENT_INDENT_H */ indent-2.2.11/src/output.h0000644000177400010010000000420410775646104012304 00000000000000/** \file * */ #ifndef OUTPUT_H #define OUTPUT_H #include "sys.h" /* for RCSTAG_H */ RCSTAG_H (output, "$Id$"); #include #include "indent.h" typedef struct buf_break_st { struct buf_break_st *next; /*!< The first possible break point to the right, if any. */ struct buf_break_st *prev; /*!< The first possible break point to the left, if any. */ int offset; /*!< The break point: the first character in the buffer that will * not be put on this line any more. */ char *corresponds_to; /*!< If ptr equals s_code and this equals s_code_corresponds_to, * then parser_state_toc->procname is valid. */ int target_col; /*!< Indentation column if we would break the line here. */ int first_level; int level; /*!< Number of open '(' and '['. */ int col; /*!< The number of columns left of the break point, before the break. */ int priority_code_length; /*!< Used to calculate the priority of this break point: */ bb_code_ty priority_code; int priority_newline; /*!< Set when in the input file there was a newline at this place. */ int priority; } buf_break_st_ty; extern buf_break_st_ty * buf_break; extern int buf_break_used; extern int prev_target_col_break; extern void clear_buf_break_list ( BOOLEAN * pbreak_line); extern int compute_code_target ( int paren_targ); extern int compute_label_target (void); extern int count_columns ( int column, char *bp, int stop_char); extern void set_buf_break ( bb_code_ty code, int paren_targ); extern void dump_line ( int force_nl, int * paren_targ, BOOLEAN * break_line); extern void flush_output(void); extern void open_output( const char * filename, const char * mode); extern void reopen_output_trunc( const char * filename); extern void close_output( struct stat * file_stats, const char * filename); extern void inhibit_indenting( BOOLEAN flag); extern int output_line_length (void); #endif indent-2.2.11/src/handletoken.h0000644000177400010010000000176311015101464013226 00000000000000 #ifndef HANDLETOKEN_H #define HANDLETOKEN_H #include extern void handle_the_token( const codes_ty type_code, BOOLEAN * scase, BOOLEAN * force_nl, BOOLEAN * sp_sw, BOOLEAN * flushed_nl, codes_ty * hd_type, int * dec_ind, BOOLEAN * last_token_ends_sp, exit_values_ty * file_exit_value, const bb_code_ty can_break, BOOLEAN * last_else, BOOLEAN is_procname_definition, BOOLEAN * pbreak_line); extern void check_code_size(void); /** * */ static void INLINE need_chars ( buf_ty * bp, int needed) { int current_size = (bp->end - bp->ptr); if ((current_size + needed) >= bp->size) { bp->size = ROUND_UP (current_size + needed, 1024); bp->ptr = xrealloc (bp->ptr, bp->size); if (bp->ptr == NULL) { fatal (_("Ran out of memory"), 0); } bp->end = bp->ptr + current_size; } } #endif indent-2.2.11/src/backup.c0000644000177400010010000003252511014041536012174 00000000000000/** \file * Copyright (c) 1993,1994, Joseph Arceneaux. All rights reserved. * Copyright (c) 1994 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. * All rights reserved.
* * Copyright (c) 1980, 1993 * The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois.
* Copyright (c) 1985 Sun Microsystems, Inc. * All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * This software 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. */ /* GNU/Emacs style backups -- * This behaviour is controlled by two environment variables, * VERSION_CONTROL and SIMPLE_BACKUP_SUFFIX. * * VERSION_CONTROL determines what kinds of backups are made. If it's * value is "numbered", then the first modification of some file * "eraserhead.c" will yield a backup file "eraserhead.c.~1~", the * second modification will yield "eraserhead.c.~2~", and so on. It * does not matter if the version numbers are not a sequence; the next * version will be one greater than the highest in that directory. * * If the value of VERSION_CONTROL is "numbered_existing", then such * numbered backups will be made if there are already numbered backup * versions of the file. Otherwise, the backup name will be that of * the original file with "~" (tilde) appended. E.g., "eraserhead.c~". * * If the value of VERSION_CONTROL is "simple", then the backup name * will be that of the original file with "~" appended, regardless of * whether or not there exist numbered versions in the directory. * * For simple backups, the value of SIMPLE_BACKUP_SUFFIX will be used * rather than "~" if it is set. * * If VERSION_CONTROL is unset, "numbered_existing" is assumed. For * Emacs lovers, "nil" is equivalent to "numbered_existing" and "t" is * equivalent to "numbered". * * Finally, if VERSION_CONTROL is "none" or "never", backups are not * made. I suggest you avoid this behaviour. * * Added, october 1999 (by Chris F.A. Johnson): * * If VERSION_WIDTH is set, then it controls zero padding of a numbered * suffix. * * Written by jla, based on code from djm (see `patch') */ #include "sys.h" #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef PRESERVE_MTIME #include #ifdef HAVE_UTIME_H #include #elif defined(HAVE_SYS_UTIME_H) #include #endif #endif #include #if defined (_WIN32) && !defined (__CYGWIN__) #include #else #include #endif #include #ifndef isascii #define ISDIGIT(c) (isdigit ((unsigned char) (c))) #else #define ISDIGIT(c) (isascii (c) && isdigit (c)) #endif #include #ifdef HAVE_DIRENT_H #include #define NAMLEN(dirent) strlen((dirent)->d_name) #else #define dirent direct #define NAMLEN(dirent) (dirent)->d_namlen #ifdef HAVE_SYS_NDIR_H #include #endif #ifdef HAVE_SYS_DIR_H #include #endif #ifdef HAVE_NDIR_H #include #endif #if !defined(HAVE_SYS_NDIR_H) && !defined(HAVE_SYS_DIR_H) && !defined(HAVE_NDIR_H) #define NODIR 1 #endif #endif #include "indent.h" #include "globs.h" #include "code_io.h" #include "backup.h" RCSTAG_CC ("$Id$"); #ifndef NODIR #if defined (_POSIX_VERSION) /* Might be defined in unistd.h. */ /* POSIX does not require that the d_ino field be present, and some * systems do not provide it. */ #define REAL_DIR_ENTRY(dp) 1 #else #define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0) #endif #else /* NODIR */ #define generate_backup_filename(v,f) simple_backup_name((f)) #endif /* NODIR */ #ifndef BACKUP_SUFFIX_STR #define BACKUP_SUFFIX_STR "~" #endif #ifndef BACKUP_SUFFIX_CHAR #define BACKUP_SUFFIX_CHAR '~' #endif #ifndef BACKUP_SUFFIX_FORMAT #define BACKUP_SUFFIX_FORMAT "%s.~%0*d~" #endif /** * Default backup file suffix to use */ static char * simple_backup_suffix = BACKUP_SUFFIX_STR; /* What kinds of backup files to make -- see * table `version_control_values' below. */ backup_mode_ty version_control = unknown; int version_width = 1; /** * Construct a simple backup name for PATHNAME by appending * the value of `simple_backup_suffix'. */ static char * simple_backup_name ( char *pathname) { char *backup_name; backup_name = xmalloc (strlen (pathname) + strlen (simple_backup_suffix) + 2); sprintf (backup_name, "%s%s", pathname, simple_backup_suffix); return backup_name; } #ifndef NODIR /** * If DIRENTRY is a numbered backup version of file BASE, return * that number. BASE_LENGTH is the string length of BASE. */ static int version_number( char * base, char * direntry, int base_length) { int version; char * p = NULL; version = 0; if (!strncmp (base, direntry, base_length) && ISDIGIT (direntry[base_length + 2])) { for (p = &direntry[base_length + 2]; ISDIGIT (*p); ++p) { version = version * 10 + *p - '0'; } if (p[0] != BACKUP_SUFFIX_CHAR || p[1]) { version = 0; } } return version; } /** * Return the highest version of file FILENAME in directory * DIRNAME. Return 0 if there are no numbered versions. */ static int highest_version ( char * filename, char * dirname) { DIR * dirp = opendir (dirname); struct dirent * dp = NULL; int highestVersion; if (!dirp) { highestVersion = 0; } else { int this_version; int file_name_length = strlen(filename); highestVersion = 0; while ((dp = readdir (dirp)) != 0) { if (!REAL_DIR_ENTRY (dp) || NAMLEN (dp) <= file_name_length + 2) { continue; } this_version = version_number (filename, dp->d_name, file_name_length); if (this_version > highestVersion) { highestVersion = this_version; } } closedir (dirp); } return highestVersion; } /** * Return the highest version number for file PATHNAME. If there * are no backups, or only a simple backup, return 0. */ static int max_version ( char * pathname) { char * p; char * filename; int pathlen = strlen (pathname); int version; p = pathname + pathlen - 1; while ((p > pathname) && (*p != '/')) { p--; } if (*p == '/') { int dirlen = p - pathname; char *dirname; filename = p + 1; dirname = xmalloc (dirlen + 1); strncpy (dirname, pathname, (dirlen)); dirname[dirlen] = '\0'; version = highest_version (filename, dirname); free (dirname); } else { filename = pathname; version = highest_version (filename, "."); } return version; } /** * Generate a backup filename for PATHNAME, dependent on the * value of VERSION_CONTROL. */ static char * generate_backup_filename ( backup_mode_ty versionControl, char * pathname) { int last_numbered_version; char *backup_name; if (versionControl == none) { backup_name = NULL; } else { if (versionControl == simple) { backup_name = simple_backup_name (pathname); } else { last_numbered_version = max_version (pathname); if ((versionControl == numbered_existing) && (last_numbered_version == 0)) { backup_name = simple_backup_name (pathname); } else { last_numbered_version++; backup_name = xmalloc (strlen (pathname) + 16); if (backup_name) { sprintf (backup_name, BACKUP_SUFFIX_FORMAT, pathname, version_width, (int) last_numbered_version); } } } } return backup_name; } #endif /* !NODIR */ static version_control_values_ty values[] = { {none, "never"}, /*!< Don't make backups. */ {none, "none"}, /*!< Ditto */ {simple, "simple"}, /*!< Only simple backups */ {numbered_existing, "existing"}, /*!< Numbered if they already exist */ {numbered_existing, "nil"}, /*!< Ditto */ {numbered, "numbered"}, /*!< Numbered backups */ {numbered, "t"}, /*!< Ditto */ {unknown, 0} /*!< Initial, undefined value. */ }; /** * Determine the value of `version_control' by looking in the * environment variable "VERSION_CONTROL". Defaults to * numbered_existing. */ backup_mode_ty version_control_value(void) { char * version = getenv("VERSION_CONTROL"); version_control_values_ty * v; backup_mode_ty ret = unknown; if ((version == NULL) || (*version == 0)) { ret = numbered_existing; } else { v = &values[0]; while (v->name) { if (strcmp(version, v->name) == 0) { ret = v->value; break; } else { v++; } } } return ret; } /** * Initialize information used in determining backup filenames. */ static void set_version_width(void) { char *v = getenv ("VERSION_WIDTH"); if (v && ISDIGIT (*v)) { version_width = atoi (v); } if (version_width > 16) { version_width = 16; } } /** * */ void initialize_backups(void) { char *v = getenv ("SIMPLE_BACKUP_SUFFIX"); if (v && *v) { simple_backup_suffix = v; } #ifdef NODIR version_control = simple; #else /* !NODIR */ version_control = version_control_value (); if (version_control == unknown) { fprintf (stderr, _("indent: Strange version-control value\n")); fprintf (stderr, _("indent: Using numbered-existing\n")); version_control = numbered_existing; } #endif /* !NODIR */ set_version_width (); } /** * Make a backup copy of FILE, taking into account version-control. * See the description at the beginning of the file for details. */ void make_backup( file_buffer_ty * file, const struct stat * file_stats) { FILE * bf; char * backup_filename; unsigned int size; if (version_control == none) { } else { backup_filename = generate_backup_filename (version_control, file->name); if (!backup_filename) { fprintf (stderr, _("indent: Can't make backup filename of %s\n"), file->name); exit (system_error); } bf = fopen (backup_filename, "w"); if (!bf) { fatal (_("Can't open backup file %s"), backup_filename); } size = fwrite (file->data, file->size, 1, bf); if (size != 1) { fatal (_("Can't write to backup file %s"), backup_filename); } fclose (bf); #ifdef PRESERVE_MTIME { struct utimbuf buf; buf.actime = time (NULL); buf.modtime = file_stats->st_mtime; if (utime (backup_filename, &buf) != 0) { WARNING (_("Can't preserve modification time on backup file %s"), backup_filename, 0); } } #endif free (backup_filename); } } indent-2.2.11/src/handletoken.c0000644000177400010010000020050711145775212013232 00000000000000/** \file * Copyright (c) 1999, 2000 Carlo Wood. All rights reserved.
* Copyright (c) 1994, 1996, 1997 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. All rights reserved.
* * Copyright (c) 1980 The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. * Copyright (c) 1985 Sun Microsystems, Inc. * All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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. * * Updates: * - 2002-08-05: Matthias and Eric Lloyd * Added support for -brf to place function opening brace after function * declaration. * - 28 Sep 2003 Erik de Castro Lopo * Fixed Bug#212320: --blank-lines-after-proceduresdoes not work * - 28 Sep 2003 Erik de Castro Lopo * Fixed Bug#206785: indent segfaults on the attached file * - 28 Sep 2003 Geoffrey Lee * Fixed Bug#205692: indent: [patch] fix garble shown in locale(fwd) * - 2008-03-08 DI Re-baselined on the more acceptable (license-wise) OpenBSD release 3.4. */ #include "sys.h" #include #include #include #include "indent.h" #include "backup.h" #include "code_io.h" #include "globs.h" #include "parse.h" #include "comments.h" #include "args.h" #include "output.h" #include "handletoken.h" RCSTAG_CC ("$GNU$"); /** * */ extern void check_code_size(void) { if (e_code >= l_code) { int nsize = l_code - s_code + 400; codebuf = (char *) xrealloc (codebuf, nsize); e_code = codebuf + (e_code - s_code) + 1; l_code = codebuf + nsize - 5; s_code = codebuf + 1; } } /** * */ static void check_lab_size(void) { if (e_lab >= l_lab) { int nsize = l_lab - s_lab + 400; labbuf = (char *) xrealloc (labbuf, nsize); e_lab = labbuf + (e_lab - s_lab) + 1; l_lab = labbuf + nsize - 5; s_lab = labbuf + 1; } } /** * */ static void copy_id( const codes_ty type_code, BOOLEAN * force_nl, exit_values_ty * file_exit_value, const bb_code_ty can_break) { char * t_ptr; if (parser_state_tos->want_blank) { set_buf_break (bb_ident, paren_target); *(e_code++) = ' '; } else if (can_break) { set_buf_break (can_break, paren_target); } else { } if (s_code == e_code) { s_code_corresponds_to = token; } for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size(); *(e_code++) = *t_ptr; } *e_code = '\0'; /* null terminate code sect */ parser_state_tos->want_blank = true; /* Handle the options -nsaf, -nsai and -nsaw */ if ((type_code == sp_paren) && ((!settings.space_after_if && (*token == 'i')) || (!settings.space_after_for && (*token == 'f')) || (!settings.space_after_while && (*token == 'w')))) { parser_state_tos->want_blank = false; } /* If the token is one of the GNU gettext macro's '_' or 'N_' * then we don't want a blank */ if ((((token_end - token) == 1) && (*token == '_')) || (((token_end - token) == 2) && (*token == 'N') && (token[1] == '_'))) { parser_state_tos->want_blank = false; } /* If the token is va_dcl, it appears without a semicolon, so we * need to pretend that one was there. */ if (((token_end - token) == 6) && (strncmp (token, "va_dcl", 6) == 0)) { parser_state_tos->in_or_st = 0; parser_state_tos->just_saw_decl--; parser_state_tos->in_decl = false; do { if (parse (semicolon) != total_success) { *file_exit_value = indent_error; } } while(0); *force_nl = true; } } /** * */ static void handle_token_form_feed( BOOLEAN * pbreak_line) { parser_state_tos->use_ff = true; /* a form feed is treated * much like a newline */ dump_line (true, &paren_target, pbreak_line); parser_state_tos->want_blank = false; } /** * 2002-06-13 D.Ingamells Reset force_nl if the line is dumped. */ static void handle_token_newline( BOOLEAN * force_nl, BOOLEAN * pbreak_line) { if (s_lab != e_lab && *s_lab == '#') { dump_line (true, &paren_target, pbreak_line); if (s_code == e_code) { parser_state_tos->want_blank = false; } *force_nl = false; } else { if ( ( (parser_state_tos->last_token != comma) || !settings.leave_comma || !break_comma || (parser_state_tos->p_l_follow > 0) || parser_state_tos->block_init || (s_com != e_com)) && ( ( (parser_state_tos->last_token != rbrace) || !(settings.braces_on_struct_decl_line && parser_state_tos->in_decl)))) { /* Attempt to detect the newline before a procedure name, * and if e.g., K&R style, leave the procedure on the * same line as the type. */ if (!settings.procnames_start_line && (s_lab == e_lab) && (parser_state_tos->last_token != lparen) && (parser_state_tos->last_token != semicolon) && (parser_state_tos->last_token != comma) && (parser_state_tos->last_rw == rw_decl) && (parser_state_tos->last_rw_depth == 0) && (!parser_state_tos->block_init) && (parser_state_tos->in_decl)) { /* Put a space between the type and the procedure name, * unless it was a pointer type and the user doesn't * want such spaces after '*'. */ if (!((e_code > s_code) && (e_code[-1] == '*'))) { parser_state_tos->want_blank = true; } } if (!parser_state_tos->in_stmt || (s_com != e_com) || embedded_comment_on_line) { dump_line (true, &paren_target, pbreak_line); if (s_code == e_code) { parser_state_tos->want_blank = false; } *force_nl = false; } } } /* If we were on the line with a #else or a #endif, we aren't * anymore. */ else_or_endif = false; ++line_no; /* keep track of input line number */ } /** * */ static void handle_token_lparen( BOOLEAN * force_nl, BOOLEAN * sp_sw, int * dec_ind, BOOLEAN * pbreak_line) { /* Braces in initializer lists should be put on new lines. This is * necessary so that -gnu does not cause things like char * *this_is_a_string_array[] = { "foo", "this_string_does_not_fit", * "nor_does_this_rather_long_string" } which is what happens * because we are trying to line the strings up with the * parentheses, and those that are too long are moved to the right * an ugly amount. * * However, if the current line is empty, the left brace is * already on a new line, so don't molest it. */ if ((*token == '{') && ((s_code != e_code) || (s_com != e_com) || (s_lab != e_lab))) { dump_line (true, &paren_target, pbreak_line); /* Do not put a space before the '{'. */ parser_state_tos->want_blank = false; } /* Count parens so we know how deep we are. */ ++parser_state_tos->p_l_follow; if (parser_state_tos->p_l_follow >= parser_state_tos->paren_indents_size) { parser_state_tos->paren_indents_size *= 2; parser_state_tos->paren_indents = (short *) xrealloc ((char *) parser_state_tos->paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } parser_state_tos->paren_depth++; if (parser_state_tos->want_blank && (*token != '[') && ( (parser_state_tos->last_token != ident) || settings.proc_calls_space || (parser_state_tos->its_a_keyword && (!parser_state_tos->sizeof_keyword || settings.blank_after_sizeof)))) { set_buf_break (bb_proc_call, paren_target); *(e_code++) = ' '; *e_code = '\0'; /* null terminate code sect */ } else { set_buf_break (bb_proc_call, paren_target); } if (parser_state_tos->in_decl && !parser_state_tos->block_init) { if ((*token != '[') && !buf_break_used) { while ((e_code - s_code) < *dec_ind) { check_code_size(); set_buf_break (bb_dec_ind, paren_target); *(e_code++) = ' '; } *(e_code++) = token[0]; parser_state_tos->ind_stmt = false; } else { *(e_code++) = token[0]; } } else { *(e_code++) = token[0]; } if (settings.parentheses_space && *token != '[') { *(e_code++) = ' '; } parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] = e_code - s_code; if (*sp_sw && (parser_state_tos->p_l_follow == 1) && settings.extra_expression_indent && (parser_state_tos->paren_indents[0] < 2 * settings.ind_size)) { parser_state_tos->paren_indents[0] = 2 * settings.ind_size; } parser_state_tos->want_blank = false; if ((parser_state_tos->in_or_st == 1) && *token == '(') { /* this is a kludge to make sure that declarations will be * correctly aligned if proc decl has an explicit type on it, i.e. * "int a(x) {..." */ parse_lparen_in_decl (); /* Turn off flag for structure decl or initialization. */ parser_state_tos->in_or_st = 0; } /* For declarations, if user wants all fn decls broken, force that * now. */ if ((*token == '(') && settings.break_function_decl_args && parser_state_tos->in_stmt && parser_state_tos->in_decl && (parser_state_tos->paren_depth == 1)) { dump_line(true, &paren_target, pbreak_line); *force_nl = false; paren_target = parser_state_tos->paren_depth * settings.ind_size + 1; parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] = -paren_target; } if (parser_state_tos->sizeof_keyword) { parser_state_tos->sizeof_mask |= 1 << parser_state_tos->p_l_follow; } /* The '(' that starts a cast can never be preceded by an * indentifier or decl. */ if ((parser_state_tos->last_token == decl) || ((parser_state_tos->last_token == ident) && (parser_state_tos->last_rw != rw_return))) { parser_state_tos->noncast_mask |= 1 << parser_state_tos->p_l_follow; } else { parser_state_tos->noncast_mask &= ~(1 << parser_state_tos->p_l_follow); } } /** * */ static void handle_token_rparen( BOOLEAN * force_nl, BOOLEAN * sp_sw, codes_ty * hd_type, BOOLEAN * last_token_ends_sp, exit_values_ty * file_exit_value, BOOLEAN * pbreak_line) { parser_state_tos->paren_depth--; #if 1 /* For declarations, if user wants close of fn decls broken, force that * now. */ if ((*token == ')') && settings.break_function_decl_args_end && !parser_state_tos->in_or_st && parser_state_tos->in_stmt && parser_state_tos->in_decl && (parser_state_tos->paren_depth == 0)) { if ((s_code != e_code) || (s_lab != e_lab) || (s_com != e_com)) { dump_line(true, &paren_target, pbreak_line); } paren_target = parser_state_tos->paren_depth * settings.ind_size; parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] = paren_target; parser_state_tos->ind_stmt = 0; } #endif if (parser_state_tos-> cast_mask & (1 << parser_state_tos-> p_l_follow) & ~parser_state_tos->sizeof_mask) { parser_state_tos->last_u_d = true; parser_state_tos->cast_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (!parser_state_tos->cast_mask && settings.cast_space) { parser_state_tos->want_blank = true; } else { parser_state_tos->want_blank = false; parser_state_tos->can_break = bb_cast; } } else if (parser_state_tos->in_decl && !parser_state_tos->block_init && (parser_state_tos->paren_depth == 0)) { parser_state_tos->want_blank = true; } else { /* what ? */ } parser_state_tos->sizeof_mask &= (1 << parser_state_tos->p_l_follow) - 1; if (--parser_state_tos->p_l_follow < 0) { parser_state_tos->p_l_follow = 0; WARNING (_("Extra %c"), (unsigned long) *((unsigned char *) token), 0); } /* if the paren starts the line, then indent it */ if (e_code == s_code) { int level = parser_state_tos->p_l_follow; parser_state_tos->paren_level = level; if (level > 0) { paren_target = -parser_state_tos->paren_indents[level - 1]; } else { paren_target = 0; } } if (settings.parentheses_space && *token != ']') { *(e_code++) = ' '; } *(e_code++) = token[0]; /* check for end of if (...), or some such */ if (*sp_sw && (parser_state_tos->p_l_follow == 0)) { /* Indicate that we have just left the parenthesized expression * of a while, if, or for, unless we are getting out of the * parenthesized expression of the while of a do-while loop. * (do-while is different because a semicolon immediately * following this will not indicate a null loop body). */ if (parser_state_tos->p_stack[parser_state_tos->tos] != dohead) { *last_token_ends_sp = 2; } *sp_sw = false; *force_nl = true; /* must force newline after if */ parser_state_tos->last_u_d = true; /* inform lexi that a * following operator is * unary */ parser_state_tos->in_stmt = false; /* dont use stmt * continuation * indentation */ if (parse (*hd_type) != total_success) { *file_exit_value = indent_error; } } /* this should ensure that constructs such as main(){...} and * int[]{...} have their braces put in the right place */ parser_state_tos->search_brace = settings.btype_2; } /** * */ static void handle_token_unary_op( int * dec_ind, const bb_code_ty can_break) { char * t_ptr; if (parser_state_tos->want_blank) { set_buf_break (bb_unary_op, paren_target); *(e_code++) = ' '; *e_code = '\0'; /* null terminate code sect */ } else if (can_break) { set_buf_break (can_break, paren_target); } else { /* what ? */ } { char *res = token; char *res_end = token_end; /* if this is a unary op in a declaration, we should * indent this token */ if ((parser_state_tos->paren_depth == 0) && parser_state_tos->in_decl && !buf_break_used && !parser_state_tos->block_init) { while ((e_code - s_code) < (*dec_ind - (token_end - token))) { check_code_size(); set_buf_break (bb_dec_ind, paren_target); *(e_code++) = ' '; } parser_state_tos->ind_stmt = false; } else { /* avoid "- --a" becoming "---a" */ if ((parser_state_tos->last_token == unary_op) && (e_code > s_code) && (*(e_code - 1) == *res)) { *(e_code++) = ' '; } } for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size(); *(e_code++) = *t_ptr; } *e_code = '\0'; /* null terminate code sect */ } parser_state_tos->want_blank = false; } /** * */ static void handle_token_binary_op( const bb_code_ty can_break) { char * t_ptr; if (parser_state_tos->want_blank || (e_code > s_code && *e_code != ' ')) { set_buf_break (bb_binary_op, paren_target); *(e_code++) = ' '; *e_code = '\0'; /* null terminate code sect */ } else if (can_break) { set_buf_break (can_break, paren_target); } else { /* what ? */ } { char *res = token; char *res_end = token_end; for (t_ptr = res; t_ptr < res_end; ++t_ptr) { check_code_size(); *(e_code++) = *t_ptr; /* move the operator */ } } #if 1 if (*token == '=') { parser_state_tos->in_decl = false; } #endif parser_state_tos->want_blank = true; } /** * */ static void handle_token_postop(void) { *(e_code++) = token[0]; *(e_code++) = token[1]; parser_state_tos->want_blank = true; } /** * */ static void handle_token_question( const bb_code_ty can_break) { squest++; /* this will be used when a later colon * appears so we can distinguish the * ?: construct */ if (parser_state_tos->want_blank) { set_buf_break (bb_question, paren_target); *(e_code++) = ' '; } else if (can_break) { set_buf_break (can_break, paren_target); } else { /* what ? */ } *(e_code++) = '?'; parser_state_tos->want_blank = true; *e_code = '\0'; /* null terminate code sect */ } /** * */ static void handle_token_casestmt( BOOLEAN * scase, exit_values_ty * file_exit_value) { *scase = true; /* so we can process the later colon * properly */ do { if (parse (casestmt) != total_success) { *file_exit_value = indent_error; } } while(0); /* Let parser know about it */ } /** * */ static void handle_token_colon( BOOLEAN * scase, BOOLEAN * force_nl, int * dec_ind, const bb_code_ty can_break, BOOLEAN * pbreak_line) { char * t_ptr; if (squest > 0) { /* it is part of the ? : construct */ --squest; if (parser_state_tos->want_blank) { set_buf_break (bb_colon, paren_target); *(e_code++) = ' '; } else if (can_break) { set_buf_break (can_break, paren_target); } else { /* what ? */ } *(e_code++) = ':'; *e_code = '\0'; /* null terminate code sect */ parser_state_tos->want_blank = true; } else { /* __ e_code * | * " private:\n" C++, treat as label. * ^^^ ^ * | | * | `- buf_ptr (in different buffer though!) * `- s_code * * or * * " unsigned int private:4\n" C/C++, treat as bits. */ if (parser_state_tos->in_decl) { if (!(((e_code - s_code > 6) && !strncmp (&buf_ptr[-8], "private:", 8)) && !isdigit (*buf_ptr)) && !(((e_code - s_code > 8) && !strncmp (&buf_ptr[-10], "protected:", 10)) && !isdigit (*buf_ptr)) && !(((e_code - s_code > 5) && !strncmp (&buf_ptr[-7], "public:", 7)) && !isdigit (*buf_ptr))) { *(e_code++) = ':'; parser_state_tos->want_blank = false; return; } else if (*s_code == ' ') { /* * It is possible that dec_ind spaces have been inserted before * the `public:' etc. label because indent thinks it's of the * type: */ /* * Only now we see the '4' isn't there. * Remove those spaces: */ char *p1 = s_code; char *p2 = s_code + *dec_ind; while (p2 < e_code) { *p1++ = *p2++; } e_code -= *dec_ind; *e_code = '\0'; } else { /* what ? */ } } parser_state_tos->in_stmt = false; /* seeing a label does not * imply we are in a stmt */ for (t_ptr = s_code; *t_ptr; ++t_ptr) { check_lab_size(); *e_lab++ = *t_ptr; /* turn everything so far into a label */ } e_code = s_code; clear_buf_break_list (pbreak_line); /* This is bullshit for C code, because * normally a label doesn't have breakpoints * at all of course. But in the case of * wrong code, not clearing the list can make * indent core dump. */ *e_lab++ = ':'; set_buf_break (bb_label, paren_target); *e_lab++ = ' '; *e_lab = '\0'; /* parser_state_tos->pcas e will be used by dump_line to decide * how to indent the label. force_nl will force a case n: to be * on a line by itself */ *force_nl = parser_state_tos->pcase = *scase; *scase = false; parser_state_tos->want_blank = false; } } /** * */ static void handle_token_doublecolon(void) { *(e_code++) = ':'; *(e_code++) = ':'; parser_state_tos->want_blank = false; parser_state_tos->can_break = bb_doublecolon; parser_state_tos->last_u_d = true; parser_state_tos->saw_double_colon = true; } /** * */ static void handle_token_semicolon( BOOLEAN * scase, BOOLEAN * force_nl, BOOLEAN * sp_sw, int * dec_ind, BOOLEAN * last_token_ends_sp, exit_values_ty * file_exit_value) { parser_state_tos->in_or_st = 0; parser_state_tos->saw_double_colon = false; *scase = false; squest = 0; /* The following code doesn't seem to do much good. Just because * we've found something like extern int foo(); or int (*foo)(); * doesn't mean we are out of a declaration. Now if it was serving * some purpose we'll have to address that.... if * (parser_state_tos->last_token == rparen) * parser_state_tos->in_parameter_declaration = 0; */ parser_state_tos->cast_mask = 0; parser_state_tos->sizeof_mask = 0; parser_state_tos->block_init = 0; parser_state_tos->block_init_level = 0; parser_state_tos->just_saw_decl--; if (parser_state_tos->in_decl && (s_code == e_code) && !buf_break_used && !parser_state_tos->block_init) { while ((e_code - s_code) < (*dec_ind - 1)) { check_code_size(); set_buf_break (bb_dec_ind, paren_target); *(e_code++) = ' '; } parser_state_tos->ind_stmt = false; } *e_code = '\0'; /* null terminate code sect */ /* if we were in a first level structure declaration, * we aren't any more */ parser_state_tos->in_decl = (parser_state_tos->dec_nest > 0) ? true : false; /* If we have a semicolon following an if, while, or for, and the * user wants us to, we should insert a space (to show that there * is a null statement there). */ if (*last_token_ends_sp && settings.space_sp_semicolon) { *(e_code++) = ' '; } *(e_code++) = ';'; *e_code = '\0'; /* null terminate code sect */ parser_state_tos->want_blank = true; /* we are no longer in the middle of a stmt */ parser_state_tos->in_stmt = (parser_state_tos->p_l_follow > 0); if (!*sp_sw) { /* if not if for (;;) */ do { if (parse (semicolon) != total_success) { *file_exit_value = indent_error; } } while(0); *force_nl = true; /* force newline after a end of stmt */ } } /** * */ static void handle_token_lbrace( BOOLEAN * force_nl, int * dec_ind, exit_values_ty * file_exit_value, BOOLEAN * pbreak_line) { parser_state_tos->saw_double_colon = false; if (!parser_state_tos->block_init) { *force_nl = true; /* force other stuff on same line as '{' onto * new line */ parser_state_tos->in_stmt = false; /* dont indent the '{' */ } else { /* dont indent the '{' unless it is followed by more code. */ char *p = buf_ptr; for (;;) { p = skip_horiz_space(p); if (*p == EOL || (*p == '/' && p[1] == '/')) { parser_state_tos->in_stmt = false; break; } else if (*p == '/' && p[1] == '*') { p += 2; /* skip over comment */ while (*p && *p != EOL && (*p != '*' || p[1] != '/')) { ++p; } if (!*p || *p == EOL) { parser_state_tos->in_stmt = false; break; } p += 2; if (!*p) { break; } } else { break; } } if (parser_state_tos->block_init_level <= 0) { parser_state_tos->block_init_level = 1; } else { parser_state_tos->block_init_level++; } } if (s_code != e_code && parser_state_tos->block_init != 1) { if ((!parser_state_tos->in_decl && !settings.btype_2) || (parser_state_tos->in_decl && !settings.braces_on_struct_decl_line && !settings.braces_on_func_def_line)) { dump_line (true, &paren_target, pbreak_line); parser_state_tos->want_blank = false; } else { if (parser_state_tos->in_parameter_declaration && !parser_state_tos->in_or_st) { parser_state_tos->i_l_follow = 0; if (!settings.braces_on_func_def_line) { dump_line (true, &paren_target, pbreak_line); } else { *(e_code++) = ' '; } parser_state_tos->want_blank = false; } else { parser_state_tos->want_blank = true; } } } if (parser_state_tos->in_parameter_declaration) { prefix_blankline_requested = 0; } if (s_code == e_code) { parser_state_tos->ind_stmt = false; /* dont put extra indentation on line with '{' */ } if (parser_state_tos->in_decl && parser_state_tos->in_or_st) { /* This is a structure declaration. */ if (parser_state_tos->dec_nest >= di_stack_alloc) { di_stack_alloc *= 2; di_stack = (int *) xrealloc ((char *) di_stack, di_stack_alloc * sizeof (*di_stack)); } di_stack[parser_state_tos->dec_nest++] = *dec_ind; } else { parser_state_tos->in_decl = false; parser_state_tos->decl_on_line = false; /* we cant be in the * middle of a * declaration, so dont * do special * indentation of * comments */ parser_state_tos->in_parameter_declaration = 0; } *dec_ind = 0; /* We are no longer looking for an initializer or structure. Needed * so that the '=' in "enum bar {a = 1" does not get interpreted as * the start of an initializer. */ parser_state_tos->in_or_st = 0; do { if (parse (lbrace) != total_success) { *file_exit_value = indent_error; } } while(0); set_buf_break (bb_lbrace, paren_target); if (parser_state_tos->want_blank && s_code != e_code) { /* put a blank before '{' if '{' is not at start of line */ *(e_code++) = ' '; } parser_state_tos->want_blank = false; *(e_code++) = '{'; *e_code = '\0'; /* null terminate code sect */ parser_state_tos->just_saw_decl = 0; if (parser_state_tos->block_init && (parser_state_tos->block_init_level >= 2)) { /* Treat the indentation of the second '{' as a '(' * in * struct foo { { bar }, ... } */ if (++parser_state_tos->p_l_follow >= parser_state_tos->paren_indents_size) { parser_state_tos->paren_indents_size *= 2; parser_state_tos->paren_indents = (short *) xrealloc ((char *) parser_state_tos-> paren_indents, parser_state_tos->paren_indents_size * sizeof (short)); } ++parser_state_tos->paren_depth; parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] = e_code - s_code; } else if (parser_state_tos->block_init && (parser_state_tos->block_init_level == 1)) { /* Put a blank after the first '{' */ parser_state_tos->want_blank = true; } else { /* what ? */ } } /** * */ static void handle_token_rbrace( BOOLEAN * force_nl, int * dec_ind, exit_values_ty * file_exit_value, BOOLEAN * pbreak_line) { /* semicolons can be omitted in declarations */ if (((parser_state_tos->p_stack[parser_state_tos->tos] == decl) && !parser_state_tos->block_init) || /* ANSI C forbids label at end of compound statement, but we don't I guess :/ */ (parser_state_tos->p_stack[parser_state_tos->tos] == casestmt)) { if (parse (semicolon) != total_success) { *file_exit_value = indent_error; } } parser_state_tos->just_saw_decl = 0; parser_state_tos->ind_stmt = false; parser_state_tos->in_stmt = false; if ((parser_state_tos->block_init_level-- == 1) && (s_code != e_code)) { /* Found closing brace of declaration initialisation, with * code on the same line before the brace */ if (parser_state_tos->matching_brace_on_same_line < 0) { /* The matching '{' is not on the same line: * put the '}' on its own line. */ dump_line (true, &paren_target, pbreak_line); } else { /* Put a space before the '}' */ set_buf_break (bb_rbrace, paren_target); *(e_code++) = ' '; } } *(e_code++) = '}'; parser_state_tos->want_blank = true; if (parser_state_tos->block_init && (parser_state_tos->block_init_level > 0)) { /* We were treating this { } as normal ( ) */ --parser_state_tos->paren_depth; if (--parser_state_tos->p_l_follow < 0) { parser_state_tos->p_l_follow = 0; WARNING (_("Extra %c"), (unsigned long) *((unsigned char *) token), 0); } } else if (parser_state_tos->dec_nest > 0) { /* we are in multi-level structure * declaration */ *dec_ind = di_stack[--parser_state_tos->dec_nest]; if ((parser_state_tos->dec_nest == 0) && !parser_state_tos->in_parameter_declaration) { parser_state_tos->just_saw_decl = 2; } parser_state_tos->in_decl = true; } else { /* what ? */ } prefix_blankline_requested = 0; if (parse (rbrace) != total_success) { *file_exit_value = indent_error; } parser_state_tos->search_brace = (settings.cuddle_else && (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead)) || (settings.cuddle_do_while && (parser_state_tos->p_stack[parser_state_tos->tos] == dohead)); if (parser_state_tos->p_stack[parser_state_tos->tos] == stmtl) { if ( (parser_state_tos->last_rw != rw_struct_like) && (parser_state_tos->last_rw != rw_enum) && (parser_state_tos->last_rw != rw_decl) ) { *force_nl = true; } #if 0 else if (!settings.braces_on_struct_decl_line && (parser_state_tos->block_init != 1)) { *force_nl = true; } else { /* what ? */ } #endif } if ( (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead) || ( (parser_state_tos->p_stack[parser_state_tos->tos] == dohead) && !settings.cuddle_do_while && !settings.btype_2)) { *force_nl = true; } if (!parser_state_tos->in_decl && (parser_state_tos->tos <= 0) && settings.blanklines_after_procs && (parser_state_tos->dec_nest <= 0)) { postfix_blankline_requested = 1; postfix_blankline_requested_code = parser_state_tos->in_decl ? decl : rbrace; } } /** * */ static void handle_token_swstmt( BOOLEAN * sp_sw, codes_ty * hd_type) { *sp_sw = true; *hd_type = swstmt; /* keep this for when we have seen the * expression */ parser_state_tos->in_decl = false; } /** * */ static void handle_token_sp_paren( BOOLEAN * sp_sw, codes_ty * hd_type) { /* the interesting stuff is done after the expression is scanned */ *sp_sw = true; /* remember the type of header for later use by parser */ *hd_type = (*token == 'i' ? ifstmt : (*token == 'w' ? whilestmt : forstmt)); } /** * */ static void handle_token_nparen( BOOLEAN * force_nl, exit_values_ty * file_exit_value, BOOLEAN * last_else, BOOLEAN * pbreak_line) { parser_state_tos->in_stmt = false; if (*token == 'e') { if (e_code != s_code && (!settings.cuddle_else || e_code[-1] != '}')) { if (settings.verbose) { WARNING (_("Line broken"), 0, 0); } dump_line (true, &paren_target, pbreak_line); /* make sure this starts a line */ parser_state_tos->want_blank = false; } /* This will be over ridden when next we read an `if' */ *force_nl = true; /* also, following stuff must go onto new * line */ *last_else = 1; if (parse (elselit) != total_success) { *file_exit_value = indent_error; } } else { if (e_code != s_code) { /* make sure this starts a line */ if (settings.verbose) { WARNING (_("Line broken"), 0, 0); } dump_line (true, &paren_target, pbreak_line); parser_state_tos->want_blank = false; } *force_nl = true; /* also, following stuff must go onto new * line */ *last_else = 0; if (parse (dolit) != total_success) { *file_exit_value = indent_error; } } } /** * */ static void handle_token_overloaded( const bb_code_ty can_break) { char * t_ptr; if (parser_state_tos->want_blank) { set_buf_break (bb_overloaded, paren_target); *(e_code++) = ' '; } else if (can_break) { set_buf_break (can_break, paren_target); } else { /* what ? */ } parser_state_tos->want_blank = true; for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size(); *(e_code++) = *t_ptr; } *e_code = '\0'; /* null terminate code sect */ } /** * */ static void handle_token_decl( int * dec_ind, exit_values_ty * file_exit_value, BOOLEAN * pbreak_line) { /* handle C++ const function declarations like * const MediaDomainList PVR::get_itsMediaDomainList() const * { * return itsMediaDomainList; * } * by ignoring "const" just after a parameter list */ if ((parser_state_tos->last_token == rparen) && parser_state_tos->in_parameter_declaration && parser_state_tos->saw_double_colon && !strncmp (token, "const", 5)) { char * t_ptr; set_buf_break (bb_const_qualifier, paren_target); *(e_code++) = ' '; for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size(); *(e_code++) = *t_ptr; } *e_code = '\0'; /* null terminate code sect */ } else { if (!parser_state_tos->sizeof_mask) { if (parse (decl) != total_success) { *file_exit_value = indent_error; } } if ((parser_state_tos->last_token == rparen) && (parser_state_tos->tos <= 1)) { parser_state_tos->in_parameter_declaration = 1; if (s_code != e_code) { dump_line (true, &paren_target, pbreak_line); parser_state_tos->want_blank = false; } } if (parser_state_tos->in_parameter_declaration && (parser_state_tos->dec_nest == 0) && (parser_state_tos->p_l_follow == 0)) { parser_state_tos->ind_level = parser_state_tos->i_l_follow = settings.indent_parameters; parser_state_tos->ind_stmt = false; } /* in_or_st set for struct or initialization decl. Don't set it if * we're in ansi prototype */ if (!parser_state_tos->paren_depth) { parser_state_tos->in_or_st = 1; } if (!parser_state_tos->sizeof_mask) { parser_state_tos->in_decl = true; parser_state_tos->decl_on_line = true; if (parser_state_tos->dec_nest <= 0) { parser_state_tos->just_saw_decl = 2; } } #if 0 /* Erik de Castro Lopo Sun, 28 Sep 2003: * I don't know what this is supposed to do, but I do know that it * breaks the operation of the blanklines_after_procs setting in * situations like this where a blank line is supposed to be inserted * between the two functions: * * int func1 (void) * { * return 42 ; * } * static int func2 (void) * { * return 43 ; * } * * If this code is removed, the regression tests still pass (except * for one which needs to be modified because a blank line is * inserted as it should be. */ if (prefix_blankline_requested && ((parser_state_tos->block_init != 0) || (parser_state_tos->block_init_level != -1) || (parser_state_tos->last_token != rbrace) || (e_code != s_code) || (e_lab != s_lab) || (e_com != s_com))) { prefix_blankline_requested = 0; } #endif *dec_ind = settings.decl_indent > 0 ? settings.decl_indent : token_end - token + 1; /* get length of token plus 1 */ } } /** * */ static void handle_token_ident( BOOLEAN * force_nl, BOOLEAN * sp_sw, codes_ty * hd_type, int * dec_ind, exit_values_ty * file_exit_value, const bb_code_ty can_break, BOOLEAN is_procname_definition, BOOLEAN * pbreak_line) { /* If we are in a declaration, we must indent identifier. But not * inside the parentheses of an ANSI function declaration. */ if (parser_state_tos->in_decl && (parser_state_tos->p_l_follow == 0) && (parser_state_tos->last_token != rbrace)) { if (parser_state_tos->want_blank) { set_buf_break (bb_ident, paren_target); *(e_code++) = ' '; *e_code = '\0'; /* null terminate code sect */ } else if (can_break) { set_buf_break (can_break, paren_target); } else { /* what ? */ } parser_state_tos->want_blank = false; if ((is_procname_definition == false) || (!settings.procnames_start_line && (s_code != e_code))) { if (!parser_state_tos->block_init && !buf_break_used) { if (is_procname_definition) { *dec_ind = 0; } while ((e_code - s_code) < *dec_ind) { check_code_size(); set_buf_break (bb_dec_ind, paren_target); *(e_code++) = ' '; } *e_code = '\0'; /* null terminate code sect */ parser_state_tos->ind_stmt = false; } } else { if ((s_code != e_code) && (parser_state_tos->last_token != doublecolon)) { dump_line(true, &paren_target, pbreak_line); } *dec_ind = 0; parser_state_tos->want_blank = false; } } else if (*sp_sw && parser_state_tos->p_l_follow == 0) { *sp_sw = false; *force_nl = true; parser_state_tos->last_u_d = true; parser_state_tos->in_stmt = false; if (parse (*hd_type) != total_success) { *file_exit_value = indent_error; } } else { /* what ? */ } } /** * */ static void handle_token_struct_delim(void) { char * t_ptr; for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size(); *(e_code++) = *t_ptr; } parser_state_tos->want_blank = false; /* dont put a blank after a * period */ parser_state_tos->can_break = bb_struct_delim; } /** * */ static void handle_token_comma( BOOLEAN * force_nl, int * dec_ind, BOOLEAN is_procname_definition) { parser_state_tos->want_blank = true; if ((parser_state_tos->paren_depth == 0) && parser_state_tos->in_decl && !buf_break_used && (is_procname_definition == false) && !parser_state_tos->block_init) { while ((e_code - s_code) < (*dec_ind - 1)) { check_code_size(); set_buf_break (bb_dec_ind, paren_target); *(e_code++) = ' '; } parser_state_tos->ind_stmt = false; } *(e_code++) = ','; if (parser_state_tos->p_l_follow == 0) { if (parser_state_tos->block_init_level <= 0) { parser_state_tos->block_init = 0; } /* If we are in a declaration, and either the user wants all * comma'd declarations broken, or the line is getting too * long, break the line. */ if (break_comma && !settings.leave_comma) { *force_nl = true; } } if (parser_state_tos->block_init) { parser_state_tos->in_stmt = false; /* Don't indent after comma */ } /* For declarations, if user wants all fn decls broken, force that * now. */ if (settings.break_function_decl_args && (!parser_state_tos->in_or_st && parser_state_tos->in_stmt && parser_state_tos->in_decl)) { *force_nl = true; } } /** * */ static void handle_token_preesc( exit_values_ty * file_exit_value, BOOLEAN * pbreak_line) { char * t_ptr; char * p; if ((s_com != e_com) || (s_lab != e_lab) || (s_code != e_code)) { dump_line(true, &paren_target, pbreak_line); } { int in_comment = 0; int in_cplus_comment = 0; int com_start = 0; char quote = 0; int com_end = 0; /* ANSI allows spaces between '#' and preprocessor directives. * If the user specified "-lps" and there are such spaces, * they will be part of `token', otherwise `token' is just * '#'. */ for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_lab_size(); *e_lab++ = *t_ptr; } while (!had_eof && (*buf_ptr != EOL || in_comment)) { check_lab_size(); *e_lab = *buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } switch (*e_lab++) { case BACKSLASH: if (!in_comment && !in_cplus_comment) { *e_lab++ = *buf_ptr++; if (buf_ptr >= buf_end) { fill_buffer(); } } break; case '/': if (((*buf_ptr == '*') || (*buf_ptr == '/')) && !in_comment && !in_cplus_comment && !quote) { save_com.column = current_column () - 1; if (*buf_ptr == '/') { in_cplus_comment = 1; } else { in_comment = 1; } *e_lab++ = *buf_ptr++; com_start = e_lab - s_lab - 2; /* Store the column that corresponds with the start * of the buffer */ if (save_com.ptr == save_com.end) { save_com.start_column = current_column () - 2; } } break; case '"': case '\'': if (!quote) { quote = e_lab[-1]; } else if (e_lab[-1] == quote) { quote = 0; } else { /* what ? */ } break; case '*': if (*buf_ptr == '/' && in_comment) { in_comment = 0; *e_lab++ = *buf_ptr++; com_end = e_lab - s_lab; } break; } } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == TAB)) { e_lab--; } if (in_cplus_comment) /* Should we also check in_comment? -jla */ { in_cplus_comment = 0; *e_lab++ = *buf_ptr++; com_end = e_lab - s_lab; } if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on preprocessor line */ if (save_com.end != save_com.ptr) { need_chars (&save_com, 2); *save_com.end++ = EOL; /* add newline between * comments */ *save_com.end++ = ' '; save_com.len += 2; --line_no; } need_chars (&save_com, com_end - com_start + 1); strncpy (save_com.end, s_lab + com_start, com_end - com_start); save_com.end[com_end - com_start] = '\0'; save_com.end += com_end - com_start; save_com.len += com_end - com_start; e_lab = s_lab + com_start; while ((e_lab > s_lab) && ((e_lab[-1] == ' ') || (e_lab[-1] == TAB))) { e_lab--; } /* Switch input buffers so that calls to lexi() will * read from our save buffer. */ bp_save = buf_ptr; be_save = buf_end; buf_ptr = save_com.ptr; need_chars (&save_com, 1); buf_end = save_com.end; save_com.end = save_com.ptr; /* make save_com empty */ } *e_lab = '\0'; /* null terminate line */ parser_state_tos->pcase = false; } p = s_lab + 1; p = skip_horiz_space(p); if (strncmp (p, "if", 2) == 0) { if (settings.blanklines_around_conditional_compilation) { prefix_blankline_requested++; prefix_blankline_requested_code = preesc; while (*in_prog_pos++ == EOL) { } in_prog_pos--; } { /* Push a copy of the parser_state onto the stack. All * manipulations will use the copy at the top of stack, and * then we can return to the previous state by popping the * stack. */ parser_state_ty *new; new = (parser_state_ty *) xmalloc (sizeof (parser_state_ty)); (void) memcpy (new, parser_state_tos, sizeof (parser_state_ty)); /* We need to copy the dynamically allocated arrays in the * struct parser_state too. */ new->p_stack = (codes_ty *) xmalloc (parser_state_tos->p_stack_size * sizeof (codes_ty)); (void) memcpy (new->p_stack, parser_state_tos->p_stack, (parser_state_tos->p_stack_size * sizeof (codes_ty))); new->il = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); (void) memcpy (new->il, parser_state_tos->il, parser_state_tos->p_stack_size * sizeof (int)); new->cstk = (int *) xmalloc (parser_state_tos->p_stack_size * sizeof (int)); (void) memcpy (new->cstk, parser_state_tos->cstk, parser_state_tos->p_stack_size * sizeof (int)); new->paren_indents = (short *) xmalloc (parser_state_tos->paren_indents_size * sizeof (short)); (void) memcpy (new->paren_indents, parser_state_tos->paren_indents, (parser_state_tos->paren_indents_size * sizeof (short))); new->next = parser_state_tos; parser_state_tos = new; /* GDB_HOOK_parser_state_tos */ } } else if ((strncmp (p, "else", 4) == 0) || (strncmp (p, "elif", 4) == 0)) { /* When we get #else, we want to restore the parser state to * what it was before the matching #if, so that things get * lined up with the code before the #if. However, we do not * want to pop the stack; we just want to copy the second to * top elt of the stack because when we encounter the #endif, * it will pop the stack. */ else_or_endif = (strncmp (p, "else", 4) == 0); prefix_blankline_requested = 0; if (parser_state_tos->next) { /* First save the addresses of the arrays for the top of * stack. */ codes_ty * tos_p_stack = parser_state_tos->p_stack; int * tos_il = parser_state_tos->il; int * tos_cstk = parser_state_tos->cstk; short * tos_paren_indents = parser_state_tos->paren_indents; parser_state_ty * second = parser_state_tos->next; (void) memcpy (parser_state_tos, second, sizeof (parser_state_ty)); parser_state_tos->next = second; /* Now copy the arrays from the second to top of stack to * the top of stack. */ /* Since the p_stack, etc. arrays only grow, never shrink, * we know that they will be big enough to fit the array * from the second to top of stack. */ parser_state_tos->p_stack = tos_p_stack; (void) memcpy (parser_state_tos->p_stack, parser_state_tos->next->p_stack, parser_state_tos->p_stack_size * sizeof (codes_ty)); parser_state_tos->il = tos_il; (void) memcpy (parser_state_tos->il, parser_state_tos->next->il, (parser_state_tos->p_stack_size * sizeof (int))); parser_state_tos->cstk = tos_cstk; (void) memcpy (parser_state_tos->cstk, parser_state_tos->next->cstk, (parser_state_tos->p_stack_size * sizeof (int))); parser_state_tos->paren_indents = tos_paren_indents; (void) memcpy (parser_state_tos->paren_indents, parser_state_tos->next->paren_indents, (parser_state_tos->paren_indents_size * sizeof (short))); } else { ERROR (else_or_endif ? _("Unmatched #else") : _("Unmatched #elif"), 0, 0); *file_exit_value = indent_error; } } else if (strncmp (p, "endif", 5) == 0) { else_or_endif = true; prefix_blankline_requested = 0; /* We want to remove the second to top elt on the stack, which * was put there by #if and was used to restore the stack at * the #else (if there was one). We want to leave the top of * stack unmolested so that the state which we have been using * is unchanged. */ if (parser_state_tos->next) { parser_state_ty *second = parser_state_tos->next; parser_state_tos->next = second->next; free (second->p_stack); free (second->il); free (second->cstk); free (second->paren_indents); free (second); } else { ERROR (_("Unmatched #endif"), 0, 0); *file_exit_value = indent_error; } if (settings.blanklines_around_conditional_compilation) { postfix_blankline_requested++; postfix_blankline_requested_code = preesc; n_real_blanklines = 0; } } else { /* what ? */ } /* Don't put a blank line after declarations if they are directly * followed by an #else or #endif -Run */ if (else_or_endif && prefix_blankline_requested_code == decl) { prefix_blankline_requested = 0; } /* Normally, subsequent processing of the newline character * causes the line to be printed. The following clause handles * a special case (comma-separated declarations separated * by the preprocessor lines) where this doesn't happen. */ if ((parser_state_tos->last_token == comma) && (parser_state_tos->p_l_follow <= 0) && settings.leave_comma && !parser_state_tos->block_init && break_comma && (s_com == e_com)) { dump_line(true, &paren_target, pbreak_line); parser_state_tos->want_blank = false; } } /** * */ static void handle_token_comment( BOOLEAN * force_nl, BOOLEAN * flushed_nl, BOOLEAN * pbreak_line) { if (parser_state_tos->last_saw_nl && (s_code != e_code)) { *flushed_nl = false; dump_line(true, &paren_target, pbreak_line); parser_state_tos->want_blank = false; *force_nl = false; } print_comment (&paren_target, pbreak_line); } /** * */ static void handle_token_attribute(void) { char * t_ptr; if (s_code != e_code) { set_buf_break (bb_attribute, paren_target); *(e_code++) = ' '; } for (t_ptr = token; t_ptr < token_end; ++t_ptr) { check_code_size(); *(e_code++) = *t_ptr; } parser_state_tos->in_decl = false; parser_state_tos->want_blank = true; } /** * */ extern void handle_the_token( const codes_ty type_code, BOOLEAN * scase, BOOLEAN * force_nl, BOOLEAN * sp_sw, BOOLEAN * flushed_nl, codes_ty * hd_type, int * dec_ind, BOOLEAN * last_token_ends_sp, exit_values_ty * file_exit_value, const bb_code_ty can_break, BOOLEAN * last_else, BOOLEAN is_procname_definition, BOOLEAN * pbreak_line) { switch (type_code) { case form_feed: /* found a form feed in line */ handle_token_form_feed(pbreak_line); break; case newline: handle_token_newline(force_nl, pbreak_line); break; case lparen: handle_token_lparen(force_nl, sp_sw, dec_ind, pbreak_line); break; case rparen: handle_token_rparen(force_nl, sp_sw, hd_type, last_token_ends_sp, file_exit_value, pbreak_line); break; case unary_op: /* this could be any unary operation */ handle_token_unary_op( dec_ind, can_break); break; case binary_op: /* any binary operation */ handle_token_binary_op(can_break); break; case postop: /* got a trailing ++ or -- */ handle_token_postop(); break; case question: /* got a ? */ handle_token_question(can_break); break; case casestmt: /* got word 'case' or 'default' */ handle_token_casestmt(scase, file_exit_value); copy_id(type_code, force_nl, file_exit_value, can_break); break; case colon: /* got a ':' */ handle_token_colon(scase, force_nl, dec_ind, can_break, pbreak_line); break; case doublecolon: /* Deal with C++ Class::Method */ handle_token_doublecolon(); break; case semicolon: /* we are not in an initialization or structure declaration */ handle_token_semicolon(scase, force_nl, sp_sw, dec_ind, last_token_ends_sp, file_exit_value); break; case lbrace: /* got a '{' */ handle_token_lbrace(force_nl, dec_ind, file_exit_value, pbreak_line); break; case rbrace: /* got a '}' */ handle_token_rbrace(force_nl, dec_ind, file_exit_value, pbreak_line); break; case swstmt: /* got keyword "switch" */ handle_token_swstmt(sp_sw, hd_type); copy_id(type_code, force_nl, file_exit_value, can_break); break; case sp_paren: /* token is if, while, for */ handle_token_sp_paren(sp_sw, hd_type); copy_id(type_code, force_nl, file_exit_value, can_break); break; case sp_else: /* got else */ case sp_nparen: /* got do */ handle_token_nparen(force_nl, file_exit_value, last_else, pbreak_line); copy_id(type_code, force_nl, file_exit_value, can_break); break; case overloaded: /* Handle C++ operator overloading like: * * Class foo::operator = ()" * * This is just like a decl, but we need to remember this * token type. */ handle_token_overloaded(can_break); break; case decl: /* we have a declaration type (int, register, etc.) */ handle_token_decl(dec_ind, file_exit_value, pbreak_line); copy_id(type_code, force_nl, file_exit_value, can_break); break; case cpp_operator: /* Handle C++ operator overloading. See case overloaded above. */ case ident: /* got an identifier or constant */ handle_token_ident(force_nl, sp_sw, hd_type, dec_ind, file_exit_value, can_break, is_procname_definition, pbreak_line); copy_id(type_code, force_nl, file_exit_value, can_break); break; case struct_delim: handle_token_struct_delim(); break; case comma: handle_token_comma(force_nl, dec_ind, is_procname_definition); break; case preesc: /* got the character '#' */ handle_token_preesc(file_exit_value, pbreak_line); break; case comment: case cplus_comment: /* A C or C++ comment. */ handle_token_comment(force_nl, flushed_nl, pbreak_line); break; /* An __attribute__ qualifier */ case attribute: handle_token_attribute(); break; default: abort (); } /* end of big switch stmt */ } indent-2.2.11/src/config.h.vms0000644000177400010010000000334711331327560013013 00000000000000/* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE #undef _ALL_SOURCE #endif /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define if on MINIX. */ /* #undef _MINIX */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS /* Define if you have the memcpy function. */ #define HAVE_MEMCPY /* Define if you have the memmove function. */ #define HAVE_MEMMOVE /* Define if you have the strchr function. */ #define HAVE_STRCHR /* Define if you have the utime function. */ /* #undef HAVE_UTIME */ /* Define if you have the header file. */ /* #undef HAVE_DIRENT_H */ /* Define if you have the header file. */ /* #define HAVE_MALLOC_H */ /* Define if you have the header file. */ /* #undef HAVE_NDIR_H */ /* Define if you have the header file. */ #define HAVE_STRING_H /* Define if you have the header file. */ /* #undef HAVE_SYS_DIR_H */ /* Define if you have the header file. */ /* #undef HAVE_SYS_NDIR_H */ /* Define if you have the header file. */ #define HAVE_UNISTD_H /* Define if you have the header file. */ /* #undef HAVE_UTIME_H */ /* Name of package */ #define PACKAGE "indent" /* Version number of package */ #define VERSION "2.2.11" /* Define if compiler has function prototypes */ #define PROTOTYPES indent-2.2.11/src/comments.h0000644000177400010010000000204510775646104012572 00000000000000/** \file * Copyright (c) 1999 Carlo Wood. All rights reserved. * * 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 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef INDENT_COMMENTS_H #define INDENT_COMMENTS_H #include "sys.h" /* for RCSTAG_H */ RCSTAG_H (comments, "$Id$"); #include /* For BOOLEAN */ extern void print_comment( int * paren_targ, BOOLEAN * pbreak_line); #endif /* INDENT_COMMENTS_H */ indent-2.2.11/src/args.c0000644000177400010010000015742311041703025011666 00000000000000/** \file * Copyright (c) 1999, 2000 Carlo Wood. All rights reserved.
* Copyright (c) 1994 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. * All rights reserved.
* * Copyright (c) 1980, 1993 * The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois.
* Copyright (c) 1985 Sun Microsystems, Inc. * All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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 3 * of the License, or (at your option) any later version. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * HISTORY * - 2002-03-14 DI restructured scan_profile and fixed bug handling comments * - 2002-06-13 DI fixed handling of missing int parameter. * - 2002-08-05 Matthias and Eric Lloyd * Added support for -brf to place function opening brace after function * declaration. * - 2002-11-10 Cristalle Azundris Sabon * Added --preprocessor-indentation (ppi) if set, will indent nested * preprocessor-statements with n spaces per level. overrides -lps. * -2007-11-11 Jean-Christophe Dubois * Added --indent-label and --linux-style options. * - 2008-03-08 DI Re-baselined on the more acceptable (license-wise) OpenBSD release 3.4. */ /* Argument scanning and profile reading code. Default parameters are set * here as well. */ #include #include #include #include #include "sys.h" #include "indent.h" #include "args.h" #include "globs.h" #include "utils.h" RCSTAG_CC ("$Id$"); #define KR_SETTINGS_STRING (int *) \ "-nbad\0-bap\0-nbc\0-bbo\0-hnl\0-br\0-brs\0-c33\0-cd33\0" \ "-ncdb\0-ce\0-ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i4\0-ip0\0-l75\0-lp\0" \ "-npcs\0-nprs\0-npsl\0-sai\0-saf\0-saw\0-cs\0-nsc\0-nsob\0-nfca\0-cp33\0-nss\0" #define GNU_SETTINGS_STRING (int *) \ "-nbad\0-bap\0-bbo\0-hnl\0-nbc\0-bl\0-bls\0-ncdb\0-cs\0-nce\0" \ "-di2\0-ndj\0-nfc1\0-i2\0-ip5\0-lp\0-pcs\0-nprs\0-psl\0-nsc\0-sai\0-saf\0-saw\0-nsob\0" \ "-bli2\0-cp1\0-nfca\0" #define ORIG_SETTINGS_STRING (int *) \ "-nbap\0-nbad\0-bbo\0-hnl\0-bc\0-br\0-brs\0-c33\0-cd33\0-cdb\0" \ "-ce\0-ci4\0-cli0\0-cp33\0-di16\0-fc1\0-fca\0-i4\0-l75\0-lp\0-npcs\0-nprs\0" \ "-psl\0-sc\0-sai\0-saf\0-saw\0-nsob\0-nss\0-ts8\0" #define LINUX_SETTINGS_STRING (int *) \ "-nbad\0-bap\0-nbc\0-bbo\0-hnl\0-br\0-brs\0-c33\0-cd33\0" \ "-ncdb\0-ce\0-ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i8\0-ip0\0-l80\0-lp\0" \ "-npcs\0-nprs\0-npsl\0-sai\0-saf\0-saw\0-ncs\0-nsc\0-sob\0-nfca\0-cp33\0-ss\0" \ "-ts8\0-il1\0" /** * Profile types. These identify what kind of switches and arguments * can be passed to indent, and how to process them. */ typedef enum { PRO_BOOL, /*!< boolean */ PRO_INT, /*!< integer */ PRO_IGN, /*!< ignore it */ PRO_KEY, /*!< -T switch */ PRO_SETTINGS, /*!< bundled set of settings */ PRO_PRSTRING, /*!< Print string and exit */ PRO_FUNCTION /*!< Call the associated function. */ } profile_ty; /** * profile value settings for booleans */ typedef enum { ONOFF_NA, /*!< Means Not Applicable. Used in table for * entries that are not of type PRO_BOOL. */ OFF, /*!< This option turns on the boolean variable * in question. */ ON /*!< it turns it off */ } on_or_off_ty; /* Explicit flags for each option. */ static int exp_T = 0; static int exp_bacc = 0; static int exp_badp = 0; static int exp_bad = 0; static int exp_bap = 0; static int exp_bbb = 0; static int exp_bbo = 0; static int exp_bc = 0; static int exp_bl = 0; static int exp_blf = 0; static int exp_bli = 0; static int exp_bls = 0; static int exp_bs = 0; static int exp_c = 0;/*!< Starting column for comments trailing statements */ static int exp_cbi = 0; static int exp_cdb = 0; static int exp_cd = 0; /*!< Starting column for comments trailing declarations */ static int exp_cdw = 0; static int exp_ce = 0; static int exp_ci = 0; static int exp_cli = 0; static int exp_cp = 0; static int exp_cpp = 0; static int exp_cs = 0; static int exp_d = 0; static int exp_bfda = 0; static int exp_bfde = 0; static int exp_di = 0; static int exp_dj = 0; /*!< Left justify declarations */ static int exp_eei = 0; static int exp_fc1 = 0; static int exp_fca = 0; static int exp_gnu = 0; static int exp_hnl = 0; static int exp_i = 0; static int exp_il = 0; static int exp_ip = 0; static int exp_kr = 0; static int exp_l = 0; static int exp_lc = 0; static int exp_linux = 0; static int exp_lp = 0; static int exp_lps = 0; static int exp_nip = 0; static int exp_o = 0; static int exp_orig = 0; static int exp_pcs = 0; static int exp_pi = 0; static int exp_pmt = 0; static int exp_pro = 0; static int exp_prs = 0; static int exp_psl = 0; static int exp_ppi = 0; /*!< force preprocessor indent at width... */ static int exp_sai = 0; static int exp_saf = 0; static int exp_saw = 0; static int exp_sbi = 0; static int exp_sc = 0; static int exp_sob = 0; static int exp_ss = 0; static int exp_st = 0; static int exp_ts = 0; static int exp_ut = 0; static int exp_v = 0; static int exp_version = 0; /** * The following structure is controlled by command line parameters and * their meaning is explained in indent.h. */ user_options_ty settings = {0}; /* N.B.: because of the way the table here is scanned, options whose names * are substrings of other options must occur later; that is, with -lp vs -l, * -lp must be first. Also, while (most) booleans occur more than once, the * last default value is the one actually assigned. */ typedef struct { char * p_name; /*!< option name, e.g. "bl", "cli" */ profile_ty p_type; /*!< profile type */ int p_default; /*!< the default value (if PRO_BOOL or PRO_INT) */ on_or_off_ty p_special; /*!< If p_type == PRO_BOOL, ON or OFF to tell how * this switch affects the variable. Not used * for other p_type's. */ int * p_obj; /*!< if p_type == PRO_SETTINGS, a (char *) pointing * to a list of the switches to set, separated by * NULLs, terminated by 2 NULLs. * if p_type ==PRO_BOOL or PRO_INT, the address of * the variable that gets set by the option. * if p_type == PRO_PRSTRING, a (char *) pointing * to the string. * if p_type == PRO_FUNCTION, a pointer to a * function to be called. */ int * p_explicit; /*!< Points to a nonzero value (allocated statically * for all options) if the option has been specified * explicitly. This is necessary because for * boolean options, the options to set and reset the * variable must share the explicit flag. */ } pro_ty; /* * Usage is defined here because the structure pro refers to it. */ static void usage (void); #ifdef BERKELEY_DEFAULTS /** * Settings for original defaults */ const pro_ty pro[] = { {"version", PRO_PRSTRING, 0, ONOFF_NA, (int *) VERSION, &exp_version}, {"v", PRO_BOOL, false, ON, &settings.verbose, &exp_v}, {"ut", PRO_BOOL, true, ON, &settings.use_tabs, &exp_ut}, {"ts", PRO_INT, 8, ONOFF_NA, &settings.tabsize, &exp_ts}, {"st", PRO_BOOL, false, ON, &settings.use_stdout, &exp_st}, {"ss", PRO_BOOL, false, ON, &settings.space_sp_semicolon, &exp_ss}, {"sob", PRO_BOOL, false, ON, &settings.swallow_optional_blanklines, &exp_sob}, {"sc", PRO_BOOL, true, ON, &settings.star_comment_cont, &exp_sc}, {"sbi", PRO_INT, 0, ONOFF_NA, &settings.struct_brace_indent, &exp_sbi}, {"saw", PRO_BOOL, true, ON, &settings.space_after_while, &exp_saw}, {"sai", PRO_BOOL, true, ON, &settings.space_after_if, &exp_sai}, {"saf", PRO_BOOL, true, ON, &settings.space_after_for, &exp_saf}, {"psl", PRO_BOOL, true, ON, &settings.procnames_start_line, &exp_psl}, {"prs", PRO_BOOL, false, ON, &settings.parentheses_space, &exp_prs}, #ifdef PRESERVE_MTIME {"pmt", PRO_BOOL, false, ON, &settings.preserve_mtime, &exp_pmt}, #endif {"pi", PRO_INT, -1, ONOFF_NA, &settings.paren_indent, &exp_pi}, {"pcs", PRO_BOOL, false, ON, &settings.proc_calls_space, &exp_pcs}, {"o", PRO_BOOL, false, ON, &settings.expect_output_file, &exp_o}, {"nv", PRO_BOOL, false, OFF, &settings.verbose, &exp_v}, {"nut", PRO_BOOL, true, OFF, &settings.use_tabs, &exp_ut}, {"nss", PRO_BOOL, false, OFF, &settings.space_sp_semicolon, &exp_ss}, {"nsob", PRO_BOOL, false, OFF, &settings.swallow_optional_blanklines, &exp_sob}, {"nsc", PRO_BOOL, true, OFF, &settings.star_comment_cont, &exp_sc}, {"nsaw", PRO_BOOL, true, OFF, &settings.space_after_while, &exp_saw}, {"nsai", PRO_BOOL, true, OFF, &settings.space_after_if, &exp_sai}, {"nsaf", PRO_BOOL, true, OFF, &settings.space_after_for, &exp_saf}, {"npsl", PRO_BOOL, true, OFF, &settings.procnames_start_line, &exp_psl}, {"nprs", PRO_BOOL, false, OFF, &settings.parentheses_space, &exp_prs}, {"npro", PRO_IGN, 0, ONOFF_NA, 0, &exp_pro}, #ifdef PRESERVE_MTIME {"npmt", PRO_BOOL, false, OFF, &settings.preserve_mtime, &exp_pmt}, #endif {"npcs", PRO_BOOL, false, OFF, &settings.proc_calls_space, &exp_pcs}, {"nlps", PRO_BOOL, false, OFF, &settings.leave_preproc_space, &exp_lps}, {"nlp", PRO_BOOL, true, OFF, &settings.lineup_to_parens, &exp_lp}, {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0", &exp_nip}, {"nhnl", PRO_BOOL, true, OFF, &settings.honour_newlines, &exp_hnl}, {"nfca", PRO_BOOL, true, OFF, &settings.format_comments, &exp_fca}, {"nfc1", PRO_BOOL, true, OFF, &settings.format_col1_comments, &exp_fc1}, {"neei", PRO_BOOL, false, OFF, &settings.extra_expression_indent, &exp_eei}, {"ndj", PRO_BOOL, false, OFF, &settings.ljust_decl, &exp_dj}, {"ncs", PRO_BOOL, true, OFF, &settings.cast_space, &exp_cs}, {"nce", PRO_BOOL, true, OFF, &settings.cuddle_else, &exp_ce}, {"ncdw", PRO_BOOL, false, OFF, &settings.cuddle_do_while, &exp_cdw}, {"ncdb", PRO_BOOL, true, OFF, &settings.comment_delimiter_on_blankline, &exp_cdb}, {"nbs", PRO_BOOL, false, OFF, &settings.blank_after_sizeof, &exp_bs}, {"nbfda", PRO_BOOL, false, OFF, &settings.break_function_decl_args, &exp_bfda}, {"nbfde", PRO_BOOL, false, OFF, &settings.break_function_decl_args_end, &exp_bfde}, {"nbc", PRO_BOOL, true, ON, &settings.leave_comma, &exp_bc}, {"nbbo", PRO_BOOL, true, OFF, &settings.break_before_boolean_operator, &exp_bbo}, {"nbbb", PRO_BOOL, false, OFF, &settings.blanklines_before_blockcomments, &exp_bbb}, {"nbap", PRO_BOOL, false, OFF, &settings.blanklines_after_procs, &exp_bap}, {"nbadp", PRO_BOOL, false, OFF, &settings.blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &settings.blanklines_after_declarations, &exp_bad}, {"nbacc", PRO_BOOL, false, OFF, &settings.blanklines_around_conditional_compilation, &exp_bacc}, {"linux", PRO_SETTINGS, 0, ONOFF_NA, LINUX_SETTINGS_STRING, &exp_linux}, {"lps", PRO_BOOL, false, ON, &settings.leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &settings.lineup_to_parens, &exp_lp}, {"lc", PRO_INT, DEFAULT_RIGHT_COMMENT_MARGIN, ONOFF_NA, &settings.comment_max_col, &exp_lc}, {"l", PRO_INT, DEFAULT_RIGHT_MARGIN, ONOFF_NA, &settings.max_col, &exp_l}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, KR_SETTINGS_STRING, &exp_kr}, {"ip", PRO_INT, 4, ONOFF_NA, &settings.indent_parameters, &exp_ip}, {"i", PRO_INT, 4, ONOFF_NA, &settings.ind_size, &exp_i}, {"il", PRO_INT, DEFAULT_LABEL_INDENT, ONOFF_NA, &settings.label_offset, &exp_il}, {"hnl", PRO_BOOL, true, ON, &settings.honour_newlines, &exp_hnl}, {"h", PRO_FUNCTION, 0, ONOFF_NA, (int *) usage, &exp_version}, {"gnu", PRO_SETTINGS, 0, ONOFF_NA, GNU_SETTINGS_STRING, &exp_gnu}, {"fca", PRO_BOOL, true, ON, &settings.format_comments, &exp_fca}, {"fc1", PRO_BOOL, true, ON, &settings.format_col1_comments, &exp_fc1}, {"eei", PRO_BOOL, false, ON, &settings.extra_expression_indent, &exp_eei}, {"dj", PRO_BOOL, false, ON, &settings.ljust_decl, &exp_dj}, {"di", PRO_INT, 16, ONOFF_NA, &settings.decl_indent, &exp_di}, {"d", PRO_INT, 0, ONOFF_NA, &settings.unindent_displace, &exp_d}, {"cs", PRO_BOOL, true, ON, &settings.cast_space, &exp_cs}, {"cp", PRO_INT, 33, ONOFF_NA, &settings.else_endif_col, &exp_cp}, {"cli", PRO_INT, 0, ONOFF_NA, &settings.case_indent, &exp_cli}, {"ci", PRO_INT, 4, ONOFF_NA, &settings.continuation_indent, &exp_ci}, {"ce", PRO_BOOL, true, ON, &settings.cuddle_else, &exp_ce}, {"cdw", PRO_BOOL, false, ON, &settings.cuddle_do_while, &exp_cdw}, {"cdb", PRO_BOOL, true, ON, &settings.comment_delimiter_on_blankline, &exp_cdb}, {"cd", PRO_INT, 33, ONOFF_NA, &settings.decl_com_ind, &exp_cd}, {"cbi", PRO_INT, -1, ONOFF_NA, &settings.case_brace_indent, &exp_cbi}, {"c++", PRO_BOOL, false, ON, &settings.c_plus_plus, &exp_cpp}, {"c", PRO_INT, 33, ONOFF_NA, &settings.com_ind, &exp_c}, {"bs", PRO_BOOL, false, ON, &settings.blank_after_sizeof, &exp_bs}, {"brs", PRO_BOOL, true, ON, &settings.braces_on_struct_decl_line, &exp_bls}, {"brf", PRO_BOOL, false, ON, &settings.braces_on_func_def_line, &exp_blf}, {"br", PRO_BOOL, true, ON, &settings.btype_2, &exp_bl}, {"bls", PRO_BOOL, true, OFF, &settings.braces_on_struct_decl_line, &exp_bls}, {"blf", PRO_BOOL, false, OFF, &settings.braces_on_func_def_line, &exp_blf}, {"bli", PRO_INT, 0, ONOFF_NA, &settings.brace_indent, &exp_bli}, {"bl", PRO_BOOL, true, OFF, &settings.btype_2, &exp_bl}, {"bfda", PRO_BOOL, false, ON, &settings.break_function_decl_args, &exp_bfda}, {"bfde", PRO_BOOL, false, ON, &settings.break_function_decl_args_end, &exp_bfde}, {"bc", PRO_BOOL, true, OFF, &settings.leave_comma, &exp_bc}, {"bbo", PRO_BOOL, true, ON, &settings.break_before_boolean_operator, &exp_bbo}, {"bbb", PRO_BOOL, false, ON, &settings.blanklines_before_blockcomments, &exp_bbb}, {"bap", PRO_BOOL, false, ON, &settings.blanklines_after_procs, &exp_bap}, {"badp", PRO_BOOL, false, ON, &settings.blanklines_after_declarations_at_proctop, &exp_badp}, {"bad", PRO_BOOL, false, ON, &settings.blanklines_after_declarations, &exp_bad}, {"bacc", PRO_BOOL, false, ON, &settings.blanklines_around_conditional_compilation, &exp_bacc}, {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"ppi", PRO_INT, 0, ONOFF_NA, &settings.force_preproc_width, &exp_ppi}, /* Signify end of structure. */ {0, PRO_IGN, 0, ONOFF_NA, 0, 0} }; #else /* Default to GNU style */ /** * Changed to make GNU style the default. */ const pro_ty pro[] = { {"version", PRO_PRSTRING, 0, ONOFF_NA, (int *) VERSION, &exp_version}, {"v", PRO_BOOL, false, ON, &settings.verbose, &exp_v}, {"ut", PRO_BOOL, true, ON, &settings.use_tabs, &exp_ut}, {"ts", PRO_INT, 8, ONOFF_NA, &settings.tabsize, &exp_ts}, {"st", PRO_BOOL, false, ON, &settings.use_stdout, &exp_st}, {"ss", PRO_BOOL, false, ON, &settings.space_sp_semicolon, &exp_ss}, {"sob", PRO_BOOL, false, ON, &settings.swallow_optional_blanklines, &exp_sob}, {"sc", PRO_BOOL, false, ON, &settings.star_comment_cont, &exp_sc}, {"sbi", PRO_INT, 0, ONOFF_NA, &settings.struct_brace_indent, &exp_sbi}, {"saw", PRO_BOOL, true, ON, &settings.space_after_while, &exp_saw}, {"sai", PRO_BOOL, true, ON, &settings.space_after_if, &exp_sai}, {"saf", PRO_BOOL, true, ON, &settings.space_after_for, &exp_saf}, {"psl", PRO_BOOL, true, ON, &settings.procnames_start_line, &exp_psl}, {"prs", PRO_BOOL, false, ON, &settings.parentheses_space, &exp_prs}, #ifdef PRESERVE_MTIME {"pmt", PRO_BOOL, false, ON, &settings.preserve_mtime, &exp_pmt}, #endif {"pi", PRO_INT, -1, ONOFF_NA, &settings.paren_indent, &exp_pi}, {"pcs", PRO_BOOL, true, ON, &settings.proc_calls_space, &exp_pcs}, {"orig", PRO_SETTINGS, 0, ONOFF_NA, ORIG_SETTINGS_STRING, &exp_orig}, {"o", PRO_BOOL, false, ON, &settings.expect_output_file, &exp_o}, {"nv", PRO_BOOL, false, OFF, &settings.verbose, &exp_v}, {"nut", PRO_BOOL, true, OFF, &settings.use_tabs, &exp_ut}, {"nss", PRO_BOOL, false, OFF, &settings.space_sp_semicolon, &exp_ss}, {"nsob", PRO_BOOL, false, OFF, &settings.swallow_optional_blanklines, &exp_sob}, {"nsc", PRO_BOOL, false, OFF, &settings.star_comment_cont, &exp_sc}, {"nsaw", PRO_BOOL, true, OFF, &settings.space_after_while, &exp_saw}, {"nsai", PRO_BOOL, true, OFF, &settings.space_after_if, &exp_sai}, {"nsaf", PRO_BOOL, true, OFF, &settings.space_after_for, &exp_saf}, {"npsl", PRO_BOOL, true, OFF, &settings.procnames_start_line, &exp_psl}, {"nprs", PRO_BOOL, false, OFF, &settings.parentheses_space, &exp_prs}, {"npro", PRO_IGN, 0, ONOFF_NA, 0, &exp_pro}, #ifdef PRESERVE_MTIME {"npmt", PRO_BOOL, false, OFF, &settings.preserve_mtime, &exp_pmt}, #endif {"npcs", PRO_BOOL, true, OFF, &settings.proc_calls_space, &exp_pcs}, {"nlps", PRO_BOOL, false, OFF, &settings.leave_preproc_space, &exp_lps}, {"nlp", PRO_BOOL, true, OFF, &settings.lineup_to_parens, &exp_lp}, {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0\0", &exp_nip}, {"nhnl", PRO_BOOL, true, OFF, &settings.honour_newlines, &exp_hnl}, {"nfca", PRO_BOOL, false, OFF, &settings.format_comments, &exp_fca}, {"nfc1", PRO_BOOL, false, OFF, &settings.format_col1_comments, &exp_fc1}, {"neei", PRO_BOOL, false, OFF, &settings.extra_expression_indent, &exp_eei}, {"ndj", PRO_BOOL, false, OFF, &settings.ljust_decl, &exp_dj}, {"ncs", PRO_BOOL, true, OFF, &settings.cast_space, &exp_cs}, {"nce", PRO_BOOL, false, OFF, &settings.cuddle_else, &exp_ce}, {"ncdw", PRO_BOOL, false, OFF, &settings.cuddle_do_while, &exp_cdw}, {"ncdb", PRO_BOOL, false, OFF, &settings.comment_delimiter_on_blankline, &exp_cdb}, {"nbs", PRO_BOOL, false, OFF, &settings.blank_after_sizeof, &exp_bs}, {"nbfda", PRO_BOOL, false, OFF, &settings.break_function_decl_args, &exp_bfda}, {"nbfde", PRO_BOOL, false, OFF, &settings.break_function_decl_args_end, &exp_bfde}, {"nbc", PRO_BOOL, true, ON, &settings.leave_comma, &exp_bc}, {"nbbo", PRO_BOOL, true, OFF, &settings.break_before_boolean_operator, &exp_bbo}, {"nbbb", PRO_BOOL, false, OFF, &settings.blanklines_before_blockcomments, &exp_bbb}, {"nbap", PRO_BOOL, true, OFF, &settings.blanklines_after_procs, &exp_bap}, {"nbadp", PRO_BOOL, false, OFF, &settings.blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &settings.blanklines_after_declarations, &exp_bad}, {"nbacc", PRO_BOOL, false, OFF, &settings.blanklines_around_conditional_compilation, &exp_bacc}, {"linux", PRO_SETTINGS, 0, ONOFF_NA, LINUX_SETTINGS_STRING, &exp_linux}, {"lps", PRO_BOOL, false, ON, &settings.leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &settings.lineup_to_parens, &exp_lp}, {"lc", PRO_INT, DEFAULT_RIGHT_COMMENT_MARGIN, ONOFF_NA, &settings.comment_max_col, &exp_lc}, {"l", PRO_INT, DEFAULT_RIGHT_MARGIN, ONOFF_NA, &settings.max_col, &exp_l}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, KR_SETTINGS_STRING, &exp_kr}, {"il", PRO_INT, DEFAULT_LABEL_INDENT, ONOFF_NA, &settings.label_offset, &exp_il}, {"ip", PRO_INT, 5, ONOFF_NA, &settings.indent_parameters, &exp_ip}, {"i", PRO_INT, 2, ONOFF_NA, &settings.ind_size, &exp_i}, {"hnl", PRO_BOOL, true, ON, &settings.honour_newlines, &exp_hnl}, {"h", PRO_FUNCTION, 0, ONOFF_NA, (int *) usage, &exp_version}, /* This is now the default. */ {"gnu", PRO_SETTINGS, 0, ONOFF_NA, GNU_SETTINGS_STRING, &exp_gnu}, {"fca", PRO_BOOL, false, ON, &settings.format_comments, &exp_fca}, {"fc1", PRO_BOOL, false, ON, &settings.format_col1_comments, &exp_fc1}, {"eei", PRO_BOOL, false, ON, &settings.extra_expression_indent, &exp_eei}, {"dj", PRO_BOOL, false, ON, &settings.ljust_decl, &exp_dj}, {"di", PRO_INT, 2, ONOFF_NA, &settings.decl_indent, &exp_di}, {"d", PRO_INT, 0, ONOFF_NA, &settings.unindent_displace, &exp_d}, {"cs", PRO_BOOL, true, ON, &settings.cast_space, &exp_cs}, {"cp", PRO_INT, 1, ONOFF_NA, &settings.else_endif_col, &exp_cp}, {"cli", PRO_INT, 0, ONOFF_NA, &settings.case_indent, &exp_cli}, {"ci", PRO_INT, 0, ONOFF_NA, &settings.continuation_indent, &exp_ci}, {"ce", PRO_BOOL, false, ON, &settings.cuddle_else, &exp_ce}, {"cdw", PRO_BOOL, false, ON, &settings.cuddle_do_while, &exp_cdw}, {"cdb", PRO_BOOL, false, ON, &settings.comment_delimiter_on_blankline, &exp_cdb}, {"cd", PRO_INT, 33, ONOFF_NA, &settings.decl_com_ind, &exp_cd}, {"cbi", PRO_INT, -1, ONOFF_NA, &settings.case_brace_indent, &exp_cbi}, {"c++", PRO_BOOL, false, ON, &settings.c_plus_plus, &exp_cpp}, {"c", PRO_INT, 33, ONOFF_NA, &settings.com_ind, &exp_c}, {"bs", PRO_BOOL, false, ON, &settings.blank_after_sizeof, &exp_bs}, {"brs", PRO_BOOL, false, ON, &settings.braces_on_struct_decl_line, &exp_bls}, {"bls", PRO_BOOL, false, OFF, &settings.braces_on_struct_decl_line, &exp_bls}, {"brf", PRO_BOOL, false, ON, &settings.braces_on_func_def_line, &exp_blf}, {"blf", PRO_BOOL, false, OFF, &settings.braces_on_func_def_line, &exp_blf}, {"bli", PRO_INT, 2, ONOFF_NA, &settings.brace_indent, &exp_bli}, {"br", PRO_BOOL, false, ON, &settings.btype_2, &exp_bl}, {"bl", PRO_BOOL, false, OFF, &settings.btype_2, &exp_bl}, {"bfda", PRO_BOOL, false, ON, &settings.break_function_decl_args, &exp_bfda}, {"bfde", PRO_BOOL, false, ON, &settings.break_function_decl_args_end, &exp_bfde}, {"bc", PRO_BOOL, true, OFF, &settings.leave_comma, &exp_bc}, {"bbo", PRO_BOOL, true, ON, &settings.break_before_boolean_operator, &exp_bbo}, {"bbb", PRO_BOOL, false, ON, &settings.blanklines_before_blockcomments, &exp_bbb}, {"bap", PRO_BOOL, true, ON, &settings.blanklines_after_procs, &exp_bap}, {"badp", PRO_BOOL, false, ON, &settings.blanklines_after_declarations_at_proctop, &exp_badp}, {"bad", PRO_BOOL, false, ON, &settings.blanklines_after_declarations, &exp_bad}, {"bacc", PRO_BOOL, false, ON, &settings.blanklines_around_conditional_compilation, &exp_bacc}, {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"ppi", PRO_INT, 0, ONOFF_NA, &settings.force_preproc_width, &exp_ppi}, /* Signify end of structure. */ {0, PRO_IGN, 0, ONOFF_NA, 0, 0} }; #endif /* GNU defaults */ typedef struct long_option_conversion { char *long_name; char *short_name; } long_option_conversion_ty; const long_option_conversion_ty option_conversions[] = { {"version", "version"}, {"verbose", "v"}, {"usage", "h"}, {"use-tabs", "ut"}, {"tab-size", "ts"}, {"swallow-optional-blank-lines", "sob"}, {"struct-brace-indentation", "sbi"}, {"start-left-side-of-comments", "sc"}, {"standard-output", "st"}, {"space-special-semicolon", "ss"}, {"space-after-while", "saw"}, {"space-after-procedure-calls", "pcs"}, {"space-after-parentheses", "prs"}, {"space-after-if", "sai"}, {"space-after-for", "saf"}, {"space-after-cast", "cs"}, {"remove-preprocessor-space", "nlps"}, {"procnames-start-lines", "psl"}, #ifdef PRESERVE_MTIME {"preserve-mtime", "pmt"}, #endif {"paren-indentation", "pi"}, {"parameter-indentation", "ip"}, {"output-file", "o"}, {"output", "o"}, {"original-style", "orig"}, {"original", "orig"}, {"no-verbosity", "nv"}, {"no-tabs", "nut"}, {"no-space-after-while", "nsaw"}, {"no-space-after-parentheses", "nprs"}, {"no-space-after-if", "nsai"}, {"no-space-after-function-call-names", "npcs"}, {"no-space-after-for", "nsaf"}, {"no-space-after-cast", "ncs"}, {"no-space-after-casts", "ncs"}, {"no-parameter-indentation", "nip"}, {"no-extra-expression-indentation", "neei"}, {"no-comment-delimiters-on-blank-lines", "ncdb"}, {"no-blank-lines-before-block-comments", "nbbb"}, {"no-blank-lines-after-procedures", "nbap"}, {"no-blank-lines-after-procedure-declarations", "nbadp"}, {"no-blank-lines-after-ifdefs", "nbacc"}, {"no-blank-lines-after-declarations", "nbad"}, {"no-blank-lines-after-commas", "nbc"}, {"no-blank-before-sizeof", "nbs"}, {"no-Bill-Shannon", "nbs"}, {"label-offset", "il"}, {"line-length", "l"}, {"line-comments-indentation", "d"}, {"linux-style", "linux"}, {"left-justify-declarations", "dj"}, {"leave-preprocessor-space", "lps"}, {"leave-optional-blank-lines", "nsob"}, {"kernighan-and-ritchie-style", "kr"}, {"kernighan-and-ritchie", "kr"}, {"k-and-r-style", "kr"}, {"indent-label", "il"}, {"indentation-level", "i"}, {"indent-level", "i"}, {"ignore-profile", "npro"}, {"ignore-newlines", "nhnl"}, {"honour-newlines", "hnl"}, {"help", "h"}, {"gnu-style", "gnu"}, {"format-first-column-comments", "fc1"}, {"format-all-comments", "fca"}, {"extra-expression-indentation", "eei"}, {"else-endif-column", "cp"}, {"dont-star-comments", "nsc"}, {"dont-space-special-semicolon", "nss"}, {"dont-line-up-parentheses", "nlp"}, {"dont-left-justify-declarations", "ndj"}, {"dont-indent-parameters", "nip"}, {"dont-format-first-column-comments", "nfc1"}, {"dont-format-comments", "nfca"}, {"dont-cuddle-else", "nce"}, {"dont-cuddle-do-while", "ncdw"}, {"dont-break-procedure-type", "npsl"}, {"dont-break-function-decl-args", "nbfda"}, {"dont-break-function-decl-args-end", "nbfde"}, {"declaration-indentation", "di"}, {"declaration-comment-column", "cd"}, {"cuddle-else", "ce"}, {"cuddle-do-while", "cdw"}, {"continue-at-parentheses", "lp"}, {"continuation-indentation", "ci"}, {"comment-line-length", "lc"}, {"comment-indentation", "c"}, {"comment-delimiters-on-blank-lines", "cdb"}, {"case-indentation", "cli"}, {"case-brace-indentation", "cbi"}, {"c-plus-plus", "c++"}, {"break-function-decl-args", "bfda"}, {"break-function-decl-args-end", "bfde"}, {"break-before-boolean-operator", "bbo"}, {"break-after-boolean-operator", "nbbo"}, {"braces-on-struct-decl-line", "brs"}, {"braces-on-func-def-line", "brf"}, {"braces-on-if-line", "br"}, {"braces-after-struct-decl-line", "bls"}, {"braces-after-func-def-line", "blf"}, {"braces-after-if-line", "bl"}, {"brace-indent", "bli"}, {"blank-lines-before-block-comments", "bbb"}, {"blank-lines-after-procedures", "bap"}, {"blank-lines-after-procedure-declarations", "badp"}, {"blank-lines-after-ifdefs", "bacc"}, {"blank-lines-after-declarations", "bad"}, {"blank-lines-after-commas", "bc"}, {"blank-before-sizeof", "bs"}, {"berkeley-style", "orig"}, {"berkeley", "orig"}, {"Bill-Shannon", "bs"}, {"preprocessor-indentation", "ppi"}, /* Signify end of structure. */ {0, 0}, }; /** * Print a brief usage message to stderr and exit. */ static void usage (void) { DieError(invocation_error, _("usage: indent file [-o outfile ] [ options ]\n indent file1 file2 ... fileN [ options ]\n")); } /** * S1 should be a string. S2 should be a string, perhaps followed by an * argument. Compare the two, returning true if they are equal, and if they * are equal set *START_PARAM to point to the argument in S2. */ static BOOLEAN eqin ( const char * s1, const char * s2, const char ** start_param) { BOOLEAN ret = true; while (*s1) { if (*s1++ != *s2++) { ret = false; } } *start_param = s2; return ret; } /** * Set the defaults. */ void set_defaults(void) { const pro_ty *p; for (p = pro; p->p_name; p++) { if (((p->p_type == PRO_BOOL) && (p->p_special == ON)) || (p->p_type == PRO_INT)) { *p->p_obj = p->p_default; } } } /** * Set the defaults after options set */ void set_defaults_after(void) { if (!exp_lc) /* if no -lc option was given */ { settings.comment_max_col = settings.max_col; } } /** * */ static void arg_missing( const char * option, const char * option_source) { DieError(invocation_error, _("%s: missing argument to parameter %s\n"), option_source, option); } /** * Examine the given argument and return the length of the prefix if the prefix * is one of "--", "-", or "+". If no such prefix is present return 0. */ static int option_prefix( const char * arg) { static char *option_prefixes[] = { "--", "-", "+", 0 }; /*!< Strings which can prefix an option, longest first. */ char ** prefixes = option_prefixes; char * this_prefix = *prefixes; const char * argp = arg; int ret = 0; do { this_prefix = *prefixes; argp = arg; while (*this_prefix == *argp) { this_prefix++; argp++; } if (*this_prefix == '\0') { ret = this_prefix - *prefixes; break; } } while (*++prefixes); return ret; } /** * Process an option ARG (e.g. "-l60"). PARAM is a possible value * for ARG, if PARAM is non-null. EXPLICT should be nonzero iff the * argument is being explicitly specified (as opposed to being taken from a * PRO_SETTINGS group of settings). * * Returns 1 if the option had a value, returns 0 otherwise. * * - 2002-06-13 D.Ingamells. Fixed check for int param without an int argument. */ extern int set_option( const char * option, const char * param, int explicit, const char * option_source) { const pro_ty * p = pro; const char * param_start = NULL; int option_length = option_prefix (option); int val = 0; BOOLEAN found = false; if (option_length > 0) { if ((option_length == 1) && (*option == '-')) { /* Short option prefix */ option++; for (p = pro; p->p_name; p++) { if ((*p->p_name == *option) && eqin (p->p_name, option, ¶m_start)) { found = true; break; } } } else { /* Long prefix */ const long_option_conversion_ty *o = option_conversions; option += option_length; while (o->short_name) { if (eqin (o->long_name, option, ¶m_start)) { break; } o++; } /* Searching twice means we don't have to keep the two tables in * sync. */ if (o->short_name) { for (p = pro; p->p_name; p++) { if (!strcmp (p->p_name, o->short_name)) { found = true; break; } } } } } if (!found) { DieError(invocation_error, _("%s: unknown option \"%s\"\n"), option_source, option - 1); } else { /* If the parameter has been explicitly specified, we don't * want a group of bundled settings to override the explicit * setting. */ if (settings.verbose) { fprintf (stderr, _("option: %s\n"), p->p_name); } if (explicit || !*(p->p_explicit)) { if (explicit) { *(p->p_explicit) = 1; } switch (p->p_type) { case PRO_PRSTRING: /* This is not really an error, but zero exit values are returned only when code has been successfully formatted. */ printf (_("GNU indent %s\n"), (char *) p->p_obj); exit (invocation_error); break; case PRO_FUNCTION: ((void (*)(void)) p->p_obj)(); break; case PRO_SETTINGS: { char *t; /* current position */ t = (char *) p->p_obj; do { set_option (t, 0, 0, option_source); /* advance to character following next NUL */ while (*t++) { } } while (*t); } break; case PRO_IGN: break; case PRO_KEY: { char *str; if (*param_start == 0) { if (!(param_start = param)) { arg_missing(option, option_source); } else { val = 1; } } str = (char *) xmalloc (strlen (param_start) + 1); strcpy (str, param_start); addkey (str, rw_decl); } break; case PRO_BOOL: if (p->p_special == OFF) { *p->p_obj = false; } else { *p->p_obj = true; } break; case PRO_INT: if (*param_start == '\0') { param_start = param; if (param_start == NULL) { arg_missing(option, option_source); } else { val = 1; } } if (isdigit (*param_start) || ((*param_start == '-') && isdigit (*(param_start + 1)))) { *p->p_obj = atoi (param_start); } else { DieError(invocation_error, _("%s: option ``%s'' requires a numeric parameter\n"), option_source, option - 1); } break; default: DieError(invocation_error, _("set_option: internal error: p_type %d\n"), (int) p->p_type); } } } return val; } /** * The first 2 characters of a c++ comment have been read skip the remainder of the line * and return the first character from the next line. */ static int skip_cpp_comment( FILE * f) { int i; do { i = getc (f); } while ((i != EOF) && (i != EOL)); if (i == EOL) { i = getc (f); } return i; } /** * the first 2 characters of a c comment have been read. Read past the * remainder of the comment and return the first character after the * comment. */ static int skip_c_comment( FILE * f) { int i = getc (f); do { /* skip to the next '*' character */ while ((i != EOF) && (i != '*')) { i = getc (f); } if (i == EOF) { WARNING (_("Profile contains an unterminated comment"), 0, 0); break; } /* current char is '*' so skip over it. */ i = getc (f); /* If the current character is a '/' the comment is over. */ } while (i != '/'); if (i != EOF) { i = getc (f); } return i; } /** * The starting / of a comment has been read. * skip over the rest of the comment and return the * first character after the comment. */ static int skip_comment( FILE * f) { int i = getc (f); switch (i) { case '/': i = skip_cpp_comment(f); break; case '*': i = skip_c_comment(f); break; default: WARNING (_("Profile contains unpalatable characters"), 0, 0); } return i; } /** * Skip a sequence of space and control characters and return the * first character after the sequence. */ static int skip_spaces( FILE * f, int first) { int i = first; while ((i <= ' ') && (i != EOF)) { i = getc (f); } return i; } /** * Read a string from the input until the next control character, space or /. * Return the first character after the read string. */ static int read_string( FILE * f, char * buff, int first) { int i = first; char *p = buff; while ( ( i != EOF) && (i > ' ') && (i != '/') && (p < buff + BUFSIZ)) { *(p++) = i; i = getc (f); } *p = EOS; return i; } /** * Scan the options in the file f. */ static void scan_profile( FILE * f, const char * option_source) { char b0[BUFSIZ]; char b1[BUFSIZ]; char * current = b0; int i = skip_spaces(f, ' '); while (i != EOF) { if (i == '/') { /* The start of a comment. */ i = skip_comment(f); } else { i = read_string(f, current, i); /* We've scanned something... */ if (current == b0) { /* Second buffer still has to be filled. */ current = b1; } else if (set_option(b0, b1, 1, option_source) == 1) { /* The option had a parameter, thus both values * have been consumed. * Reset the 2 buffers to 'empty' */ current = b0; } else { /* Set option consumed one value. Move the * other value to the first buffer and go get a new * second value. */ strcpy(b0, b1); current = b1; } } i = skip_spaces(f, i); } if (current != b0) { set_option (b0, NULL, 1, option_source); } } /** * The name of the profile file if the user doesn't supply an explicit one. * NB Some operating systems don't allow more than one dot in a filename. */ #if defined (ONE_DOT_PER_FILENAME) #define INDENT_PROFILE "indent.pro" #else #define INDENT_PROFILE ".indent.pro" #endif /** * an sprintf format to use to generate the full profile path from a directory and * a file name. */ #ifndef PROFILE_FORMAT #define PROFILE_FORMAT "%s/%s" #endif /** * The name of the environment variable the user can set to supply the name * of the profile file. */ #define PROFILE_ENV_NAME "INDENT_PROFILE" /** * set_profile looks for the profile file via * 1) the profile environment variable * 2) looks for ./.indent.pro * 3) $HOME/.indent.pro * and reads the options given in that file. Return the * path of the file read. * * Note that as of version 1.3, indent only reads one file. */ char * set_profile(void) { FILE * f = NULL; char * fname = NULL; static char prof[] = INDENT_PROFILE; char * homedir = NULL; const char * envname = getenv(PROFILE_ENV_NAME); if (envname != NULL) { f = fopen(envname, "r"); if (f == NULL) { fatal(_("File named by environment variable %s does not exist or is not readable"), PROFILE_ENV_NAME); } else { scan_profile(f, envname); (void) fclose(f); fname = strdup(envname); } } else { f = fopen(INDENT_PROFILE, "r"); if (f != NULL) { int len = strlen (INDENT_PROFILE) + 3; scan_profile (f, INDENT_PROFILE); (void) fclose (f); fname = xmalloc (len); strcpy(fname, "./"); (void) strcat (fname, INDENT_PROFILE); } else { homedir = getenv ("HOME"); if (homedir) { fname = xmalloc (strlen (homedir) + strlen(PROFILE_FORMAT) + sizeof (prof)); sprintf (fname, PROFILE_FORMAT, homedir, prof); if ((f = fopen (fname, "r")) != NULL) { scan_profile (f, fname); (void) fclose (f); } else { free (fname); fname = NULL; } } } } return fname; } indent-2.2.11/src/sys.h0000644000177400010010000001011010775646104011553 00000000000000/** \file * Copyright (c) 1999 Carlo Wood. All rights reserved.
* Copyright (c) 1993, 1994 Joseph Arceneaux. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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 3 * of the License, or (at your option) any later version. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef SYS_H #define SYS_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef STDC_HEADERS #include #else #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #include #define memcpy(d, s, n) bcopy ((s), (d), (n)) #endif #ifndef HAVE_MEMMOVE #include #define memmove(d, s, n) bcopy ((s), (d), (n)) #endif #endif #include /* Values of special characters. */ #define TAB '\t' #define EOL '\n' #define EOS '\0' #define BACKSLASH '\\' #define NULL_CHAR '\0' #ifdef DEBUG extern int debug; #endif #ifdef __GNUC__ #define INLINE __inline__ #else #define INLINE #endif #ifdef VMS #define ONE_DOT_PER_FILENAME 1 #define PROFILE_FORMAT "%s%s" #define BACKUP_SUFFIX_STR "_" #define BACKUP_SUFFIX_CHAR '_' #define BACKUP_SUFFIX_FORMAT "%s._%d_" #define INDENT_SYS_READ vms_read /* Defined in code_io.c */ #if defined(VAXC) || defined(__DECC) #include #endif #endif /* VMS */ #if 'A' == 0xC1 /* Automatic detection of underlying EBCDIC codeset */ #define CHARSET_EBCDIC #endif #ifdef __MSDOS__ #define ONE_DOT_PER_FILENAME 1 #endif /* __MSDOS__ */ #if defined(HAVE_UTIME) && (defined(HAVE_UTIME_H) || defined(HAVE_SYS_UTIME_H)) #define PRESERVE_MTIME 1 #endif /* Donated by Carlo Wood from `libcw'. All rights reserved. */ #if !defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) #define __attribute__(x) #endif #define RCSTAG_CC(string) static char rcs_ident[] __attribute__ ((unused)) = string #ifdef __STDC__ #define RCSTAG_H(name, string) static const char \ rcs_ident_##name##_h[] __attribute__ ((unused)) = string #else #define RCSTAG_H(name, string) /**/ #endif RCSTAG_H (sys, "$Id$"); #endif indent-2.2.11/src/gperf.c0000644000177400010010000001467211041664143012042 00000000000000/* C code produced by gperf version 3.0.2 */ /* Command-line: gperf -D -c -l -p -t -T -g -j1 -o -K rwd -N is_reserved indent.gperf */ /* Computed positions: -k'2-3' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) /* The character set is not based on ISO-646. */ error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif #define TOTAL_KEYWORDS 32 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 8 #define MIN_HASH_VALUE 3 #define MAX_HASH_VALUE 41 /* maximum key range = 39, duplicates = 0 */ #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static unsigned int hash (str, len) register const char *str; register unsigned int len; { static unsigned char asso_values[] = { 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 15, 42, 12, 42, 42, 42, 9, 25, 9, 8, 7, 42, 42, 0, 42, 5, 1, 13, 42, 15, 0, 0, 16, 42, 18, 24, 12, 15, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 }; register int hval = len; switch (hval) { default: hval += asso_values[(unsigned char)str[2]]; /*FALLTHROUGH*/ case 2: hval += asso_values[(unsigned char)str[1]]; break; } return hval; } #ifdef __GNUC__ __inline #endif templ_ty * is_reserved (str, len) register const char *str; register unsigned int len; { static unsigned char lengthtable[] = { 2, 4, 4, 5, 6, 3, 8, 4, 5, 4, 8, 5, 6, 4, 5, 6, 3, 5, 6, 6, 6, 4, 4, 8, 2, 6, 5, 6, 6, 7, 6, 7 }; static templ_ty wordlist[] = { #line 33 "indent.gperf" {"do", rw_sp_nparen,}, #line 32 "indent.gperf" {"else", rw_sp_else,}, #line 27 "indent.gperf" {"goto", rw_break,}, #line 13 "indent.gperf" {"float", rw_decl,}, #line 22 "indent.gperf" {"global", rw_decl,}, #line 10 "indent.gperf" {"int", rw_decl,}, #line 25 "indent.gperf" {"volatile", rw_decl,}, #line 15 "indent.gperf" {"long", rw_decl,}, #line 12 "indent.gperf" {"const", rw_decl,}, #line 24 "indent.gperf" {"void", rw_decl,}, #line 18 "indent.gperf" {"unsigned", rw_decl,}, #line 16 "indent.gperf" {"short", rw_decl,}, #line 28 "indent.gperf" {"return", rw_return,}, #line 4 "indent.gperf" {"case", rw_case,}, #line 7 "indent.gperf" {"union", rw_struct_like,}, #line 21 "indent.gperf" {"static", rw_decl,}, #line 31 "indent.gperf" {"for", rw_sp_paren,}, #line 30 "indent.gperf" {"while", rw_sp_paren,}, #line 6 "indent.gperf" {"struct", rw_struct_like,}, #line 19 "indent.gperf" {"signed", rw_decl,}, #line 14 "indent.gperf" {"double", rw_decl,}, #line 11 "indent.gperf" {"char", rw_decl,}, #line 8 "indent.gperf" {"enum", rw_enum,}, #line 20 "indent.gperf" {"register", rw_decl,}, #line 29 "indent.gperf" {"if", rw_sp_paren,}, #line 34 "indent.gperf" {"sizeof", rw_sizeof,}, #line 5 "indent.gperf" {"break", rw_break,}, #line 23 "indent.gperf" {"extern", rw_decl,}, #line 3 "indent.gperf" {"switch", rw_switch,}, #line 17 "indent.gperf" {"typedef", rw_decl,}, #line 26 "indent.gperf" {"va_dcl", rw_decl,}, #line 9 "indent.gperf" {"default", rw_case,} }; static short lookup[] = { -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, -1, -1, 31 }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= 0) { register int index = lookup[key]; if (index >= 0) { if (len == lengthtable[index]) { register const char *s = wordlist[index].rwd; if (*str == *s && !memcmp (str + 1, s + 1, len - 1)) return &wordlist[index]; } } } } return 0; } indent-2.2.11/src/backup.h0000644000177400010010000000675610775646104012227 00000000000000/** * Copyright (c) 1999, Carlo Wood. All rights reserved.
* Copyright (c) 1993,1994, Joseph Arceneaux. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * This software 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. */ #ifndef INDENT_BACKUP_H #define INDENT_BACKUP_H #include "sys.h" /* for RCSTAG_H */ RCSTAG_H (backup, "$Id$"); #include #include "code_io.h" /** * When to make backup files. Analagous to 'version-control' in Emacs. */ typedef enum { unknown, /*!< Uninitialized or indeterminate value */ none, /*!< Never make backups. */ simple, /*!< Make simple backups of every file. */ numbered_existing, /*!< Make numbered backups of files that already have numbered backups, * and simple backups of the others. */ numbered /*!< Make numbered backups of every file. */ } backup_mode_ty; typedef struct { backup_mode_ty value; char *name; } version_control_values_ty; /** * Determine the value of `version_control' by looking in the environment * variable "VERSION_CONTROL". Defaults to numbered_existing. */ extern backup_mode_ty version_control_value(void); /** * Initialize information used in determining backup filenames. */ extern void initialize_backups(void); /** * Make a backup copy of FILE, taking into account version-control. * See the description at the beginning of the file for details. */ extern void make_backup( file_buffer_ty * file, const struct stat * file_stats); #endif /* INDENT_BACKUP_H */ indent-2.2.11/src/output.c0000644000177400010010000011636011331315111012262 00000000000000/** \file * Copyright (c) 2002 D.Ingamells * Copyright (c) 1999, 2000 Carlo Wood. All rights reserved.
* Copyright (c) 1994, 1996, 1997 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1992, 2002, 2008 Free Software Foundation, Inc. All rights reserved.
* * Copyright (c) 1980 The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. * Copyright (c) 1985 Sun Microsystems, Inc. * All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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 3 * of the License, or (at your option) any later version. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * File: output.c * Purpose: Interface to the output file for the indent tool. * * History: * - 2002-03-04 D.Ingamells Creation. * - 2002-11-10 Cristalle Azundris Sabon * Added --preprocessor-indentation (ppi) if set, will indent nested * preprocessor-statements with n spaces per level. overrides -lps. * -2007-11-11 Jean-Christophe Dubois * Added --indent-label and --linux-style options. */ #include #include #include #include #include #include #include "indent.h" #include "sys.h" #include "globs.h" #include "code_io.h" #include "output.h" RCSTAG_CC ("$Id$"); static FILE * output = NULL; static BOOLEAN inhibited = 0; static buf_break_st_ty * buf_break_list = NULL; /** Priority mask bits */ static const int boolean_operator = 1; buf_break_st_ty * buf_break = NULL; int out_lines = 0; /*!< used in output.c indent.c */ int com_lines = 0; /*!< used in output.c indent.c comments.c */ int prev_target_col_break = 0; int buf_break_used = 0; int preproc_indent = 0; /** * Returns `true' when `b1' is a better place to break the code than `b2'. * `b1' must be newer. * * When `lineup_to_parens' is true, do not break more then 1 level deeper * unless that doesn't cost us "too much" indentation. * What is "too much" is determined in a fuzzy way as follows: * Consider the example, * while (!(!(!(!(!(!(mask * || (((a_very_long_expression_that_cant_be_broken * here we prefer to break after `mask' instead of after `while'. * This is because the `target_col' is pretty close to the break point * of the `while': "mask"->target_col - "while"->col == 15 == "mask"->level * 2 + 1. */ static BOOLEAN better_break ( buf_break_st_ty *b1, const buf_break_st_ty *b2) { static int first_level; BOOLEAN is_better; if (!b2) { first_level = b1->level; b1->first_level = first_level; is_better = true; } else { if (b2->target_col >= b2->col + 1) { is_better = true; } else if (settings.honour_newlines && b2->priority_newline) { is_better = false; } else if (settings.honour_newlines && b1->priority_newline) { is_better = true; } else { int only_parens_till_b2 = 0; is_better = (b1->priority > b2->priority); if (is_better) { char *p; for (p = &s_code[b2->offset]; p >= s_code; --p) { if (*p == '!') { --p; } if (*p != '(') { break; } } if (p < s_code) { only_parens_till_b2 = 1; } } if (settings.lineup_to_parens && (b1->level > (first_level + 1)) && !(only_parens_till_b2 && (b1->target_col <= (b2->col + (1 + 2 * b1->level)))) && (b1->level > b2->level)) { is_better = false; } } if (is_better) { b1->first_level = first_level; } } return is_better; } /** * Calculate break priority. * * Example: * e_code (`s_code' buffer, at the moment * set_buf_break() is called) * ptr (`s_code' buffer) * corresponds_to (input buffer) * Left most column col+1 (the column (31 here)). * | | * 1234567890123456789012345678901234567890 * if (!(mask[0] == '\\0' * | * target_col (assuming `lineup_to_parens' is true in this example) * 1 2 3 2 | level == 2 * <---------------------> * priority_code_length */ static void set_priority ( buf_break_st_ty *bb) { bb->priority = bb->priority_code_length; switch (bb->priority_code) { case bb_semicolon: bb->priority += 6000; break; case bb_before_boolean_binary_op: bb->priority += 5000; break; case bb_after_boolean_binary_op: if (bb->priority_code_length > 2) { bb->priority += 5000; } if (settings.break_before_boolean_operator) { bb->priority -= 3; } break; case bb_after_equal_sign: bb->priority += 4000; break; case bb_attribute: bb->priority += 3000; break; case bb_comma: bb->priority += 2000; break; case bb_comparisation: bb->priority += 1000; break; case bb_proc_call: bb->priority -= 1000; break; case bb_operator6: bb->priority += 600; break; case bb_operator5: bb->priority += 500; break; case bb_operator4: bb->priority += 400; break; case bb_operator2: bb->priority += 200; break; case bb_doublecolon: bb->priority += 100; break; default: break; } } /** * This function is called at every position where we possibly want * to break a line (if it gets too long). */ void set_buf_break ( bb_code_ty code, int paren_targ) { int target_col, level; int code_target = compute_code_target (paren_targ); buf_break_st_ty *bb; /* First, calculate the column that code following e_code would be * printed in if we'd break the line here. * This is done quite simular to compute_code_target(). */ /* Base indentation level (number of open left-braces) */ target_col = parser_state_tos->i_l_follow + 1; /* Did we just parse a brace that will be put on the next line * by this line break? */ if (*token == '{') { target_col -= settings.ind_size; /* Use `ind_size' because this only happens * for the first brace of initializer blocks. */ } /* Number of open brackets */ level = parser_state_tos->p_l_follow; /* Did we just parse a bracket that will be put on the next line * by this line break? */ if ((*token == '(') || (*token == '[')) { --level; /* then don't take it into account */ } /* Procedure name of function declaration? */ if (parser_state_tos->procname[0] && (token == parser_state_tos->procname)) { target_col = 1; } else if (level == 0) /* No open brackets? */ { if (parser_state_tos->in_stmt) /* Breaking a statement? */ { target_col += settings.continuation_indent; } } else if (!settings.lineup_to_parens) { target_col += settings.continuation_indent + (settings.paren_indent * (level - 1)); } else { if (parser_state_tos->paren_indents[level - 1] < 0) { target_col = -parser_state_tos->paren_indents[level - 1]; } else { target_col = code_target + parser_state_tos->paren_indents[level - 1]; } } /* Store the position of `e_code' as the place to break this line. */ bb = (buf_break_st_ty *) xmalloc (sizeof (buf_break_st_ty)); bb->offset = e_code - s_code; bb->level = level; bb->target_col = target_col; bb->corresponds_to = token; *e_code = 0; bb->col = count_columns (code_target, s_code, NULL_CHAR) - 1; /* Calculate default priority. */ bb->priority_code_length = (e_code - s_code); bb->priority_newline = (parser_state_tos->last_saw_nl && !parser_state_tos->broken_at_non_nl); if (buf_break) { bb->first_level = buf_break->first_level; } switch (parser_state_tos->last_token) { case binary_op: if ( ((e_code - s_code) >= 3) && (e_code[-3] == ' ') && (((e_code[-1] == '&') && (e_code[-2] == '&')) || ((e_code[-1] == '|') && (e_code[-2] == '|')))) { bb->priority_code = bb_after_boolean_binary_op; } else if ( (e_code - s_code >= 2) && (e_code[-1] == '=') && ( (e_code[-2] == ' ') || ( (e_code - s_code >= 3) && (e_code[-3] == ' ') && ( (e_code[-2] == '%') || (e_code[-2] == '^') || (e_code[-2] == '&') || (e_code[-2] == '*') || (e_code[-2] == '-') || (e_code[-2] == '+') || (e_code[-2] == '|'))))) { bb->priority_code = bb_after_equal_sign; } else if ( ( ( (e_code - s_code) >= 2) && (e_code[-2] == ' ') && ( (e_code[-1] == '<') || (e_code[-1] == '>'))) || ( ( (e_code - s_code) >= 3) && (e_code[-3] == ' ') && (e_code[-1] == '=') && ( (e_code[-2] == '=') || (e_code[-2] == '!') || (e_code[-2] == '<') || (e_code[-2] == '>')))) { bb->priority_code = bb_comparisation; } else if ( (e_code[-1] == '+') || (e_code[-1] == '-')) { bb->priority_code = bb_operator6; } else if ( (e_code[-1] == '*') || (e_code[-1] == '/') || (e_code[-1] == '%')) { bb->priority_code = bb_operator5; } else { bb->priority_code = bb_binary_op; } break; case comma: bb->priority_code = bb_comma; break; default: if ( (code == bb_binary_op) && ( (*token == '&') || (*token == '|')) && (*token == token[1])) { bb->priority_code = bb_before_boolean_binary_op; } else if (e_code[-1] == ';') { bb->priority_code = bb_semicolon; } else { bb->priority_code = code; if (code == bb_struct_delim) /* . -> .* or ->* */ { if (e_code[-1] == '*') { bb->priority_code = bb_operator4; } else { bb->priority_code = bb_operator2; } } } } set_priority (bb); /* Add buf_break to the list */ if (buf_break_list) { buf_break_list->next = bb; } bb->prev = buf_break_list; bb->next = NULL; buf_break_list = bb; if (!buf_break || (bb->col <= settings.max_col)) { if (better_break (bb, buf_break)) { /* Found better buf_break. Get rid of all previous possible breaks. */ buf_break = bb; for (bb = bb->prev; bb;) { buf_break_st_ty *obb = bb; bb = bb->prev; free (obb); } buf_break->prev = NULL; } } } /** * */ void clear_buf_break_list ( BOOLEAN * pbreak_line) { buf_break_st_ty *bb; for (bb = buf_break_list; bb;) { buf_break_st_ty *obb = bb; bb = bb->prev; free (obb); } buf_break = buf_break_list = NULL; *pbreak_line = false; } /** * @verbatim * prev_code_target * | prev_code_target + offset * | | * <----->if ((aaa == bbb) && xxx * && xxx * | * new_code_target * @endverbatim */ static void set_next_buf_break ( int prev_code_target, int new_code_target, int offset, BOOLEAN * pbreak_line) { buf_break_st_ty *bb; better_break (buf_break, NULL); /* Reset first_level */ if (buf_break_list == buf_break) { clear_buf_break_list (pbreak_line); } else { /* Correct all elements of the remaining buf breaks: */ for (bb = buf_break_list; bb; bb = bb->prev) { if (bb->target_col > buf_break->target_col && settings.lineup_to_parens) { bb->target_col -= ((prev_code_target + offset) - new_code_target); } bb->col -= ((prev_code_target + offset) - new_code_target); bb->offset -= offset; bb->priority_code_length -= offset; bb->first_level = buf_break->first_level; if (!buf_break->priority_newline) { bb->priority_newline = false; } set_priority (bb); if (bb->prev == buf_break) { break; } } free (buf_break); /* Set buf_break to first break in the list */ buf_break = bb; /* GDB_HOOK_buf_break */ buf_break->prev = NULL; /* Find a better break of the existing breaks */ for (bb = buf_break; bb; bb = bb->next) { if (bb->col > settings.max_col) { continue; } if (better_break (bb, buf_break)) { /* Found better buf_break. Get rid of all previous possible breaks. */ buf_break = bb; for (bb = bb->prev; bb;) { buf_break_st_ty *obb = bb; bb = bb->prev; free (obb); } bb = buf_break; buf_break->prev = NULL; } } } } /** * Name: pad_output * Description: Fill the output line with whitespace up to TARGET_COLUMN, * given that the line is currently in column CURRENT_COLUMN. * * Returns: the ending column number. * * History: */ static int pad_output( int currentColumn, int target_column) { if (currentColumn < target_column) { if (settings.use_tabs && (settings.tabsize > 1)) { int offset = settings.tabsize - (currentColumn - 1) % settings.tabsize; while (currentColumn + offset <= target_column) { putc(TAB, output); currentColumn += offset; offset = settings.tabsize; } } while (currentColumn < target_column) { putc(' ', output); currentColumn++; } } return currentColumn; } /** * output the sequence of characters starting at begin and * ending at the character _before_ end (the character at end is not output) * to file. */ static void output_substring( FILE * file, const char * begin, const char * end) { const char * p; for (p = begin; p < end; p++) { putc (*p, file); } } /** * Name: dump_line_label * Description: routine that actually effects the printing of the new source's label section. * * Returns: current column number.. * * History: */ static int dump_line_label(void) { int cur_col; /* print lab, if any */ while ((e_lab > s_lab) && ((e_lab[-1] == ' ') || (e_lab[-1] == TAB))) { e_lab--; } cur_col = pad_output(1, compute_label_target()); /* force indentation of preprocessor directives. * this happens when force_preproc_width > 0 */ if ((settings.force_preproc_width > 0) && (s_lab[0] == '#')) { int preproc_postcrement; char *p = &s_lab[1]; while(*p == ' ') { p++; } preproc_postcrement = settings.force_preproc_width; if (strncmp(p, "else", 4) == 0) { preproc_indent-=settings.force_preproc_width; } else if ((strncmp(p, "if", 2) == 0) || (strncmp(p, "ifdef", 5) == 0)) { } else if (strncmp(p, "elif", 4) == 0) { preproc_indent -= settings.force_preproc_width; } else if (strncmp(p, "endif", 5) == 0) { preproc_indent -= settings.force_preproc_width; preproc_postcrement = 0; } else { preproc_postcrement = 0; } if (preproc_indent == 0) { fprintf (output, "#"); } else { fprintf (output, "#%*s", preproc_indent, " "); } fprintf (output, "%.*s", (int) (e_lab - p), p); cur_col = count_columns (cur_col + preproc_indent + 1, p, NULL_CHAR); preproc_indent += preproc_postcrement; } else if ((s_lab[0] == '#') && ((strncmp (&s_lab[1], "else", 4) == 0) || (strncmp (&s_lab[1], "endif", 5) == 0))) { /* Treat #else and #endif as a special case because any text * after #else or #endif should be converted to a comment. */ char *s = s_lab; if (e_lab[-1] == EOL) /* Don't include EOL in the comment */ { e_lab--; } do { putc (*s++, output); ++cur_col; } while ((s < e_lab) && ('a' <= *s) && (*s <= 'z')); while (((*s == ' ') || (*s == TAB)) && (s < e_lab)) { s++; } if (s < e_lab) { if (settings.tabsize > 1) { cur_col = pad_output (cur_col, cur_col + settings.tabsize - (cur_col - 1) % settings.tabsize); } else { cur_col = pad_output (cur_col, cur_col + 2); } if (s[0] == '/' && (s[1] == '*' || s[1] == '/')) { fprintf (output, "%.*s", (int)(e_lab - s), s); } else { fprintf (output, "/* %.*s */", (int)(e_lab - s), s); } /* no need to update cur_col: the very next thing will be a new-line (or end of file) */ } } else { fprintf (output, "%.*s", (int) (e_lab - s_lab), s_lab); cur_col = count_columns (cur_col, s_lab, NULL_CHAR); } return cur_col; } /** * */ static int count_parens( const char * string) { int paren_level = 0; while (*string) { switch (*string) { case '(': case '[': paren_level++; break; case ')': case ']': paren_level--; break; default: break; } string++; } return paren_level; } /** * */ static void dump_line_code( int * pcur_col, int * pnot_truncated, int paren_targ, BOOLEAN * pbreak_line, int target_col_break) { int paren_level = 0; if (s_code != e_code) { /* print code section, if any */ int i; int target_col = 0; /* If a comment begins this line, then indent it to the correct * column for comments, otherwise the line starts with code, * so indent it for code. */ if (embedded_comment_on_line == 1) { target_col = parser_state_tos->com_col; } else if (target_col_break != -1) { target_col = target_col_break; } else { target_col = compute_code_target (paren_targ); } if (paren_level > 0) { target_col += parser_state_tos->paren_indents[parser_state_tos->p_l_follow + paren_level- 1]; } /* If a line ends in an lparen character, the following line should * not line up with the parenthesis, but should be indented by the * usual amount. */ if (parser_state_tos->last_token == lparen) { parser_state_tos->paren_indents[parser_state_tos->p_l_follow - 1] += settings.ind_size - 1; } *pcur_col = pad_output (*pcur_col, target_col); if (*pbreak_line && (s_com == e_com) && (buf_break->target_col <= buf_break->col)) { int offset; int len; char c; char *ptr = &s_code[buf_break->offset]; if (*ptr != ' ') { --ptr; } /* Add target_col (and negate) the brackets that are * actually printed. The remaining brackets must * be given an offset of . */ offset = ptr - s_code + 1; for (i = 0; i < parser_state_tos->p_l_follow; i++) { if (parser_state_tos->paren_indents[i] >= 0) { if (parser_state_tos->paren_indents[i] < ptr - s_code) { parser_state_tos->paren_indents[i] = -(parser_state_tos->paren_indents[i] + target_col); } else { parser_state_tos->paren_indents[i] -= offset; } } } for (i = parser_state_tos->p_l_follow; i < parser_state_tos->paren_indents_size; ++i) { if (parser_state_tos->paren_indents[i] >= (ptr - s_code)) { parser_state_tos->paren_indents[i] -= offset; } } output_substring(output, s_code, s_code + buf_break->offset); c = s_code[buf_break->offset]; s_code[buf_break->offset] = '\0'; *pcur_col = count_columns (*pcur_col, s_code, NULL_CHAR); paren_level += count_parens(s_code); s_code[buf_break->offset] = c; *pnot_truncated = 0; len = (e_code - ptr - 1); memmove (s_code, ptr + 1, len); e_code = s_code + len; #if COLOR_DEBUG fputs (" \e[31m", output); output_substring(output, s_code, e_code); fputs (" \e[0m", output); #endif *e_code = '\0'; s_code_corresponds_to = buf_break->corresponds_to; prev_target_col_break = buf_break->target_col; if (!buf_break->priority_newline) { parser_state_tos->broken_at_non_nl = true; } set_next_buf_break (target_col, buf_break->target_col, offset, pbreak_line); buf_break_used = 1; *pbreak_line = (buf_break != NULL) && (output_line_length() > settings.max_col); } else { for (i = 0; i < parser_state_tos->p_l_follow; i++) { if (parser_state_tos->paren_indents[i] >= 0) { parser_state_tos->paren_indents[i] = -(parser_state_tos->paren_indents[i] + target_col); } } output_substring(output, s_code, e_code); *pcur_col = count_columns (*pcur_col, s_code, NULL_CHAR); clear_buf_break_list (pbreak_line); } } } /** * Name: dump_line * Description: routine that actually effects the printing of the new source. * It prints the label section, followed by the code section with * the appropriate nesting level, followed by any comments. * * Returns: None. * * History: */ extern void dump_line ( int force_nl, int * paren_targ, BOOLEAN * pbreak_line) { int cur_col; int not_truncated = 1; int target_col_break = -1; if (buf_break_used) { buf_break_used = 0; target_col_break = prev_target_col_break; } else if (force_nl) { parser_state_tos->broken_at_non_nl = false; } if (parser_state_tos->procname[0] && !parser_state_tos->classname[0] && (s_code_corresponds_to == parser_state_tos->procname)) { parser_state_tos->procname = "\0"; } else if (parser_state_tos->procname[0] && parser_state_tos->classname[0] && (s_code_corresponds_to == parser_state_tos->classname)) { parser_state_tos->procname = "\0"; parser_state_tos->classname = "\0"; } /* A blank line */ if ((s_code == e_code) && (s_lab == e_lab) && (s_com == e_com)) { /* If we have a formfeed on a blank line, we should just output it, * rather than treat it as a normal blank line. */ if (parser_state_tos->use_ff) { putc ('\014', output); parser_state_tos->use_ff = false; } else { n_real_blanklines++; } } else { if (prefix_blankline_requested && (n_real_blanklines == 0)) { if ((prefix_blankline_requested_code != decl) || !parser_state_tos->decl_on_line) { n_real_blanklines = 1; } } else if (settings.swallow_optional_blanklines && (n_real_blanklines > 1)) { n_real_blanklines = 1; } while (--n_real_blanklines >= 0) { putc (EOL, output); } n_real_blanklines = 0; if ((e_lab != s_lab) || (e_code != s_code)) { ++code_lines; /* keep count of lines with code */ } if (e_lab != s_lab) { cur_col = dump_line_label(); } else { cur_col = 1; /* there is no label section */ } parser_state_tos->pcase = false; /* Remove trailing spaces */ while ((*(e_code - 1) == ' ') && (e_code > s_code)) { *(--e_code) = NULL_CHAR; } dump_line_code(&cur_col, ¬_truncated, *paren_targ, pbreak_line, target_col_break); if (s_com != e_com) { { /* Here for comment printing. */ int target = parser_state_tos->com_col; char *com_st = s_com; if (cur_col > target) { putc (EOL, output); cur_col = 1; ++out_lines; } cur_col = pad_output (cur_col, target); fwrite (com_st, e_com - com_st, 1, output); cur_col += e_com - com_st; com_lines++; } } else if (embedded_comment_on_line) { com_lines++; } embedded_comment_on_line = 0; if (parser_state_tos->use_ff) { putc ('\014', output); parser_state_tos->use_ff = false; } else { putc (EOL, output); } ++out_lines; if ((parser_state_tos->just_saw_decl == 1) && settings.blanklines_after_declarations) { prefix_blankline_requested = 1; prefix_blankline_requested_code = decl; parser_state_tos->just_saw_decl = 0; } else { prefix_blankline_requested = postfix_blankline_requested; prefix_blankline_requested_code = postfix_blankline_requested_code; } postfix_blankline_requested = 0; } /* if we are in the middle of a declaration, remember that fact * for proper comment indentation */ parser_state_tos->decl_on_line = parser_state_tos->in_decl; /* next line should be indented if we have not completed this stmt */ parser_state_tos->ind_stmt = parser_state_tos->in_stmt; e_lab = s_lab; *s_lab = '\0'; /* reset buffers */ if (not_truncated) { e_code = s_code; *s_code = '\0'; s_code_corresponds_to = NULL; } e_com = s_com; *s_com = '\0'; parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->paren_level = parser_state_tos->p_l_follow; if (parser_state_tos->paren_level > 0) { /* If we broke the line and the following line will * begin with a rparen, the indentation is set for * the column of the rparen *before* the break - reset * the column to the position after the break. */ if (!not_truncated && ((*s_code == '(') || (*s_code == '[')) && (parser_state_tos->paren_level >= 2)) { *paren_targ = -parser_state_tos->paren_indents[parser_state_tos->paren_level - 2]; } else { *paren_targ = -parser_state_tos->paren_indents[parser_state_tos->paren_level - 1]; } } else { *paren_targ = 0; } if (inhibited) { char *p = cur_line; while (--n_real_blanklines >= 0) { putc (EOL, output); } n_real_blanklines = 0; do { while ((*p != '\0') && (*p != EOL)) { putc (*p++, output); } if ((*p == '\0') && ((unsigned long) (p - current_input->data) == current_input->size)) { in_prog_pos = p; buf_end = p; buf_ptr = p; had_eof = true; return; } if (*p == EOL) { cur_line = p + 1; line_no++; } putc (*p++, output); while ((*p == ' ') || (*p == TAB)) { putc (*p, output); p++; } if ((*p == '/') && ((*(p + 1) == '*') || (*(p + 1) == '/'))) { /* We've hit a comment. See if turns formatting back on. */ putc (*p++, output); putc (*p++, output); while ((*p == ' ') || (*p == TAB)) { putc (*p, output); p++; } if (!strncmp (p, "*INDENT-ON*", 11)) { do { while ((*p != '\0') && (*p != EOL)) { putc (*p++, output); } if ((*p == '\0') && (((unsigned long) (p - current_input->data) == current_input->size))) { in_prog_pos = p; buf_end = p; buf_ptr = p; had_eof = true; return; } else { if (*p == EOL) { inhibited = false; cur_line = p + 1; line_no++; } putc (*p++, output); } } while (inhibited); } } } while (inhibited); in_prog_pos = cur_line; buf_end = cur_line; buf_ptr = cur_line; fill_buffer (); } /* Output the rest already if we really wanted a new-line after this code. */ if (buf_break_used && (s_code != e_code) && force_nl) { prefix_blankline_requested = 0; dump_line (true, paren_targ, pbreak_line); } return; } /** * Name: flush_output * Description: Flushes any buffered output to the output file. * * Returns: None * * History: */ extern void flush_output(void) { fflush (output); } /** * Name: open_output * Description: Opens the output file in read/write mode. * * Returns: None * * History: */ void open_output( const char * filename, const char * mode) { if (filename == NULL) { output = stdout; } else { output = fopen(filename, mode); /* open the file for read + write * (but see the trunc function) */ if (output == NULL) { fprintf (stderr, _("indent: can't create %s\n"), filename); exit (indent_fatal); } } } /** * Name: reopen_output_trunc * Description: Reopens the output file truncated. * * Returns: None * * History: */ extern void reopen_output_trunc( const char * filename) { output = freopen(filename, "w", output); } /** * Name: close_output * Description: Closes the output file. * * Returns: None * * History: */ extern void close_output( struct stat * file_stats, const char * filename) { if (output != stdout) { if (fclose(output) != 0) { fatal(_("Can't close output file %s"), filename); } else { #ifdef PRESERVE_MTIME if (file_stats != NULL) { struct utimbuf buf; buf.actime = time (NULL); buf.modtime = file_stats->st_mtime; if (utime(filename, &buf) != 0) { WARNING(_("Can't preserve modification time on output file %s"), filename, 0); } } #endif } } } /** * */ extern void inhibit_indenting( BOOLEAN flag) { inhibited = flag; } /** * Return the column in which we should place the code in s_code. */ int compute_code_target ( int paren_targ) { int target_col; if (buf_break_used) { return prev_target_col_break; } if (parser_state_tos->procname[0] && (s_code_corresponds_to == parser_state_tos->procname)) { target_col = 1; if (!parser_state_tos->paren_level) { return target_col; } } else { target_col = parser_state_tos->ind_level + 1; } if (!parser_state_tos->paren_level) { if (parser_state_tos->ind_stmt) { target_col += settings.continuation_indent; } return target_col; } if (!settings.lineup_to_parens) { return target_col + settings.continuation_indent + (settings.paren_indent * (parser_state_tos->paren_level - 1)); } return paren_targ; } /** * */ int count_columns ( int column, char *bp, int stop_char) { while (*bp != stop_char && *bp != NULL_CHAR) { switch (*bp++) { case EOL: case '\f': /* form feed */ column = 1; break; case TAB: column += settings.tabsize - (column - 1) % settings.tabsize; break; case 010: /* backspace */ --column; break; #ifdef COLOR_DEBUG case '\e': /* ANSI color */ while (*bp++ != 'm') { } break; #endif default: ++column; break; } } return column; } /** * */ int compute_label_target (void) { /* maybe there should be some option to tell indent where to put public:, * private: etc. ? */ if (*s_lab == '#') { return 1; } if (parser_state_tos->pcase) { return parser_state_tos->cstk[parser_state_tos->tos] + 1; } if (settings.c_plus_plus && parser_state_tos->in_decl) { /* FIXME: does this belong here at all? */ return 1; } else if (settings.label_offset < 0) { return parser_state_tos->ind_level + settings.label_offset + 1; } else { return settings.label_offset + 1; } } /** * Compute the length of the line we will be outputting. */ int output_line_length (void) { int code_length = 0; int com_length = 0; int length; if (s_lab == e_lab) { length = 0; } else { length = count_columns (compute_label_target (), s_lab, EOL) - 1; } if (s_code != e_code) { int code_col = compute_code_target(paren_target); code_length = count_columns(code_col, s_code, EOL) - code_col; } if (s_com != e_com) { int com_col = parser_state_tos->com_col; com_length = count_columns(com_col, s_com, EOL) - com_col; } if (code_length != 0) { length += compute_code_target(paren_target) - 1 + code_length; if (embedded_comment_on_line) { length += com_length; } } return length; } indent-2.2.11/src/gperf-cc.c0000644000177400010010000001715011041664143012417 00000000000000/* C code produced by gperf version 3.0.2 */ /* Command-line: gperf -D -c -l -p -t -T -g -j1 -o -K rwd -N is_reserved_cc -H hash_cc indent-cc.gperf */ /* Computed positions: -k'1,3' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) /* The character set is not based on ISO-646. */ error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif #define TOTAL_KEYWORDS 48 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 9 #define MIN_HASH_VALUE 3 #define MAX_HASH_VALUE 57 /* maximum key range = 55, duplicates = 0 */ #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static unsigned int hash_cc (str, len) register const char *str; register unsigned int len; { static unsigned char asso_values[] = { 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 10, 58, 10, 28, 11, 25, 15, 25, 5, 30, 1, 58, 58, 5, 37, 22, 12, 34, 58, 2, 3, 0, 18, 34, 27, 58, 58, 25, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58 }; register int hval = len; switch (hval) { default: hval += asso_values[(unsigned char)str[2]]; /*FALLTHROUGH*/ case 2: case 1: hval += asso_values[(unsigned char)str[0]]; break; } return hval; } #ifdef __GNUC__ __inline #endif templ_ty * is_reserved_cc (str, len) register const char *str; register unsigned int len; { static unsigned char lengthtable[] = { 2, 3, 5, 6, 4, 6, 6, 6, 5, 6, 8, 5, 9, 4, 6, 5, 6, 4, 6, 5, 4, 5, 2, 7, 8, 3, 4, 6, 5, 6, 8, 6, 4, 5, 4, 6, 7, 5, 7, 4, 8, 6, 8, 5, 6, 6, 3, 7 }; static templ_ty wordlist[] = { #line 29 "indent-cc.gperf" {"if", rw_sp_paren,}, #line 10 "indent-cc.gperf" {"int", rw_decl,}, #line 39 "indent-cc.gperf" {"throw", rw_return,}, #line 28 "indent-cc.gperf" {"return", rw_return,}, #line 27 "indent-cc.gperf" {"goto", rw_break,}, #line 3 "indent-cc.gperf" {"switch", rw_switch,}, #line 6 "indent-cc.gperf" {"struct", rw_struct_like,}, #line 41 "indent-cc.gperf" {"inline", rw_decl,}, #line 48 "indent-cc.gperf" {"sigof", rw_sizeof,}, #line 19 "indent-cc.gperf" {"signed", rw_decl,}, #line 20 "indent-cc.gperf" {"register", rw_decl,}, #line 35 "indent-cc.gperf" {"catch", rw_sp_paren,}, #line 44 "indent-cc.gperf" {"signature", rw_struct_like,}, #line 4 "indent-cc.gperf" {"case", rw_case,}, #line 21 "indent-cc.gperf" {"static", rw_decl,}, #line 16 "indent-cc.gperf" {"short", rw_decl,}, #line 23 "indent-cc.gperf" {"extern", rw_decl,}, #line 32 "indent-cc.gperf" {"else", rw_sp_else,}, #line 22 "indent-cc.gperf" {"global", rw_decl,}, #line 7 "indent-cc.gperf" {"union", rw_struct_like,}, #line 11 "indent-cc.gperf" {"char", rw_decl,}, #line 36 "indent-cc.gperf" {"class", rw_struct_like,}, #line 33 "indent-cc.gperf" {"do", rw_sp_nparen,}, #line 46 "indent-cc.gperf" {"classof", rw_sizeof,}, #line 18 "indent-cc.gperf" {"unsigned", rw_decl,}, #line 31 "indent-cc.gperf" {"for", rw_sp_paren,}, #line 15 "indent-cc.gperf" {"long", rw_decl,}, #line 40 "indent-cc.gperf" {"friend", rw_decl,}, #line 30 "indent-cc.gperf" {"while", rw_sp_paren,}, #line 34 "indent-cc.gperf" {"sizeof", rw_sizeof,}, #line 50 "indent-cc.gperf" {"operator", rw_operator,}, #line 37 "indent-cc.gperf" {"delete", rw_return,}, #line 8 "indent-cc.gperf" {"enum", rw_enum,}, #line 12 "indent-cc.gperf" {"const", rw_decl,}, #line 24 "indent-cc.gperf" {"void", rw_decl,}, #line 45 "indent-cc.gperf" {"typeof", rw_sizeof,}, #line 17 "indent-cc.gperf" {"typedef", rw_decl,}, #line 13 "indent-cc.gperf" {"float", rw_decl,}, #line 43 "indent-cc.gperf" {"virtual", rw_decl,}, #line 49 "indent-cc.gperf" {"bool", rw_decl,}, #line 42 "indent-cc.gperf" {"template", rw_decl,}, #line 47 "indent-cc.gperf" {"headof", rw_sizeof,}, #line 25 "indent-cc.gperf" {"volatile", rw_decl,}, #line 5 "indent-cc.gperf" {"break", rw_break,}, #line 14 "indent-cc.gperf" {"double", rw_decl,}, #line 26 "indent-cc.gperf" {"va_dcl", rw_decl,}, #line 38 "indent-cc.gperf" {"new", rw_return,}, #line 9 "indent-cc.gperf" {"default", rw_case,} }; static short lookup[] = { -1, -1, -1, 0, 1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, 46, -1, -1, -1, -1, 47 }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash_cc (str, len); if (key <= MAX_HASH_VALUE && key >= 0) { register int index = lookup[key]; if (index >= 0) { if (len == lengthtable[index]) { register const char *s = wordlist[index].rwd; if (*str == *s && !memcmp (str + 1, s + 1, len - 1)) return &wordlist[index]; } } } } return 0; } indent-2.2.11/src/Makefile.in0000644000177400010010000004425211331327361012635 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = indent$(EXEEXT) subdir = src DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/aclocal/UTIMBUF.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intdiv0.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_indent_OBJECTS = indent.$(OBJEXT) args.$(OBJEXT) backup.$(OBJEXT) \ comments.$(OBJEXT) lexi.$(OBJEXT) parse.$(OBJEXT) \ globs.$(OBJEXT) code_io.$(OBJEXT) output.$(OBJEXT) \ utils.$(OBJEXT) handletoken.$(OBJEXT) indent_OBJECTS = $(am_indent_OBJECTS) am__DEPENDENCIES_1 = indent_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(indent_SOURCES) DIST_SOURCES = $(indent_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ -DLOCALEDIR=\"${localedir}\" DEPDIR = @DEPDIR@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBINTL@ @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.2 gnits indent_SOURCES = indent.c args.c backup.c comments.c lexi.c parse.c globs.c code_io.c output.c utils.c handletoken.c noinst_HEADERS = indent.h args.h backup.h comments.h lexi.h parse.h globs.h code_io.h output.h utils.h sys.h libgettext.h handletoken.h indent_LDADD = $(INTLLIBS) EXTRA_DIST = @PACKAGE@.gperf @PACKAGE@-cc.gperf wildexp.c gperf.c gperf-cc.c \ @PACKAGE@.dsp \ config.h.vc++ \ config.h.vms BUILT_SOURCES = gperf.c gperf-cc.c INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/intl MAINTAINERCLEANFILES = Makefile.in libgettext.h @MAINTAINER_MODE_FALSE@AM_CFLAGS = -I. @MAINTAINER_MODE_TRUE@AM_CFLAGS = -g -Wall -I. all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnits src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) installcheck-binPROGRAMS: $(bin_PROGRAMS) bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad indent$(EXEEXT): $(indent_OBJECTS) $(indent_DEPENDENCIES) @rm -f indent$(EXEEXT) $(LINK) $(indent_OBJECTS) $(indent_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/args.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/code_io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comments.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handletoken.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: installcheck-binPROGRAMS maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installcheck-binPROGRAMS \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS gperf.c: indent.gperf gperf -D -c -l -p -t -T -g -j1 -o -K rwd -N is_reserved indent.gperf > gperf.c gperf-cc.c: indent-cc.gperf gperf -D -c -l -p -t -T -g -j1 -o -K rwd -N is_reserved_cc -H hash_cc indent-cc.gperf > gperf-cc.c @MAINTAINER_MODE_TRUE@config.h.vc++ config.h.vms @PACKAGE@.lsm :%: Makefile %.in @MAINTAINER_MODE_TRUE@ sed -e 's%!VERSION!%@VERSION@%g' $@.in > $@ @MAINTAINER_MODE_TRUE@@PACKAGE@.dsp: @PACKAGE@.dsp.in @MAINTAINER_MODE_TRUE@ cat $< | perl -e 'while (<>) {chomp; print "$$_\015\012"; }' > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: indent-2.2.11/src/utils.h0000644000177400010010000000177210775646104012113 00000000000000/** \file * * Copyright (c) 2008 Free Software Foundation, Inc. All rights reserved.
* * 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 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License version 3 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. * * HISTORY * - 2008-03-08 DI Creation */ #ifndef INDENT_UTILS_H #define INDENT_UTILS_H extern void DieError( int errval, const char * fmt, ...); #endif /* INDENT_UTILS_H */ indent-2.2.11/src/parse.h0000644000177400010010000000476610775646104012073 00000000000000/** \file * Copyright (c) 1999 Carlo Wood. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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 3 * of the License, or (at your option) any later version. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef INDENT_PARSE_H #define INDENT_PARSE_H #include "sys.h" /* for RCSTAG_H */ RCSTAG_H (parse, "$Id$"); #include "indent.h" extern int inc_pstack (void); extern void parse_lparen_in_decl (void); extern exit_values_ty parse (codes_ty tk); extern void init_parser (void); extern void reset_parser (void); extern void reduce (void); #endif /* INDENT_PARSE_H */ indent-2.2.11/src/lexi.h0000644000177400010010000000450410775646104011710 00000000000000/** \file * Copyright (c) 1999 Carlo Wood. All rights reserved. * * 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 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef INDENT_LEXI_H #define INDENT_LEXI_H #include "sys.h" /* for RCSTAG_H */ RCSTAG_H (lexi, "$Id$"); typedef enum rwcodes { rw_none, rw_operator, /*!< For C++ operator overloading. */ rw_break, rw_switch, rw_case, rw_struct_like, /*!< struct, union */ rw_enum, rw_decl, rw_sp_paren, /*!< if, while, for */ rw_sp_nparen, /*!< do */ rw_sp_else, /*!< else */ rw_sizeof, rw_return } rwcodes_ty; typedef enum codes { code_eof = 0, /*!< end of file */ newline, lparen, /*!< '(' or '['. Also '{' in an initialization. */ rparen, /*!< ')' or ']'. Also '}' in an initialization. */ start_token, unary_op, binary_op, postop, question, casestmt, colon, doublecolon, /*!< For C++ class methods. */ semicolon, lbrace, rbrace, ident, /*!< string or char literal, identifier, number */ overloaded, /*!< For C++ overloaded operators (like +) */ cpp_operator, comma, comment, /*!< A "slash-star" comment */ cplus_comment, /*!< A C++ "slash-slash" */ swstmt, preesc, /*!< '#'. */ form_feed, decl, sp_paren, /*!< if, for, or while token */ sp_nparen, /*!< do */ sp_else, /*!< else */ ifstmt, elseifstmt, whilestmt, forstmt, stmt, stmtl, elselit, dolit, dohead, dostmt, ifhead, elsehead, struct_delim, /*!< '.' or "->" */ attribute, /*!< The '__attribute__' qualifier */ number_of_codes } codes_ty; extern void addkey( char *key, rwcodes_ty val); extern codes_ty lexi(void); #endif /* INDENT_LEXI_H */ indent-2.2.11/src/libgettext.h0000644000177400010010000002242111331327346013111 00000000000000/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004-2006 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ # ifdef DEFAULT_TEXT_DOMAIN # undef gettext # define gettext(Msgid) \ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) # endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) # define dcgettext(Domainname, Msgid, Category) \ ((void) (Category), dgettext (Domainname, Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ ? ((void) (Msgid2), (const char *) (Msgid1)) \ : ((void) (Msgid1), (const char *) (Msgid2))) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) \ ((void) (Domainname), (const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) \ ((void) (Domainname), (const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* The separator between msgctxt and msgid in a .mo file. */ #define GETTEXT_CONTEXT_GLUE "\004" /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN # define pgettext(Msgctxt, Msgid) \ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category) { const char *translation = dcgettext (domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else return translation; } #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { const char *translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else return translation; } /* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID can be arbitrary expressions. But for string literals these macros are less efficient than those above. */ #include #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif #define pgettext_expr(Msgctxt, Msgid) \ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (translation != msg_ctxt_id) return translation; } return msgid; } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (!(translation == msg_ctxt_id || translation == msgid_plural)) return translation; } return (n == 1 ? msgid : msgid_plural); } #endif /* _LIBGETTEXT_H */ indent-2.2.11/src/parse.c0000644000177400010010000006250410775646104012060 00000000000000/** \file * Copyright (c) 1999, 2000 Carlo Wood. All rights reserved.
* Copyright (c) 1994 Joseph Arceneaux. All rights reserved.
* Copyright (c) 1985 Sun Microsystems, Inc.
* Copyright (c) 1980 The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved.
* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.
* * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * 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 3 * of the License, or (at your option) any later version. * * This file is subject to the terms of the GNU General Public License as * published by the Free Software Foundation. A copy of this license is * included with this software distribution in the file COPYING. If you * do not have a copy, you may obtain a copy by writing to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "sys.h" #include "indent.h" #include "parse.h" #include "globs.h" RCSTAG_CC ("$Id$"); parser_state_ty *parser_state_tos = NULL; #define INITIAL_BUFFER_SIZE 1000 #define INITIAL_STACK_SIZE 2 /** * */ extern void init_parser(void) { parser_state_tos = (parser_state_ty *) xmalloc (sizeof (parser_state_ty)); /* GDB_HOOK_parser_state_tos */ parser_state_tos->p_stack_size = INITIAL_STACK_SIZE; parser_state_tos->p_stack = (codes_ty *) xmalloc (INITIAL_STACK_SIZE * sizeof (codes_ty)); parser_state_tos->il = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int)); parser_state_tos->cstk = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int)); parser_state_tos->paren_indents_size = 8; parser_state_tos->paren_indents = (short *) xmalloc (parser_state_tos->paren_indents_size * sizeof (short)); /* Although these are supposed to grow if we reach the end, * I can find no place in the code which does this. */ combuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); labbuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); codebuf = (char *) xmalloc (INITIAL_BUFFER_SIZE); save_com.size = INITIAL_BUFFER_SIZE; save_com.end = save_com.ptr = xmalloc (save_com.size); save_com.len = save_com.column = 0; di_stack_alloc = 2; di_stack = (int *) xmalloc (di_stack_alloc * sizeof (*di_stack)); } /** * */ extern void reset_parser(void) { parser_state_tos->next = 0; parser_state_tos->tos = 0; parser_state_tos->p_stack[0] = stmt; /*!< this is the parser's stack */ parser_state_tos->last_nl = true; /*!< this is true if the last thing * scanned was a newline */ parser_state_tos->last_token = start_token; parser_state_tos->last_saw_nl = false; parser_state_tos->broken_at_non_nl = false; parser_state_tos->box_com = false; parser_state_tos->cast_mask = 0; parser_state_tos->noncast_mask = 0; parser_state_tos->sizeof_mask = 0; parser_state_tos->block_init = 0; parser_state_tos->block_init_level = 0; parser_state_tos->col_1 = false; parser_state_tos->com_col = 0; parser_state_tos->dec_nest = 0; parser_state_tos->i_l_follow = 0; parser_state_tos->ind_level = 0; parser_state_tos->last_u_d = false; parser_state_tos->p_l_follow = 0; parser_state_tos->paren_level = 0; parser_state_tos->paren_depth = 0; parser_state_tos->search_brace = false; parser_state_tos->use_ff = false; parser_state_tos->its_a_keyword = false; parser_state_tos->sizeof_keyword = false; parser_state_tos->in_parameter_declaration = false; parser_state_tos->just_saw_decl = 0; parser_state_tos->in_decl = false; parser_state_tos->decl_on_line = false; parser_state_tos->in_or_st = 0; parser_state_tos->want_blank = false; parser_state_tos->in_stmt = false; parser_state_tos->ind_stmt = false; parser_state_tos->procname = "\0"; parser_state_tos->procname_end = "\0"; parser_state_tos->classname = "\0"; parser_state_tos->classname_end = "\0"; parser_state_tos->pcase = false; parser_state_tos->dec_nest = 0; parser_state_tos->can_break = bb_none; parser_state_tos->saw_double_colon = false; parser_state_tos->il[0] = 0; parser_state_tos->cstk[0] = 0; save_com.len = save_com.column = 0; di_stack[parser_state_tos->dec_nest] = 0; l_com = combuf + INITIAL_BUFFER_SIZE - 5; l_lab = labbuf + INITIAL_BUFFER_SIZE - 5; l_code = codebuf + INITIAL_BUFFER_SIZE - 5; combuf[0] = codebuf[0] = labbuf[0] = ' '; combuf[1] = codebuf[1] = labbuf[1] = '\0'; else_or_endif = false; s_lab = e_lab = labbuf + 1; s_code = e_code = codebuf + 1; s_com = e_com = combuf + 1; line_no = 1; had_eof = false; break_comma = false; bp_save = 0; be_save = 0; if (settings.tabsize <= 0) { settings.tabsize = 1; } prefix_blankline_requested = 0; } /** * like ++parser_state_tos->tos but checks for stack overflow and extends * stack if necessary. */ extern int inc_pstack(void) { if (++parser_state_tos->tos >= parser_state_tos->p_stack_size) { parser_state_tos->p_stack_size *= 2; parser_state_tos->p_stack = (codes_ty *) xrealloc ((char *) parser_state_tos->p_stack, parser_state_tos->p_stack_size * sizeof (codes_ty)); parser_state_tos->il = (int *) xrealloc ((char *) parser_state_tos->il, parser_state_tos->p_stack_size * sizeof (int)); parser_state_tos->cstk = (int *) xrealloc ((char *) parser_state_tos->cstk, parser_state_tos->p_stack_size * sizeof (int)); } parser_state_tos->cstk[parser_state_tos->tos] = parser_state_tos->cstk[parser_state_tos->tos - 1]; return parser_state_tos->tos; } #ifdef DEBUG /** * */ static char **debug_symbol_strings; /** * */ extern void debug_init(void) { int size = ((int) number_of_codes) * sizeof (char *); debug_symbol_strings = (char **) xmalloc (size); debug_symbol_strings[code_eof] = "code_eof"; debug_symbol_strings[newline] = "newline"; debug_symbol_strings[lparen] = "lparen"; debug_symbol_strings[rparen] = "rparen"; debug_symbol_strings[start_token] = "start_token"; debug_symbol_strings[unary_op] = "unary_op"; debug_symbol_strings[binary_op] = "binary_op"; debug_symbol_strings[postop] = "postop"; debug_symbol_strings[question] = "question"; debug_symbol_strings[casestmt] = "casestmt"; debug_symbol_strings[colon] = "colon"; debug_symbol_strings[doublecolon] = "doublecolon"; debug_symbol_strings[semicolon] = "semicolon"; debug_symbol_strings[lbrace] = "lbrace"; debug_symbol_strings[rbrace] = "rbrace"; debug_symbol_strings[ident] = "ident"; debug_symbol_strings[overloaded] = "overloaded"; debug_symbol_strings[cpp_operator] = "cpp_operator"; debug_symbol_strings[comma] = "comma"; debug_symbol_strings[comment] = "comment"; debug_symbol_strings[cplus_comment] = "cplus_comment"; debug_symbol_strings[swstmt] = "swstmt"; debug_symbol_strings[preesc] = "preesc"; debug_symbol_strings[form_feed] = "form_feed"; debug_symbol_strings[decl] = "decl"; debug_symbol_strings[sp_paren] = "sp_paren"; debug_symbol_strings[sp_nparen] = "sp_nparen"; debug_symbol_strings[sp_else] = "sp_else"; debug_symbol_strings[ifstmt] = "ifstmt"; debug_symbol_strings[elseifstmt] = "elseifstmt"; debug_symbol_strings[whilestmt] = "whilestmt"; debug_symbol_strings[forstmt] = "forstmt"; debug_symbol_strings[stmt] = "stmt"; debug_symbol_strings[stmtl] = "stmtl"; debug_symbol_strings[elselit] = "elselit"; debug_symbol_strings[dolit] = "dolit"; debug_symbol_strings[dohead] = "dohead"; debug_symbol_strings[dostmt] = "dostmt"; debug_symbol_strings[ifhead] = "ifhead"; debug_symbol_strings[elsehead] = "elsehead"; debug_symbol_strings[struct_delim] = "struct_delim"; debug_symbol_strings[attribute] = "attribute"; } #endif /** * */ extern exit_values_ty parse ( codes_ty tk) /*!< the code for the construct scanned */ { int i; #ifdef DEBUG if (debug) { if (tk >= code_eof && tk < number_of_codes) { printf ("Parse: %s\n", debug_symbol_strings[tk]); } else { printf ("Parse: Unknown code: %d for %s\n", (int) tk, token ? token : "NULL"); } } #endif while ((parser_state_tos->p_stack[parser_state_tos->tos] == ifhead) && (tk != elselit)) { /* true if we have an if without an else */ /* apply the if(..) stmt ::= stmt reduction */ parser_state_tos->p_stack[parser_state_tos->tos] = stmt; reduce (); /* see if this allows any reduction */ } switch (tk) { /* go on and figure out what to do with the input */ case decl: /* scanned a declaration word */ parser_state_tos->search_brace = settings.braces_on_struct_decl_line; /* indicate that following brace should be on same line */ if ((parser_state_tos->p_stack[parser_state_tos->tos] != decl) && (parser_state_tos->block_init == 0)) { /* only put one declaration onto stack */ break_comma = true; /* while in declaration, newline should be * forced after comma */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = decl; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; if (settings.ljust_decl) { /* only do if we want left justified * declarations */ parser_state_tos->ind_level = 0; for (i = parser_state_tos->tos - 1; i > 0; --i) { if (parser_state_tos->p_stack[i] == decl) { /* indentation is number of declaration levels deep we are * times spaces per level */ parser_state_tos->ind_level += settings.ind_size; } } parser_state_tos->i_l_follow = parser_state_tos->ind_level; } } break; case ifstmt: /* scanned if (...) */ if (parser_state_tos->p_stack[parser_state_tos->tos] == elsehead) { parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; } case dolit: /* 'do' */ case forstmt: /* for (...) */ case casestmt: /* case n: */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = tk; parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; if (tk != casestmt) { parser_state_tos->i_l_follow += settings.ind_size; /* subsequent statements * should be indented */ } parser_state_tos->search_brace = settings.btype_2; break; case lbrace: /* scanned { */ break_comma = false; /* don't break comma in an initial list */ if (parser_state_tos->p_stack[parser_state_tos->tos] == stmt || parser_state_tos->p_stack[parser_state_tos->tos] == stmtl) { /* it is a random, isolated stmt group or a declaration */ parser_state_tos->i_l_follow += settings.ind_size; } else if (parser_state_tos->p_stack[parser_state_tos->tos] == decl) { parser_state_tos->i_l_follow += settings.ind_size; if ( ( (parser_state_tos->last_rw == rw_struct_like) || (parser_state_tos->last_rw == rw_enum)) && ( (parser_state_tos->block_init != 1) || (parser_state_tos->block_init_level == 0)) && (parser_state_tos->last_token != rparen) && (!settings.braces_on_struct_decl_line)) { parser_state_tos->ind_level += settings.struct_brace_indent; parser_state_tos->i_l_follow += settings.struct_brace_indent; } } else if (parser_state_tos->p_stack[parser_state_tos->tos] == casestmt) { parser_state_tos->ind_level += settings.case_brace_indent - settings.ind_size; parser_state_tos->i_l_follow += settings.case_brace_indent; } else { /* It is a group as part of a while, for, etc. */ /* Only do this if there is nothing on the line */ if (s_code == e_code) { parser_state_tos->ind_level -= settings.ind_size; } /* For -bl formatting, indent by settings.brace_indent additional spaces * e.g. if (foo == bar) { <--> settings.brace_indent spaces (in this * example, 4) */ if (!settings.btype_2) { parser_state_tos->ind_level += settings.brace_indent; parser_state_tos->i_l_follow += settings.brace_indent; } if (parser_state_tos->p_stack[parser_state_tos->tos] == swstmt) { parser_state_tos->i_l_follow += settings.case_indent; } } inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = lbrace; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; /* allow null stmt between braces */ parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; break; case whilestmt: /* scanned while (...) */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dohead) { /* it is matched with do stmt */ parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; parser_state_tos->ind_level = parser_state_tos->il[parser_state_tos->tos]; inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = whilestmt; parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; } else { /* it is a while loop */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = whilestmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; parser_state_tos->i_l_follow += settings.ind_size; parser_state_tos->search_brace = settings.btype_2; } break; case elselit: /* scanned an else */ if (parser_state_tos->p_stack[parser_state_tos->tos] != ifhead) { ERROR (_("Unmatched 'else'"), 0, 0); } else { /* indentation for else should be same as for if */ parser_state_tos->ind_level = parser_state_tos->il[parser_state_tos->tos]; /* everything following should be in 1 level */ parser_state_tos->i_l_follow = (parser_state_tos->ind_level + settings.ind_size); parser_state_tos->p_stack[parser_state_tos->tos] = elsehead; /* remember if with else */ parser_state_tos->search_brace = true; } break; case rbrace: /* scanned a } */ /* stack should have or */ if (parser_state_tos->p_stack[parser_state_tos->tos - 1] == lbrace) { parser_state_tos->i_l_follow = parser_state_tos->il[--parser_state_tos->tos]; parser_state_tos->ind_level = parser_state_tos->i_l_follow; parser_state_tos->p_stack[parser_state_tos->tos] = stmt; } else { ERROR (_("Stmt nesting error."), 0, 0); } break; case swstmt: /* had switch (...) */ inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = swstmt; parser_state_tos->cstk[parser_state_tos->tos] = settings.case_indent + parser_state_tos->i_l_follow; if (!settings.btype_2) { parser_state_tos->cstk[parser_state_tos->tos] += settings.brace_indent; } /* save current case indent level */ parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; /* case labels should be one level down from switch, plus * `settings.case_indent' if any. Then, statements should be the `settings.ind_size' * further. */ parser_state_tos->i_l_follow += settings.ind_size; parser_state_tos->search_brace = settings.btype_2; break; case semicolon: /* this indicates a simple stmt */ break_comma = false; /* turn off flag to break after commas in a * declaration */ if (parser_state_tos->p_stack[parser_state_tos->tos] == dostmt) { parser_state_tos->p_stack[parser_state_tos->tos] = stmt; } else { inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; } break; /* This is a fatal error which cases the program to exit. */ default: fatal (_("Unknown code to parser"), 0); } reduce (); /* see if any reduction can be done */ #ifdef DEBUG if (debug) { printf ("\n"); printf (_("ParseStack [%d]:\n"), (int) parser_state_tos->p_stack_size); for (i = 1; i <= parser_state_tos->tos; ++i) { printf (_(" stack[%d] => stack: %d ind_level: %d\n"), (int) i, (int) parser_state_tos->p_stack[i], (int) parser_state_tos->il[i]); } printf ("\n"); } #endif return total_success; } /** * NAME: reduce * * FUNCTION: Implements the reduce part of the parsing algorithm * * ALGORITHM: The following reductions are done. Reductions are repeated until * no more are possible. * * Old TOS New TOS [stmt] [stmt] [stmtl] [stmtl] [stmt] * [stmtl] do [stmt] dohead [dohead] [whilestmt] * [dostmt] if [stmt] "ifstmt" switch [stmt] [stmt] * decl [stmt] [stmt] "ifelse" [stmt] [stmt] for * [stmt] [stmt] while [stmt] [stmt] * "dostmt" while [stmt] * * On each reduction, parser_state_tos->i_l_follow (the indentation for the * following line) is set to the indentation level associated with the old * TOS. * * PARAMETERS: None * * RETURNS: Nothing * * GLOBALS: parser_state_tos->cstk parser_state_tos->i_l_follow = * parser_state_tos->il parser_state_tos->p_stack = parser_state_tos->tos = * * CALLS: None * * CALLED BY: parse * * HISTORY: initial coding November 1976 D A Willcox of CAC * */ extern void reduce(void) { int i; for (;;) { /* keep looping until there is nothing left to reduce */ switch (parser_state_tos->p_stack[parser_state_tos->tos]) { case stmt: switch (parser_state_tos->p_stack[parser_state_tos->tos - 1]) { case stmt: case stmtl: /* stmtl stmt or stmt stmt */ parser_state_tos->p_stack[--parser_state_tos->tos] = stmtl; break; case dolit: /* [do] [stmt] */ parser_state_tos->p_stack[--parser_state_tos->tos] = dohead; parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; break; case ifstmt: /* [if] [stmt] */ parser_state_tos->p_stack[--parser_state_tos->tos] = ifhead; for (i = parser_state_tos->tos - 1; ( (parser_state_tos->p_stack[i] != stmt) && (parser_state_tos->p_stack[i] != stmtl) && (parser_state_tos->p_stack[i] != lbrace)); --i) { } parser_state_tos->i_l_follow = parser_state_tos->il[i]; /* for the time being, we will assume that there is no else on * this if, and set the indentation level accordingly. If an * else is scanned, it will be fixed up later */ break; case swstmt: /* [switch] [stmt] */ case decl: /* finish of a declaration */ case elsehead: /* [[if] [stmt] else] [stmt] */ case forstmt: /* [for] [stmt] */ case casestmt: /* [case n:] [stmt] */ case whilestmt: /* [while] [stmt] */ parser_state_tos->p_stack[--parser_state_tos->tos] = stmt; parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos]; break; default: /* [anything else] [stmt] */ return; } /* end of section for [stmt] on top of stack */ break; case whilestmt: /* while (...) on top */ if (parser_state_tos->p_stack[parser_state_tos->tos - 1] == dohead) { /* it is termination of a do while */ parser_state_tos->p_stack[--parser_state_tos->tos] = dostmt; break; } else return; default: /* anything else on top */ return; } } } /** * This kludge is called from main. It is just like parse(semicolon) except * that it does not clear break_comma. Leaving break_comma alone is * necessary to make sure that "int foo(), bar()" gets formatted correctly * under -bc. */ extern void parse_lparen_in_decl(void) { inc_pstack (); parser_state_tos->p_stack[parser_state_tos->tos] = stmt; parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level; reduce (); } indent-2.2.11/ABOUT-NLS0000644000177400010010000006015711041664102011225 00000000000000Notes on the Free Translation Project ************************************* Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work at translations should contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. Quick configuration advice ========================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. INSTALL Matters =============== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will respectively bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might be not what is desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. Using This Package ================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your country by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. Translating Teams ================= For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. Available Packages ================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of August 2002. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files be bg ca cs da de el en eo es et fi fr +----------------------------------------+ a2ps | [] [] [] [] | ap-utils | | bash | [] [] [] [] | bfd | [] [] | binutils | [] [] | bison | [] [] [] [] | clisp | | clisp | [] [] [] [] | clisplow | | cpio | [] [] [] [] | darkstat | () | diffutils | [] [] [] [] [] [] | enscript | [] [] | error | [] [] [] | fetchmail | [] () [] [] [] () | fileutils | [] [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] [] [] | gas | [] [] | gawk | [] [] [] | gcal | [] [] | gcc | [] [] | gettext | [] [] [] [] [] | gnupg | [] [] [] [] [] [] [] | gprof | [] [] | gpsdrive | () () () () () | grep | [] [] [] [] [] [] [] [] | gretl | [] | gthumb | () () () | hello | [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] | indent | [] [] [] [] [] | jpilot | () [] [] [] | jwhois | [] [] | kbd | [] [] [] | ld | [] [] | libc | [] [] [] [] [] [] [] [] | libiconv | [] [] [] [] | lifelines | () () | lilypond | [] [] | lingoteach | [] [] | lingoteach_lessons| () () | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] | make | [] [] [] [] | man-db | [] () () [] () () | mysecretdiary | [] [] [] | nano | [] () [] [] [] [] | nano_1_0 | [] () [] [] [] [] | opcodes | [] [] [] | parted | [] [] [] [] [] | ptx | [] [] [] [] [] [] [] | python | | recode | [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] [] | sh-utils | [] [] [] [] | sharutils | [] [] [] [] [] [] [] | sketch | () [] () | soundtracker | [] [] [] | sp | [] | tar | [] [] [] [] [] [] | texinfo | [] [] [] [] [] | textutils | [] [] [] [] [] | util-linux | [] [] [] [] [] [] | vorbis-tools | [] | wastesedge | | wdiff | [] [] [] [] [] [] | wget | [] [] [] [] [] [] [] [] [] [] | +----------------------------------------+ be bg ca cs da de el en eo es et fi fr 0 2 19 10 30 44 9 1 12 44 17 6 53 gl he hr hu id it ja ko lv nb nl nn +-------------------------------------+ a2ps | () () [] | ap-utils | | bash | [] | bfd | [] | binutils | [] | bison | [] [] [] [] | clisp | | clisp | [] | clisplow | | cpio | [] [] [] [] | darkstat | | diffutils | [] [] [] [] [] | enscript | [] [] | error | [] | fetchmail | [] | fileutils | [] [] [] | findutils | [] [] [] [] [] [] [] [] | flex | [] | gas | | gawk | [] | gcal | | gcc | [] | gettext | [] [] | gnupg | [] [] [] [] | gprof | [] | gpsdrive | [] () () | grep | [] [] [] [] [] [] [] | gretl | | gthumb | () () | hello | [] [] [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] | indent | [] [] [] [] | jpilot | () () | jwhois | [] [] | kbd | | ld | | libc | [] [] [] [] | libiconv | [] [] [] | lifelines | | lilypond | [] | lingoteach | [] | lingoteach_lessons| | lynx | [] [] [] [] | m4 | [] [] [] [] | make | [] [] [] [] [] [] | man-db | () () | mysecretdiary | [] | nano | [] [] [] [] | nano_1_0 | [] [] [] [] [] | opcodes | [] [] | parted | [] [] [] | ptx | [] [] [] [] [] | python | | recode | [] [] [] | sed | [] [] [] [] [] [] [] [] | sh-utils | [] [] [] | sharutils | [] [] [] | sketch | () | soundtracker | [] [] | sp | | tar | [] [] [] [] [] [] | texinfo | [] [] [] | textutils | [] [] [] [] | util-linux | () [] | vorbis-tools | [] | wastesedge | | wdiff | [] [] [] | wget | [] [] [] [] [] [] | +-------------------------------------+ gl he hr hu id it ja ko lv nb nl nn 23 9 12 19 16 13 26 9 1 7 19 3 no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW +----------------------------------------------+ a2ps | () () () [] [] [] [] [] | 10 ap-utils | () | 0 bash | [] | 6 bfd | [] [] | 5 binutils | [] [] | 5 bison | [] [] [] [] | 12 clisp | | 0 clisp | | 5 clisplow | | 0 cpio | [] [] [] [] | 12 darkstat | [] [] () () | 2 diffutils | [] [] [] [] [] [] | 17 enscript | [] [] [] [] | 8 error | [] [] [] | 7 fetchmail | () () [] | 6 fileutils | [] [] [] [] [] [] | 14 findutils | [] [] [] [] [] [] [] | 21 flex | [] [] [] | 9 gas | [] | 3 gawk | [] [] | 6 gcal | [] [] | 4 gcc | [] | 4 gettext | [] [] [] [] [] [] | 13 gnupg | [] [] [] | 14 gprof | [] [] | 5 gpsdrive | [] [] | 3 grep | [] [] [] [] [] | 20 gretl | | 1 gthumb | () () [] | 1 hello | [] [] [] [] [] [] [] | 28 id-utils | [] [] [] [] | 9 indent | [] [] [] [] [] | 14 jpilot | () () [] [] | 5 jwhois | [] () () [] [] | 7 kbd | [] [] | 5 ld | [] [] | 4 libc | [] [] [] [] [] [] | 18 libiconv | [] [] [] [] [] | 12 lifelines | [] | 1 lilypond | [] | 4 lingoteach | [] [] | 5 lingoteach_lessons| () | 0 lynx | [] [] [] [] | 13 m4 | [] [] [] [] | 13 make | [] [] [] [] [] | 15 man-db | | 3 mysecretdiary | [] [] [] | 7 nano | [] [] [] [] | 13 nano_1_0 | [] [] [] [] | 14 opcodes | [] [] [] | 8 parted | [] [] [] [] | 12 ptx | [] [] [] [] [] [] [] | 19 python | | 0 recode | [] [] [] [] [] [] | 15 sed | [] [] [] [] [] [] | 24 sh-utils | [] [] | 9 sharutils | [] [] [] [] | 14 sketch | [] () [] | 4 soundtracker | [] | 6 sp | | 1 tar | [] [] [] [] [] [] [] | 19 texinfo | [] [] | 10 textutils | [] [] [] [] [] | 14 util-linux | [] [] [] | 10 vorbis-tools | [] | 3 wastesedge | | 0 wdiff | [] [] [] [] [] | 14 wget | [] [] [] [] [] [] [] [] | 24 +----------------------------------------------+ 37 teams no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW 68 domains 4 15 2 28 28 12 10 49 43 4 1 9 609 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If August 2002 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. Using `gettext' in new packages =============================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle to use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `translation@iro.umontreal.ca' to make the `.pot' files available to the translation teams. indent-2.2.11/COPYING0000644000177400010010000010451310775646104011043 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . indent-2.2.11/ChangeLog-20010000644000177400010010000007225010775646104012144 000000000000002001-11-24 david ingamells * Makefile.am: *** empty log message *** 2001-11-23 david ingamells * Makefile.am: *** empty log message *** 2001-10-16 david ingamells * Makefile.am, indent-cc.gperf, indent.c, indent.gperf, indent.h, io.c, io.h, lexi.c, lexi.h, parse.c, parse.h, sys.h, wildexp.c, args.c, args.h, backup.c, backup.h, comments.c, comments.h, globs.c, globs.h: Directory re-organise and adapt setup files. 2001-10-15 david ingamells * lexi.c: multi-line strings. * indent.c: more cleanup 2001-10-09 david ingamells * backup.c, comments.c, globs.c, io.c, lexi.c, parse.c: Code cleanup 2001-10-04 david ingamells * args.c, backup.c: Code clean-up. * indent.c: Code clean-up. No (intended) functional changes. 2001-09-05 carlo * parse.c: Added Taiwanese translation by Franklin W. 2001-09-03 carlo * args.c, backup.c, globs.c, globs.h, indent.c, indent.h, io.c, lexi.c, parse.c, wildexp.c: Added support for i18n. 2001-07-11 carlo * lexi.c: Bug fix for operator declarations. 2001-04-07 carlo * backup.c, indent.c, io.c: Date: Thu, 7 Dec 2000 11:54:31 -0500 From: "Town, Brad" Subject: Compiling indent under Cygwin Cygwin defines _WIN32 by default, but it acts much more like Unix. Thus, some Win32-specific things added to indent-2.2.6 are being enabled under Cygwin when they shouldn't be. The attached patches remedy the situation. They simply all occurrences of #ifdef _WIN32 to #if defined (_WIN32) && !defined (__CYGWIN__) Brad Town 2000-12-12 carlo * args.c: Ugh, I fixed the wrong line last time (typo fix for no-tabs). 2000-11-30 carlo * args.c: Correction of alphabetic ordering in args.c 2000-11-20 carlo * sys.h: Date: Mon, 20 Nov 2000 12:50:14 +0100 From: Martin Kraemer Subject: [Suggest] EBCDIC auto-detection ... With the following patch, even the OS-dependency on BS2000 (by way of the pre-defined symbol _OSD_POSX) can be eliminated. That means indent "should" compile correctly also on (IBM's) OS390 machines. * args.c: Typo fix for --no-tabs. 2000-11-17 carlo * args.c, backup.c, backup.h, comments.c, globs.c, globs.h, indent.c, indent.h, io.c, lexi.c, parse.c, sys.h, wildexp.c: Ran indent through indent, using -gnu -nhnl -l120. Updated copyright info. * wildexp.c: Removed the carriage returns. * indent.c, comments.c: Date: Thu, 16 Nov 2000 10:28:34 +0100 From: Robert Laufer I get a memory fault for the attached file foobar.c, if i execute the command indent -st --dont-break-procedure-type foobar.c If i write void bar (void) the error does not occur. Also the identing does not work correct for comments between the procedure declaration and the opening bracket, see procedure foo. This does only happen with the option --dont-break-procedure-type. * comments.c: Date: Wed, 15 Nov 2000 23:12:24 -0800 (PST) From: Michael Deutschmann BTW, I have one other problem to report. This one I've actually known about for awhile, but hadn't thought to report it as the workaround is easy: int main (int argc, char **argv) { /* The mostly-blank line following: * * Can cause trouble with indent if -sc is not used. */ return 0; } If "indent -sc" is used, this file is not changed. But indent without "-sc" removes the star on the blank line. Worse, if indent -sc is used on the damaged file, the star is restored but then extra stars are added to the remaining lines. (So a cycle of "indent foo.c; indent -sc foo.c; indent foo.c; indent -sc foo.c" and on does progressively worse damage to the file. --- Actually, it only removed a star on a blank line when it was the second line of the comment (this line is used to determine if something is a block comment or not). --Carlo * indent.c: Give force_nl the meaning it really has. Then actually force a newline when it is set at the last place where we didn't. This fixes the bug that under certain cicumstances a line wasn't broken where it should. 2000-11-16 carlo * io.c, indent.c: This fixes an old bug, reported by at the beginning of 2000. Possible break points were skipped under circumstances that did dependant on where a line was broken, resulting in an alternating output (after subsequent runs of indent). This was a hard one to find :/ * args.c, indent.c, indent.h: Added new option --break-function-decl-args (-bfda). Initial patch provided by Robert Lipe . * indent.c: Date: Wed, 22 Mar 2000 16:00:18 -0500 (EST) From: Jim Rogers I don't expect the -di option to apply to function declartions when -npsl is used. for example, if -npsl and -di16 is used: void main() { } -- I think he is right and I changed this behaviour. However, it does not work for nested functions: those are still indented. 2000-11-15 carlo * args.c: Date: Wed, 12 Apr 2000 15:07:58 +0200 From: "Borkhuis, Johan" The defaults are read from the struct pro. For boolean types there are 2 entries in this table, the positive and the negative (with an n in front). One of the items in the struct is p_special. This items is used to indicate if a the value of a boolean should be inserted as a default or not. But this does not work. The code as it is now (in the current 2.2.5 release) in the function set_defaults: for (p = pro; p->p_name; p++) if (p->p_type == PRO_BOOL || p->p_type == PRO_INT) *p->p_obj = p->p_default; To get this to work the code should be changed to: for (p = pro; p->p_name; p++) if ((p->p_type == PRO_BOOL) && (p->p_special == ON) || p->p_type == PRO_INT) *p->p_obj = p->p_default; Here a check if p_special is set to ON is inserted to check if this value may be used as a default. * args.c, indent.c, indent.h: New options to suppress spaces after if, for and while respectively. * indent.c: Fixed indentation of nested function. Bug report by Michael Deutsch. * indent.c, lexi.c: Treat return types of functions correctly even when they are not explicitely given with the -T option. * comments.c: Don't add blank lines after declarations when we're in the middle of a C-style comment that continues on the next line. Reported by David Hui. 2000-11-12 carlo * io.c: Fixed the -nlp bug (finally) 2000-11-10 carlo * indent.c, wildexp.c: Wild card expansion for win32 by "John Bridges" * indent.c: Stop indent from core dumping on C++ code (it still won't indent correctly). 2000-11-08 carlo * backup.c, indent.c, sys.h: Support for mingw32 by Sudhi Herle 2000-10-10 carlo * lexi.c: Eat backslashes of backslash-newline when occuring outside a macro definition or literal string. Bug report by Alex Cherepanov: Indent cannot handle trailing '\' outside of the macro or string. Don't ask me why some programs use it there. 2000-10-06 carlo * args.c, args.h, indent.c, io.c: Set the max. comment column to the max. code column if no -lc option was given. Fixes a compiler warning in io.c. Patch by John Bridges" * lexi.c: Move a piece of example code outside a table, otherwise indent gets confused (when running it on itself). 2000-09-11 carlo * indent.c: Fix a type that caused types inside sizeof() as to be treated declarations. Bug reported by Daniel Diaz. * comments.c: Bug fix: do NOT collapse spaces in comments unless actually formatting them! * comments.c: Don't eat spaces that follow a '.'. <-- Like those (allow two spaces). 2000-09-09 carlo * comments.c: Ok... collapse all adjacent spaces in comments into one when formatting comments. * comments.c: Bug fix for previous change. 2000-09-08 carlo * comments.c: bug fix for previous change * comments.c: Bug fixes for -fca, reported by John C. Oppenheimer. 2000-07-17 carlo * args.c: Renamed --blank-lines-after-block-comments to --blank-lines-before-block-comments. 2000-07-06 carlo * args.c, indent.c, indent.h: New option --cuddle-do-while. Sorry, I forgot who wrote this patch... 2000-04-02 carlo * args.c, indent.h, io.c: New options -ut and -nut (--use-tabs, --no-tabs). Fixed a few bugs and added documentation for these options, starting of with a patch from Sean Cavanaugh. From: "Sean Cavanaugh" To: Subject: indent 2.2.5 patch Date: Sat, 1 Apr 2000 15:31:21 -0800 I recently pulled down indent 2.2.5 and was surprised to find it didn't have an option to convert tabs to spaces. I've added a command line switch '-no-tabs' or '-nt' which lets you alter the default behavior. It is a pretty simple change, and handy for those of us who hate tabs :) - Sean 2000-03-23 carlo * comments.c: Fixed -dN again (bug report by Marc Herbert) 2000-03-03 carlo * indent.c, lexi.c: Compiler warning bug fix for 64-bit machines. 2000-03-01 carlo * lexi.c: Date: Sat, 19 Feb 2000 10:30:17 -0700 (MST) From: "Nelson H. F. Beebe" Subject: indent-2.2.5: a bug, and some compiler warnings To: indent@alinoe.com indent-2.2.5 and earlier incorrectly converts int x = 2LU; to int n = 2L U; causing subsequent compilation failures. Curiously, the equivalent form 2UL is handled correctly. However, Section 3.1.3.2 of ANSI X3.159-1989 clearly permits either order of the modifier letters. * io.c: Fixed a bug reported by David Hull . 2000-02-25 carlo * io.c: From: "Sayre, Alan N" Subject: indent mods Date: Tue, 25 Jan 2000 07:36:00 -0600 ... I believe that the tests originated in MSDOS living in a 16-bit world. Ints are now 32-bit. (The code ran fine with this conditional removed). A more portable check would be to test the sizeof ints. ... * backup.c: Date: Fri, 17 Dec 1999 17:52:32 -0500 (EST) From: Pavel Roskin Subject: Yet two patches To: indent@runaway.xs4all.nl Hello! Since I'm hacking GNU Indent anyway... 1) Using low-level I/O for backup files is not justified, decreases portability (especially create() and 0666) and may affect execution speed (since it's not buffered). backup.diff fixes it. 2) Since GNU Indent has good chances to be portable across all platforms (especially after the above fix), it is a good idea to use AC_EXEEXT and AC_OBJEXT. Those macros are not very robust now, but they still simplify the life on DOS-derived OS'es. configure.diff adds them. Best wishes, Pavel Roskin * indent.c, io.c: Bug fix per suggestion by Igor Lyubashevskiy * comments.c: Bug reported by Wayne Green (-npls switch and c++ style comments) 2000-02-14 carlo * comments.c: Date: Wed, 9 Feb 2000 17:55:55 -0600 From: Robert Lipe Subject: patch for --cdb To: indent@alinoe.com Here is a patch to "fix" -cdb. According to comments.c `comment_delimiter_on_blankline' ("cdb"): If set, place the comment delimiters on lines by themselves. This only affects comments which are not to the right of code. Unfortunately, the code doesn't seem to successfully take the presence or absence of preceeding code into account. $ cat /tmp/x.c int foo; /* This is a single line comment */ /* this is a column zero real single line comment */ /* this is elgible for cdb. */ $ ./indent -st -cdb /tmp/x.c int foo; /* This is a single line comment */ /* this is a column zero real single line comment */ /* this is elgible for cdb. */ With this patch installed, it returns: $ ./indent -st -cdb /tmp/x.c int foo; /* This is a single line comment */ /* this is a column zero real single line comment */ /* this is elgible for cdb. */ Though this specific example might look silly, it's very useful for cases where you're closing up a chain of loops and have } /* loop of l */ } /* loop of k */ } /* loop of j */ } /* loop of i */ * indent.c, io.c, lexi.h, parse.c: Hm, the DEBUG code should probably be removed, but until then: I fixed it. 2000-01-16 carlo * io.c: Date: Thu, 16 Dec 1999 10:43:45 -0500 (EST) From: Pavel Roskin Subject: Strange declaration alignment in C++ ... I have noticed that indent formats variable declarations quite differently in C functions and C++ methods. If the function name doesn't contain two colons, the variable names are placed on the same line and their types. ... int qs () { int i; } int q::s () { int i; } Date: Fri, 17 Dec 1999 12:33:34 -0500 (EST) From: Pavel Roskin Subject: Strange declaration alignment in C++ - solved! The attached patch fixes the problem with variables in C++ methods. dumpline() used to compare "s_code_corresponds_to" with "parser_state_tos->procname" 1999-12-31 carlo * indent.c: Don't join procedure declaration lines that ends on a '(' when followed by a comment when --dont-break-procedure-type is used. Ie: int func( // became int func( // char* c) char* c) { } { } * io.c, sys.h: Date: Mon, 29 Nov 1999 09:43:01 -0600 From: forrest.cahoon@merrillcorp.com Support for VMS/DECC. 1999-11-17 carlo * io.c: Date: Tue, 16 Nov 1999 22:59:44 -0000 From: "ALAN BORER" Because I am now using DJGPP to compile the code, I now get a 32 bit DPMI protected executable which is capable of processing files exceeding 64kByte. Would you please consider incorporating in file IO.C the following patch :- replace each of two instances of "#ifdef __MSDOS__" with "#if defined (__MSDOS__) && ! defined (__DJGPP__)". Regards Alan Borer. 1999-11-12 carlo * io.c: Prefer to break before __attribute__ over after a comma (which might be one paren level deeper even). * args.c, parse.c: Accept negative values for indent options. * parse.c: Date: Thu, 11 Nov 1999 00:23:59 -0000 From: "ALAN BORER" Subject: Indent Bug The code subject to a "case :" is indented relative to the case label UNLESS the option "-br" is asserted, in which case the code is indented relative to the "switch " instruction. I show below a screen dump illustrating this :- C:\t>indent t.c -st -npro -cli8 switch (x) { case 1: ++x; break; } C:\t>indent t.c -st -npro -cli8 -br switch (x) { case 1: ++x; break; } * indent.c: Allow non-ANSI `switch(i) { /*...*/ default: }' (no statement after last case label). 1999-11-09 carlo * indent.h, args.c, indent.c: New option --space-after-parentheses (-prs) by Emil LAURENTIU . Bug fixes in args.c and documentation update by me. 1999-11-04 carlo * io.c: Bug fix: When the s_code buffer needed to be realloc-ed, bufbreak `ptr' were pointing into cyber space. Now using an offset relative to the start of the buffer for the break points. * backup.c: Date: Sun, 24 Oct 1999 23:03:30 -0400 From: "Chris F.A. Johnson" Subject: "GNU indent" I have made a modification (included as the output of "diff -c" which allows zero padding of numbered backup suffixes, controled by an environment variable, VERSION_WIDTH. If the variable is set to a positive integer, that width will be used to zero-pad the backup suffix, e.g. if VERSION_WIDTH=2 the suffix would be ~01~ instead of ~1~. This improves alphabetical listing (with ls or a file requestor) when there are more than 10 backup versions. It may sound like overkill, but I have my text editor set to create a numbered backup with every save, and often there are more than 10 (even 20 or 30). -- two bug fixes and update of documentation by Carlo Wood 1999-10-30 carlo * indent.c: Ignore requests for (extra) blank lines prior to #else, #elif and #endif. 1999-10-26 carlo * comments.c, indent.c, parse.c: Removed a few compiler warnings (mostly unused variables) reported to me by Nelson H. F. Beebe. * indent.c: Fixed bug causing --braces-on-if-line not to put a '{' brace on the same line as a '}' automatically on the next line. Bug reported by David Luyer. 1999-10-11 carlo * indent.c: Treat #elif correctly. Thanks to Stuart Kemp for the bug report. 1999-10-10 carlo * indent.c: indent didn't recognize "# else" and "# endif" for what they are due to the space(s). Thanks to Stuart Kemp for the bug report. 1999-09-30 carlo * indent.c: Fixed bit fields - the "support" for public:/private:/protected: broke bits fields when another type then `int' was used. Thanks to Simon Munton for the bug report! Also fixed public:/private:/protected: labels really now. 1999-09-28 carlo * io.c, parse.c: Fixed a problem when indenting multiple files: the second and subsequent files specified on the command line had a blank line inserted at the top of the file when the previous file ended on a function definition. Thanks to Simon Munton for reporting this. 1999-09-03 carlo * indent.c, lexi.c: The '(' in constructs like char a[(1)] = { ... }; caused block_init not to be set. 1999-08-27 carlo * lexi.c, sys.h: EBCDIC charset support for BS2000/POSIX (Siemens mainframe OS). Contributed by . * args.c, indent.c, io.c, lexi.c: From: malekith@ikar.mps.com.pl Date: Thu, 26 Aug 1999 15:06:10 +0200 (CEST) To: indent@runaway.xs4all.nl Subject: Additional C++ support in indent (diff) What have I done? 1. I removed -c++ arg check from indent.c, since it didn't work anyway (try) and put into args.c. I think you put it in indent.c because you wanted different set of options for C++, an I right? But for now ... 2. In io.c I changed compute_label_target() func. Now if in_decl and c_plus_plus it returns one indent level back for labels, e.g. [...deleted... this is still broken --Carlo ] 3. I've added second set of keywords and hash func. This is in lexi.c. Lack of ``try'' keyword is intended. It caused errors (nested stmts or something). I couldn't handle this. 4. Added recognizing GNU C++ >? and ?= and * io.c: Bug report by Darius Powell: When the parser sees a left brace it clears the procedure name out but not the classname ... 1999-08-07 carlo * args.c, backup.c, backup.h, indent.c, indent.h, io.c, io.h, sys.h: New option --preserve-mtime: Preserve modification times on output files. Preserve modification times on backup files. Thanks to Ian P. Springer for the idea. 1999-08-05 carlo * lexi.c: enum bug also occurs with enum as function parameter. Again, thanks to Simon Munton for the report. 1999-08-04 carlo * lexi.c: Function returning enum bug fix. Thanks to Simon Munton for the report. * globs.c: Don't include malloc.h if we don't have it. 1999-07-29 carlo * indent.c: Make -bap work again. Reported by Andy Cowling. * parse.c: Fixes a bug reported by George Kiewicz: struct X x = { M(int) }; * args.c: Static is already zero. These zeros aren't even initialisation values anyway. 1999-07-22 carlo * indent.c: Don't put a space after the "gettext" macro's '_' and 'N_', thanks to Akim Demaille for reporting this. * io.c, io.h, indent.c: Don't indent a broken line to the ind_dec column. * io.c, io.h: More bug fixes by Kaveh R. Ghazi * comments.c, indent.c, indent.h: Comments counting bug fix by Santiago Vila. Removed unused variable out_coms. 1999-07-17 carlo * args.c, args.h, backup.c, backup.h, comments.c, comments.h, globs.c, globs.h, indent.c, indent.h, io.c, io.h, lexi.c, lexi.h, parse.c, parse.h, sys.h: Code formatting (run it through indent as well). * args.c, args.h, backup.c, backup.h, comments.c, comments.h, globs.c, globs.h, indent.c, indent.h, io.c, io.h, lexi.c, lexi.h, parse.c, parse.h, sys.h: Put a semicolon after the RCS macros: indent doesn't like when the semicolon is missing in the source file :/. * args.c, args.h, backup.c, backup.h, comments.c, comments.h, globs.c, globs.h, indent.c, indent.h, io.c, io.h, lexi.c, lexi.h, memcpy.c, parse.c, parse.h, sys.h: Added prototypes. De-ANSI-fied some inconsistent places. Removed memcpy.c. Should compile with a K&R compiler again now. Thanks to Kaveh R. Ghazi for report: The following are some patches I needed to get indent-2.1.1 working on SunOS4 using cc. A couple of notes: 1. You may wish to use the AM_C_PROTOTYPES macro from automake-1.4. It'll define PROTOTYPES in config.h if they are available. I had the test in sys.h check for it assuming you would use it when I defined the PARAMS macro to handle prototypes. 2. The way memcpy is handled seems like overkill. You do AC_CHECK_FUNCS and define it to bcopy if not there. You also call AC_REPLACE_FUNCS. You also hard code including memcpy.c in the sources. It seems to me that doing just the first check and defining it in sys.h is enough. Get rid of the REPLACE check and the file memcpy.c file. 3. If you insist on prototyping free() for some reason, at least check whether the system already defines it for you. I ran into conflicts with SunOS defining it to "extern int free()" and your source did "extern void free()" which bombed. You can find various ways of doing this, egcs-1.1.2 has a NEED_DECLARATIONS check which works well. 4. If you insist on using ANSI style function definitions, you should do it everywhere and use automake's ansi2knr option for older systems. Until then, I un-ANSI-fied the inconsistent places where it appeared. * indent.c, indent.h, parse.c: Detect the `const' qualifier more reliable. Thanks to bug report by Lars Hecking. 1999-07-16 carlo * sys.h: Don't combine memmove and memcpy detection: SunOS 4.1.4 doesn't have memmove, according to Nico Kadel-Garcia. 1999-07-09 carlo * globs.c: Need to include , some OS define errno as macro. * io.c, sys.h: Renamed SYS_READ to INDENT_SYS_READ because of a name collision on HPUX. 1999-07-04 carlo * indent.h, io.c, lexi.c, parse.c, indent.c: Added break points at non-spaces (after scope resolution operator, the global operator, member selection operators, and before subscripting, function calls and value constructions (all left brackets thus)). Also assigned a rough priority to them to keep the members of higher prioritized binary operators together. 1999-07-02 carlo * indent.c: There is something very wrong with `flushed_nl' and how new-lines are handled. Can't put my finger on it, so I wrote this kludge to fix one particular bug related to `else' and comments. * indent.c, indent.h, lexi.c, parse.c, args.c: Removed old option -ei. Fixed indentation problem broken `else if' lines. 1999-07-01 carlo * io.c: set_next_buf_break(): Corrected errornous calculation of bb->col, which caused certain possible break points to be missed. * io.c: Break lines, that can not be broken before max_col, at the first possible break point. * indent.c, indent.h, io.c: Bug fix of initializer indentation. 1999-06-30 carlo * indent.c: Bug fix. Not sure why I added this in the first place :/. * indent.c, io.c: Don't output a blank line after an else when a comment follows. Don't break after a boolean operator if we just broke before it. 1999-06-26 carlo * indent.c, io.c: Break long lines that are still too long after breaking the first time but caused dump_line to be called only after being read complete already: Don't reset `break_line' in `dump_line()' when a line is still too long. 1999-06-25 carlo * args.c, indent.h, parse.c: Do not indent braces of struct, union and enum. New option --struct-brace-indentN to specify indentation. * args.c, comments.c, indent.c, indent.h, io.c, lexi.c, parse.c: Fixed breaking long lines. New options: --honour-newlines/--ignore-newlines and --break-before-boolean-operators/--break-after-boolean-operators 1999-06-06 carlo * comments.c: Let comments inside code always start in the column where code would start. * args.c, indent.c, indent.h, io.c: Removed every trace of '-troff' nonsense. 1999-06-05 carlo * indent.c: Don't join a list list of comma seperated declarations that are on different lines in the input file when there is a comment following the comma. * comments.c, io.c: Fix indentation of comments in declarations. * backup.c: Bug fixes for VERSION_CONTROL=never|none. * indent.c: Always call dumpline() when we read a new-line and we already have a label or a preprocessor directive. * indent.c: Bug fix for __attribute__. * lexi.c: Bug fix for elipsis. 1999-06-04 carlo * lexi.c: Bug fix: lexi() can be called with buf_ptr == buf_end! * comments.c: Increment input file line count for new-lines in comments too (Thanks to Simon Munton for reporting it). 1999-06-03 carlo * backup.c, sys.h: USG is not used anymore. Handle AC_HEADER_DIRENT by the book (the autoconf manual). * comments.c, indent.c: Improved GDB_HOOK stuff. 1999-06-02 carlo * indent.c: Regression/bug fix: Don't do a continuation indent after already indenting to column `dec_ind'. * args.c: Reordered the pro[] table(s) reverse alphabetically (and fixed a few bugs in it that didn't have any effect before this re-ordering). 1999-06-01 carlo * indent.c, indent.h, io.c: Patch of indent.c revision 1.5 redone. Regression fix try two: Don't indent a procname when at start of a line. * indent.c, parse.c: Semi-automated generation of .gdbinit. Added WATCH hooks for the local variables of indent() and for parser_state_tos. * args.c: Ok, that was ONLY -nlps versus -nlp, AND two options of 1.10 (-brs and -bls). And the way I fixed it broke the -T option. * args.c: Allow K&R compilers to compile indent, and allow to build in a different directory than the source directory. (Thanks to Kaveh R. Ghazi). * indent.c, indent.h, lexi.c, parse.c: Regression fix: Treat enum block as initialization block, but still DO the line breaks when braces_on_struct_decl_line not set. 1999-05-31 carlo * args.c: Version 2.0 bug fix : Recognize options that start with the same sequence as other, shorter options (ie, -nlps <--> -nlp). * indent.c: Regression fix: Don't indent a procname when at start of a line. 1999-05-30 carlo * io.c: Regression fix: Don't indent a procname when at start of a line. * indent.c, lexi.c: Regression fix related to indentation in enums and in struct initializers. 1999-05-29 carlo * lexi.c, parse.c: Indent braced block on enum too (equiv. to a struct). * indent.h: Typo in comment. * io.c, lexi.c, memcpy.c, parse.c, args.c, backup.c, comments.c, globs.c, indent.c: Merged in all source changes from version 2.0. * sys.h: Added definitions of RCSTAG_CC and RCSTAG_H. * backup.h, indent.h, sys.h: Merged in the changes from version 2.0. 1999-05-26 carlo * lexi.c, parse.c, args.c, comments.c, indent.c, indent.h, io.c: Applied my "old" patch (the 'beta1' patch): New options: --braces-after-struct-decl-line, --braces-on-struct-decl-line, --case-brace-indentationN and --paren-indentationN. LOTS of bug fixes - unfortunately I forgot what all not. But I bet that if you had indentation problems, chances are it WILL be fixed now. 1999-05-22 carlo * lexi.c: Removed source code generated by gperf from repository. 1999-05-21 carlo * args.c, sys.h, version.h: Added the rest of the automake/makeproto build environment. 1999-05-20 carlo * args.c, backup.c, backup.h, comments.c, globs.c, indent.h, lexi.c, memcpy.c, parse.c, sys.h, version.h: Initial import of version 1.9.1 * args.c, backup.c, backup.h, comments.c, globs.c, indent.h, lexi.c, memcpy.c, parse.c, sys.h, version.h: New file. * indent.c, io.c: Initial import of version 1.9.1 * indent.c, io.c: New file. indent-2.2.11/bootstrap0000755000177400010010000000176611014035213011735 00000000000000#!/bin/sh # get the latest translations echo echo "#### get the latest translations" rsync -Lrtvz translationproject.org::tp/latest/indent/ po echo echo "#### making README" touch README echo echo "#### Running autopoint" #gettextize --version #gettextize --copy --force --intl --no-changelog autopoint --version autopoint -f echo echo "#### getting libgettext.h" cp /usr/share/gettext/gettext.h src/libgettext.h echo echo "#### running aclocal" aclocal --version aclocal -I m4 -I ./aclocal if [ $? -ne 0 ] then exit fi echo echo "#### running autoheader" autoheader --version autoheader echo echo "#### running autoconf" autoconf --version autoconf # get the latest config files. cd config wget -q "http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess" wget -q "http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub" cd .. echo echo "#### running automake" automake --version automake --add-missing rm README ./configure --enable-maintainer-mode indent-2.2.11/INSTALL0000644000177400010010000002713611270443577011046 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 6. Often, you can also type `make uninstall' to remove the installed files again. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *Note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. indent-2.2.11/po/0000777000177400010010000000000011331331070010464 500000000000000indent-2.2.11/po/Makefile.in.in0000644000177400010010000002431411041664103013062 00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common); do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext"; then \ for file in $(DISTFILES.common); do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all dvi info tags TAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir); \ else \ cp -p $(srcdir)/$$file $(distdir); \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: indent-2.2.11/po/sk.po0000644000177400010010000001675411331327562011405 00000000000000# indent sk.po # Copyright (C) 1999, 2002, 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the indent package. # Marcel Telka , 2002, 2008. # Miroslav Vasko , 1999. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2008-05-22 06:36+0200\n" "Last-Translator: Marcel Telka \n" "Language-Team: Slovak \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" #: src/args.c:611 msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr "" "použitie: indent súbor [-o výstupný_súbor ] [ voľby ]\n" " indent súbor1 súbor2 ... súborN [ voľby ]\n" #: src/args.c:677 #, c-format msgid "%s: missing argument to parameter %s\n" msgstr "%s: chýbajúci argument k parametru %s\n" #: src/args.c:802 #, c-format msgid "%s: unknown option \"%s\"\n" msgstr "%s: neznáma voľba \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "voľba: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent: %s\n" #: src/args.c:913 #, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "%s: voľba ``%s'' vyžaduje ako parameter Äíslo\n" #: src/args.c:921 #, c-format msgid "set_option: internal error: p_type %d\n" msgstr "set_option: interná chyba: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profil obsahuje neukonÄený komentár" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profil obsahuje nepríjemné znaky" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "Súbor urÄený premennou prostredia %s neexistuje alebo je neÄitateľný" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Divná hodnota version-control\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Použijú sa existujúce oÄíslované\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Nemôžem vytvoriÅ¥ záložnú kópiu súboru %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Nemôžem otvoriÅ¥ záložný súbor %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Nemôžem zapísaÅ¥ do záložného súboru %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Nemôžem zachovaÅ¥ Äas zmeny záložného súboru %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: VyÄerpaná virtuálna pamäť.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Závažná chyba: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Systémová chyba: " #: src/globs.h:27 msgid "Warning" msgstr "Upozornenie" #: src/globs.h:31 msgid "Error" msgstr "Chyba" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "V komentári sa vyskytol koniec súboru" #: src/indent.c:345 msgid "Line broken" msgstr "Riadok poÅ¡kodený" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "NeoÄakávaný koniec súboru" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Spracovaných %d neprázdnych výstupných riadkov a %d komentárov\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Riadkov s komentármi)/(Riadkov s kódom): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Riadok poÅ¡kodený 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: iba jeden výstupný súbor (druhý bol %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: iba jeden vstupný súbor, keÄ je zadaný výstupný súbor\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: nemožno zadaÅ¥ súbory, ak ste zadali Å¡tandardný vstup\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: iba jeden vstupný súbor, keÄ je použitý Å¡tandardný výstup\n" #: src/indent.c:857 msgid "command line" msgstr "príkazový riadok" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "ČítaÅ¥ profil %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Interná chyba vyrovnávacej pamäte" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Nemôžem otvoriÅ¥ vstupný súbor %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Nemôžem zistiÅ¥ stav vstupného súboru %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Varovanie: Súbor %s má nulovú dĺžku" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Súbor %s je príliÅ¡ veľký na Äítanie" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Systémový problém pri Äítaní súboru %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Chyba pri Äítaní vstupného súboru %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Chyba pri zatváraní vstupného súboru %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Upozornenie: Súbor %s obsahuje nulové znaky\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "NeukonÄená znaková konÅ¡tanta" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "NeukonÄená reÅ¥azcová konÅ¡tanta" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "nejednoznaÄnosÅ¥ priradenia starého Å¡týlu v \"=%c\". Predpokladá sa \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: nemôžem vytvoriÅ¥ %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Nemôžem zatvoriÅ¥ výstupný súbor %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Nemôžem zachovaÅ¥ Äas zmeny výstupného súboru %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Nezodpovedajúce 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Chyba vnorenia stmt." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Analyzátor nepozná tento kód" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "Zásobník analyzátora [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " zásobník[%d] => zásobník: %d ind_úroveň: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "NEPODARILO SA NÃJSŤ SÚBOR '@'!" #~ msgid "Ran out of memory" #~ msgstr "Beh vyÄerpal pamäť" #~ msgid "Extra %c" #~ msgstr "NavyÅ¡e %c" #~ msgid "Unmatched #else" #~ msgstr "Nezodpovedaj�ce #else" #~ msgid "Unmatched #elif" #~ msgstr "Nezodpovedajúce #elif" #~ msgid "Unmatched #endif" #~ msgstr "Nezodpovedajúce #endif" indent-2.2.11/po/de.po0000644000177400010010000001713011331327561011344 00000000000000# German messages for GNU indent # Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc. # Martin von Löwis , 1997, 2001, 2002. # msgid "" msgstr "" "Project-Id-Version: GNU indent 2.2.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2002-10-24 21:39+0200\n" "Last-Translator: Martin von Löwis \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent Datei1 Datei2 ... DateiN [ Optionen ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: Fehlendes Argument für Parameter %s.\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: Unbekannte Option \"%s\".\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "option: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent: %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: option »%s« verlangt einen numerischen Parameter.\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: Interner Fehler: p_type %d.\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Das Profile enthält einen nicht-beendeten Kommentar." #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Das Profile enthält ungenießbare Zeichen." #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Seltsamer Wert für Versionsverwaltung.\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: nummeriert-falls-vorhanden wird verwendet.\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Name der Backup-Datei für %s kann nicht ermittelt werden.\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Backup-Datei %s läßt sich nicht öffnen." #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "In die Backup-Datei %s kann nicht geschrieben werden." #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "" "Die Modifikationszeit kann für die Backup-Datei %s nicht erhalten werden." #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Virtueller Speicher erschöpft.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s: " #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Fataler Fehler: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Systemfehler: " #: src/globs.h:27 msgid "Warning" msgstr "Warnung" #: src/globs.h:31 msgid "Error" msgstr "Fehler" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "EOF in Kommentar gefunden." #: src/indent.c:345 msgid "Line broken" msgstr "Zeile umbrochen." #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Unerwartetes Dateiende." #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Es gab %d nichtleere Ausgabezeilen und %d Kommentare.\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Zeilen mit Kommentaren)/(Zeilen mit Code): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Zeile umbrochen 2." # der, die, das zweite? #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: Nur eine Ausgabedatei erlaubt (die zweite war %s).\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: Nur eine Eingabedatei, wenn Ausgabedatei angegeben ist.\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: Dateinamen sind nicht erlaubt bei Verwendung der Standardeingabe.\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: Nur eine Eingabedatei bei Verwendung von stdout.\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Lese Vorgabedatei (»profile«) %s.\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Interner Pufferfehler" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Die Eingabedatei %s läßt sich nicht öffnen." #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Für die Eingabedatei %s kann stat nicht ausgeführt werden." #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Warnung: Datei %s ist leer." #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Die Datei %s ist zu groß zum Einlesen." #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Ein Systemproblem trat beim Lesen der Datei %s auf." #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Fehler beim Lesen der Eingabedatei %s." #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Fehler beim Schließen der Eingabedatei %s." #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Warnung: Datei %s enthält NULL-Zeichen.\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Nicht-beendete Zeichenkonstante." #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Nicht-beendete Stringkonstante." #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "Mehrdeutigkeit der Zuweisung in \"=%c\" (alte Form). \"= %c\" wird " "verwendet.\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: Kann %s nicht erzeugen.\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Die Ausgabedatei %s kann nicht geschlossen werden." #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Die Modifikationszeit der Ausgabedatei %s kann nicht erhalten werden." # Shouldn't the message say 'else without if'? #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Unerwartetes »else«." #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Fehler in Anweisungsverschachtelung." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Code ist dem Parser unbekannt." #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "Parse-Stack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "KANN DATEI '@' NICHT FINDEN!" #~ msgid "Ran out of memory" #~ msgstr "Speicher erschöpft." #~ msgid "Extra %c" #~ msgstr "Überflüssiges %c" # Does this always mean we are missing an #if? Then we should say so. -mvl- #~ msgid "Unmatched #else" #~ msgstr "Unerwartetes #else." #~ msgid "Unmatched #elif" #~ msgstr "Unerwartetes #elif." #~ msgid "Unmatched #endif" #~ msgstr "Unerwartetes #endif." #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "Aufruf: indent Datei [-o Ausgabedatei] [ Optionen]\n" indent-2.2.11/po/pt_BR.po0000644000177400010010000001667511331327562012000 00000000000000# indent: translation to Brazilian Portuguese (pt_BR) # Copyright (C) 2002 Free Software Foundation, Inc. # Alexandre Folle de Menezes , 2002. # based on the translation to Galician (gl) by # Jacobo Tarrío Barreiro , 2000. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2002-10-28 23:00-0300\n" "Last-Translator: Alexandre Folle de Menezes \n" "Language-Team: Brazilian Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent arq1 arq2 ... arqN [ opções ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: faltando argumento do parâmetro %s\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: opção \"%s\" desconhecida\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "opção: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: opção ``%s'' requer um parâmetro numérico\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: erro interno: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "O Perfil contém um comentário não terminado" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "O Perfil contém caracteres inaceitáveis" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Valor estranho do controle de versão\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Usando existentes-numeradas\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Impossível criar um nome de backup de %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Impossível abrir arquivo de backup %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Impossível gravar no arquivo de backup %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Impossível preservar o horário de modificação do arquivo de backup %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Memória virtual esgotada.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Erro Fatal: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Erro do Sistema: " #: src/globs.h:27 msgid "Warning" msgstr "Aviso" #: src/globs.h:31 msgid "Error" msgstr "Erro" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "EOF encontrado em comentário" #: src/indent.c:345 msgid "Line broken" msgstr "Linha cortada" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Final de arquivo inesperado" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Encontradas %d linhas de saída não-vazias e %d comentários\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Linhas com comentários)/(Linhas com código): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Linha cortada 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: apenas um arquivo de saída (o segundo era %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "" "indent: apenas um arquivo de entrada quando se especifica um arquivo de " "saída\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: não se pode ter nomes de arquivo quando se especifica a entrada " "padrão\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: apenas um arquivo de entrada quando se usa stdout\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Ler perfil %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Erro interno nos buffers" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Impossível abrir o arquivo de entrada %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Impossível obter informações do arquivo de entrada %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Aviso: arquivo vazio %s" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "O arquivo %s é grande de mais para ler" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Problema de sistema lendo o arquivo %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Erro lendo o arquivo de entrada %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Erro fechando o arquivo de entrada %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Aviso: O arquivo %s contém caracteres nulos\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Constante de caracter sem terminador" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Constante de string sem terminador" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "ambigüidade na designação estilo antigo em \"=%c\". Assumindo \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: impossível criar %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Impossível fechar o arquivo de saída %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Impossível conservar o horário de modificação do arquivo de saída %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "'else' sem o 'if'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Erro de aninhamento de instruções." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Código desconhecido para o analisador" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "IMPOSSÍVEL ENCONTRAR O ARQUIVO '@'!" #~ msgid "Ran out of memory" #~ msgstr "Esgotou a memória" #~ msgid "Extra %c" #~ msgstr "%c extra" #~ msgid "Unmatched #else" #~ msgstr "#else sem o #if" #~ msgid "Unmatched #elif" #~ msgstr "#elif sem o #if" #~ msgid "Unmatched #endif" #~ msgstr "#endif sem o #if" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "uso: indent arq [-o arqsaida ] [ opções ]\n" indent-2.2.11/po/nl.gmo0000644000177400010010000001235111331327563011533 00000000000000Þ•5ÄGlˆ+‰%µ/Û /$Tj…Ÿ2¸2ë7Upv’G­õ  )7(I'rš«¿5Þ+BSs ˜'¥!Íï) , B "Y | <• :Ò 0 *> :i ¤ &° ]× ’5 3È %ü -" P 1j œ "¹ &Ü ;$6`-—)Å7ï'#,%PLvÃÒçø ( Ih|4™;Î # CP l  š)¨+ÒþASi3³FÑPPiEºD E(Poy 5" 21,/)$ 3'#& -4!(%.* 0+ stack[%d] => stack: %d ind_level: %d %s: missing argument to parameter %s %s: option ``%s'' requires a numeric parameter %s: unknown option "%s" (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readFile named by environment variable %s does not exist or is not readableGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningcommand lineindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s set_option: internal error: p_type %d usage: indent file [-o outfile ] [ options ] indent file1 file2 ... fileN [ options ] Project-Id-Version: indent-2.2.10 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2008-05-17 21:27+0200 Last-Translator: Benno Schulenberg Language-Team: Dutch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: KBabel 1.11.4 Plural-Forms: nplurals=2; plural=(n != 1); stapel[%d] => stapel: %d inspring_niveau: %d %s: ontbrekend argument bij optie %s %s: optie '%s' vereist een numeriek argument %s: onbekende optie '%s' (Regels met commentaar)/(Regels met code): %6.3f KAN '@'-BESTAND NIET VINDEN!Kan uitvoerbestand %s niet sluitenKan reservekopiebestand %s niet openenKan invoerbestand %s niet openenKan wijzigingstijd van reservekopiebestand %s niet behoudenKan wijzigingstijd van uitvoerbestand %s niet behoudenKan status van invoerbestand %s niet opvragenKan reservekopiebestand %s niet schrijvenEinde van bestand werd bereikt midden in een commentaarFoutFout bij lezen van invoerbestand %sBestand %s is te groot om in te lezenHet bestand genoemd in omgevingsvariable %s bestaat niet of is niet leesbaarGNU indent %s *Interne bufferfout*Regel afgebrokenRegel afgebroken 2OntleedStapel [%d]: Profiel bevat een onafgemaakt commentaarProfiel bevat ongeldige tekensProfiel %s gelezen Nestingsfout van statements.Systeem heeft problemen met het lezen van bestand %sEr waren %d niet-lege uitvoerregels en %d commentaarregels Onverwacht bestandseindeOnbekende code voor de ontlederLosse 'else'Onafgemaakte tekenconstanteOnafgemaakte tekenreeksconstanteWaarschuwingopdrachtregelindent: vreemde waarde voor versiebeheer indent: bestaande nummering wordt gebruikt indent: %s:%d: %s:indent: kan geen bestandsnaam maken voor een reservekopie van %s indent: Fatale fout: indent: Systeemfout: indent: Onvoldoende virtueel geheugen beschikbaar. indent: kan %s niet aanmaken indent: bestandsnamen niet toegestaan bij gebruik van standaardinvoer indent: slechts één invoerbestand is toegestaan als uitvoerbestand gegeven is indent: slechts één invoerbestand toegestaan bij gebruik van standaarduitvoer indent: slechts één uitvoerbestand is mogelijk (het tweede was %s) toewijzing in oude stijl ('=%c') is meerduidig; begrepen als '= %c' optie: %s set_option(): *interne fout*: p_type %d Gebruik: indent BESTAND [-o UITVOERBESTAND] [OPTIES] of: indent BESTAND1 BESTAND2 ... BESTANDn [OPTIES] indent-2.2.11/po/et.po0000644000177400010010000001602311331327561011364 00000000000000# Estonian translations for indent. # Copyright (C) 2000 Free Software Foundation, Inc. # Toomas Soome , 2001. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2002-10-25 10:14+03:00\n" "Last-Translator: Toomas Soome \n" "Language-Team: Estonian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-15\n" "Content-Transfer-Encoding: 8-bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent fail1 fail2 ... failN [ võtmed ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: parameetril %s puudub argument\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: tundmatu võti \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "võti: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: võti ``%s'' nõuab numbrilist argumenti\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: sisemine viga: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profiil sisaldab lõpetamata kommentaari" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profiil sisaldab ebasobivaid sümboleid" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Veider versioonihalduse väärtus\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Kasutan nummerdatud olemasolevat\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Ei õnnestu luua %s varukoopia failinime\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Ei õnnestu avada varukoopia faili %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Ei õnnestu kirjutada varukoopia faili %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Ei õnnestu säilitada varukoopia faili %s muutmise aega" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Mälu on otsas.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Fataalne viga: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Süsteemi viga: " #: src/globs.h:27 msgid "Warning" msgstr "Hoiatus" #: src/globs.h:31 msgid "Error" msgstr "Viga" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "EOF kommentaaris" #: src/indent.c:345 msgid "Line broken" msgstr "Katkine rida" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Ootamatu faililõpp" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Saime %d mitte-tühja väljundrida ja %d kommentaari\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Kommentaaridega ridu)/(Koodiridu): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Katkine rida 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: ainult üks väljundfail (teine oli %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "" "indent: kui väljundfail on määratud, saab kasutada ainult üht sisendfaili\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: failinimesid ei saa kasutada, kui kasutatakse standardsisendit\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "" "indent: kui kasutame standardväljundit, saab kasutada ainult üht failinimie\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Lugesin profiili %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Sisemine puhverduse viga" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Ei õnnestu avada sisendfaili %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Ei õnnestu lugeda sisendfaili %s atribuute" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Hoiatus: null-pikkusega fail %s" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Fail %s on lugemiseks liiga suur" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Süsteemi tõrge faili %s lugemisel" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Viga sisendfaili %s lugemisel" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Viga sisendfaili %s sulgemisel" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Hoiatus: Fail %s sisaldab NULL sümboleid\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Lõpetamata sümbol konstant" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Lõpetamata sõne konstant" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "vanas stiilis omistamine \"=%c\". Eeldan \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: %s ei saa luua\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Ei õnnestu sulgeda väljundfaili %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Ei õnnestu säilitada väljundfaili %s muutmise aega" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Puudub 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Viga avaldises." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Parser sai tundmatu koodi" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "EI LEIA '@' FAILI!" #~ msgid "Ran out of memory" #~ msgstr "Mälu on otsas" #~ msgid "Extra %c" #~ msgstr "Liigne %c" #~ msgid "Unmatched #else" #~ msgstr "Puudub #else" #~ msgid "Unmatched #elif" #~ msgstr "Puudub #elif" #~ msgid "Unmatched #endif" #~ msgstr "Puudub #endif" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "kasuta: indent fail [-o väljundfail ] [ võtmed ]\n" indent-2.2.11/po/ca.gmo0000644000177400010010000001024211331327562011501 00000000000000Þ•,|;ÜÈ+É/õ%;Vp2‰2¼ï&AGc~ ¦ ²'Àèù 5,by¡ÁÞ'æ!0)Cmƒ"š½<Ö:0N*:ª åHñ+: 1f ˜ (¸ (á & G1 Jy &Ä -ë  9 &? )f  Ÿ » Ê (Û   +, ;X ” -® Ü "ð  4-@!n;£ßõ#5MQKŸ8ë2$?W —) &%$# ! *(,'  "+ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2Profile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.8 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2002-10-27 20:30GMT Last-Translator: Josep Maria Balasch Language-Team: Catalan MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit stack[%d] => stack: %d ind_level: %d (Línies amb comentaris)/(Línies amb codi): %6.3f NO ES POT TROBAR EL FITXER '@'!No es pot tancar el fitxer de sortida %sNo es pot obrir la còpia de seguretat %sNo es pot obrir el fitxer d'entrada %sNo es pot conservar la modificació de temps en la còpia de seguretat %sNo s'ha pogut conservar el temps de modificació en el fitxer de sortida %sNo hi pot haver el fitxer d'entrada %sNo es pot escriure a la còpia de seguretat %sS'ha trobat EOF en el comentariErrorError en llegir el fitxer d'entrada %sEl fitxer %s és massa gran per ser llegitGNU indent %s Error de la memòria internaLínia trencadaLínia trencada 2El perfil conté caràcters no acceptablesLlegir perfil %s Stmt error de nestingProblema del sistema en llegir el fitxer %sHi havia %d de línies no buides de sortida i %d comentaris Inesperat final de fitxerCodi desconegut per l'analitzador de sintaxis'else' desaparellatLa constant caràcter no és acabadaLa constant string no és acabadaAdvertènciaindent: Valor del control de versió extrany indent: Ús de numerats existents indent: %s:%d: %s:indent: No es pot fer una còpia de seguretat del fitxer %s indent: Error fatal: indent: Error del sistema: indent: Memòria virtual exhaurida. indent: no es pot crear %s indent: no hi pot haver noms de fitxer quan s'especifica l'entrada estàndard indent: només un fitxer d'entrada quan el fitxer de sortida és especificat indent: només un fitxer d'entrada quan stdout és emprat indent: només un fitxer de sortida (el 2n era %s) ambigüetat d'assignació old-style en "=%c". S'assumeix "= %c" opció: %s indent-2.2.11/po/tr.po0000644000177400010010000001615411331327562011407 00000000000000# translation of indent-2.2.9.tr.po to Turkish # Copyright (C) 1996, 2005 Free Software Foundation, Inc. # Deniz Akkus Kanca , 2001. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2005-03-05 10:19+0200\n" "Last-Translator: Deniz Akkus Kanca \n" "Language-Team: Turkish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-9\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.9.1\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent dosya1 dosya2 ... dosyaN [ seçenekler ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: parametrede eksik argüman %s\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: bilinmeyen seçenek \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "seçenek: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: ``%s'' seçeneði sayýsal parametre gerektirir\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: içsel hata: p_type %d\n" # #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profil sonlanmamýþ bir açýklama içeriyor" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profil geçersiz karakterler içeriyor" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Garip sürüm-kontrolü deðeri\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Varolan sürüm kullanýlýyor\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: %s yedek dosyasý oluþturulamadý\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "%s yedek dosyasý açýlamadý" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "%s yedek dosyasýna yazýlamadý" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "%s yedek dosyasýnýn deðiþim zaman damgasý korunamadý" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Sanal bellek tükendi.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s: " #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Ölümcül Hata:" #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Sistem Hatasý: " #: src/globs.h:27 msgid "Warning" msgstr "Uyarý" #: src/globs.h:31 msgid "Error" msgstr "Hata" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Açýklama içinde dosyasonu (EOF)" #: src/indent.c:345 msgid "Line broken" msgstr "Satýr hatalý" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Beklenmeyen dosyasonu" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "%d boþ olmayan çýktý satýrý ve %d açýklama vardý\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Açýklama satýrlarý)/(Program satýrlarý): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Satýr hatalý 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: Yalnýzca bir çýktý dosyasý (2. %s idi)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: Çýktý dosyasý verildiði zaman yalnýzca bir girdi dosyasý\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: standart girdi belirtildiði zaman dosyaadý verilemez\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: standart çýktý kullanýldýðý zaman yalnýzca bir girdi dosyasý\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Profile %s okundu\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Ýçsel önbellek hatasý" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "%s girdi dosyasý açýlamadý" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "%s girdi dosyasý durumlanamadý" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Uyarý: %s dosyasý boþ" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "%s dosyasý okumak için fazla büyük" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "%s dosyasý okunurken sistem problemi" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "%s girdi dosyasý okunurken hata" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "%s girdi dosyasý kapatýlýrken hata" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Uyarý: %s dosyasý NULL karakter içeriyor\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Sonlanmamýþ karakter sabiti" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Sonlanmamýþ dizge sabiti" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "\"=%c\" içerisinde eski tarz deðer atama belirsizliði. =%c varsayýldý.\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: %s oluþturulamadý\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "%s çýktý dosyasý kapatýlamadý" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "%s çýktý dosyasýnýn deðiþim zamaný korunamadý" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Karþýlýksýz 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Ýfade iç-içeliði hatasý." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Ayrýþtýrýcýya bilinmeyen kod" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ÇözümlemeYýðýtý [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " yýðýn[%d] => yýðýn: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "'@' DOSYASI BULUNAMADI!" #~ msgid "Ran out of memory" #~ msgstr "Bellek tükendi" #~ msgid "Extra %c" #~ msgstr "Fazladan %c" #~ msgid "Unmatched #else" #~ msgstr "Karþýlýksýz #else" #~ msgid "Unmatched #elif" #~ msgstr "Karþýlýksýz #elif" #~ msgid "Unmatched #endif" #~ msgstr "Karþýlýksýz #endif" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "kullaným: indent dosya_adý [-o çýktý_dosyasý] [seçenekler]\n" indent-2.2.11/po/hu.gmo0000644000177400010010000001040011331327563011527 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H aT +¶ #â  % 0B 's D› 8à ( ,B o  '” "¼ ß î ÿ  )) )S } “ *© &Ô û  +>Yy$ˆ%­Ó:æ!9%O"uO˜IèE27xB° ó  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.8 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2003-04-17 14:46+0200 Last-Translator: Andras Timar Language-Team: Hungarian MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit verem[%d] => verem: %d ind_level: %d (Megjegyzéssorok)/(Kódsorok):%6.3f NINCS MEG A '@' FÁJL!Nem lehet a %s kimeneti fájlt lezárniNem lehet megnyitni a %s biztonsági mentés fájltNem lehet megnyitni a %s bemeneti fájltNem lehet megõrizni a %s biztonsági mentés fájl módosításának idejétNem lehet a %s kimeneti fájl módosítási idejét megõrizniNem lehet a statolni a %s bemeneti fájltNem lehet írni a %s biztonsági mentés fájlbaEOF (fájl vége) a megjegyzésbenHibaHiba a %s bemeneti fájl olvasása közbenA %s fájl túl hosszú az olvasáshozGNU indent %s Belsõ pufferhibaTörött sorTörött sor 2ParseStack [%d]: A profil nem lezárt megjegyzést tartalmazA profil oda nem illõ karaktert tartalmazA %s profil olvasása Stmt beágyazási hiba.Rendszerprobléma a %s fájl olvasása közben%d nem üres sor és %d megjegyzés volt Váratlan fájlvégIsmeretlen kód a feldolgozóbanPár nélküli 'else'Lezáratlan karakterállandóLezáratlan karakterlánc-állandóFigyelmeztetésindent: Furcsa verziókövetés-érték indent: Számozott-létezõ használata indent: %s:%d: %s:indent: %s fájlról nem lehet biztonsági mentést készíteni indent: Végzetes hiba: indent: Rendszerhiba indent: Virtuális memória elfogyott. indent: nem lehet létrehozni a %s indent: nem lehet megadni fájlnevet amikor a standard bemenet van meghatározva indent: csak egy bemeneti fájl lehet, amikor a kimenet meg van határozva indent: csak egy bemeneti fájl lehet, amikor az stdout van használva indent: csak egy kimeneti fájl van (a második %s volt) régi stílusú kétértelmû hozzárendelés "=%c". "= %c" feltételezve kapcsoló:%s indent-2.2.11/po/tr.gmo0000644000177400010010000001017011331327563011544 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H sT )È 0ò # ; Y t 4 -Ä ò  / O T "t — ¦ ¼ É Ø (ï $ = P $i 1Ž À Ö ó ";$A#fŠ(žÇÝõ=/AmE¯/õE% k  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.9 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2005-03-05 10:19+0200 Last-Translator: Deniz Akkus Kanca Language-Team: Turkish MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-9 Content-Transfer-Encoding: 8bit X-Generator: KBabel 1.9.1 yýðýn[%d] => yýðýn: %d ind_level: %d (Açýklama satýrlarý)/(Program satýrlarý): %6.3f '@' DOSYASI BULUNAMADI!%s çýktý dosyasý kapatýlamadý%s yedek dosyasý açýlamadý%s girdi dosyasý açýlamadý%s yedek dosyasýnýn deðiþim zaman damgasý korunamadý%s çýktý dosyasýnýn deðiþim zamaný korunamadý%s girdi dosyasý durumlanamadý%s yedek dosyasýna yazýlamadýAçýklama içinde dosyasonu (EOF)Hata%s girdi dosyasý okunurken hata%s dosyasý okumak için fazla büyükGNU indent %s Ýçsel önbellek hatasýSatýr hatalýSatýr hatalý 2ÇözümlemeYýðýtý [%d]: Profil sonlanmamýþ bir açýklama içeriyorProfil geçersiz karakterler içeriyorProfile %s okundu Ýfade iç-içeliði hatasý.%s dosyasý okunurken sistem problemi%d boþ olmayan çýktý satýrý ve %d açýklama vardý Beklenmeyen dosyasonuAyrýþtýrýcýya bilinmeyen kodKarþýlýksýz 'else'Sonlanmamýþ karakter sabitiSonlanmamýþ dizge sabitiUyarýindent: Garip sürüm-kontrolü deðeri indent: Varolan sürüm kullanýlýyor indent: %s:%d: %s: indent: %s yedek dosyasý oluþturulamadý indent: Ölümcül Hata:indent: Sistem Hatasý: indent: Sanal bellek tükendi. indent: %s oluþturulamadý indent: standart girdi belirtildiði zaman dosyaadý verilemez indent: Çýktý dosyasý verildiði zaman yalnýzca bir girdi dosyasý indent: standart çýktý kullanýldýðý zaman yalnýzca bir girdi dosyasý indent: Yalnýzca bir çýktý dosyasý (2. %s idi) "=%c" içerisinde eski tarz deðer atama belirsizliði. =%c varsayýldý. seçenek: %s indent-2.2.11/po/ca.po0000644000177400010010000001654211331327561011345 00000000000000# Catalan messages for indent # Copyright (C) 2002 Free Software Foundation, Inc. # Josep Maria Balasch , 2002. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2002-10-27 20:30GMT\n" "Last-Translator: Josep Maria Balasch \n" "Language-Team: Catalan \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent fitxer1 fitxer2 ... fitxerN [ opcions ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: argument inexistent al paràmetre %s\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: opció desconeguda \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "opció: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: l'opció ``%s'' requereix un paràmetre numèric\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: error intern: p_type %d\n" #: src/args.c:977 #, fuzzy msgid "Profile contains an unterminated comment" msgstr "El perfil conté caràcters no acceptables" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "El perfil conté caràcters no acceptables" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Valor del control de versió extrany\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Ús de numerats existents\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: No es pot fer una còpia de seguretat del fitxer %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "No es pot obrir la còpia de seguretat %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "No es pot escriure a la còpia de seguretat %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "" "No es pot conservar la modificació de temps en la còpia de seguretat %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Memòria virtual exhaurida.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Error fatal: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Error del sistema: " #: src/globs.h:27 msgid "Warning" msgstr "Advertència" #: src/globs.h:31 msgid "Error" msgstr "Error" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "S'ha trobat EOF en el comentari" #: src/indent.c:345 msgid "Line broken" msgstr "Línia trencada" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Inesperat final de fitxer" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Hi havia %d de línies no buides de sortida i %d comentaris\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Línies amb comentaris)/(Línies amb codi): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Línia trencada 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: només un fitxer de sortida (el 2n era %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "" "indent: només un fitxer d'entrada quan el fitxer de sortida és especificat\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: no hi pot haver noms de fitxer quan s'especifica l'entrada " "estàndard\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: només un fitxer d'entrada quan stdout és emprat\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Llegir perfil %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Error de la memòria interna" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "No es pot obrir el fitxer d'entrada %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "No hi pot haver el fitxer d'entrada %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Advertència: Fitxer de longitud zero %s" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "El fitxer %s és massa gran per ser llegit" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Problema del sistema en llegir el fitxer %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Error en llegir el fitxer d'entrada %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Error en tancar el fitxer d'entrada %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Advertència: El fitxer %s conté NULL-caràcters\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "La constant caràcter no és acabada" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "La constant string no és acabada" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "ambigüetat d'assignació old-style en \"=%c\". S'assumeix \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: no es pot crear %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "No es pot tancar el fitxer de sortida %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "" "No s'ha pogut conservar el temps de modificació en el fitxer de sortida %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "'else' desaparellat" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Stmt error de nesting" #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Codi desconegut per l'analitzador de sintaxis" #: src/parse.c:525 #, fuzzy, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "NO ES POT TROBAR EL FITXER '@'!" #~ msgid "Ran out of memory" #~ msgstr "S'ha quedat sense memòria" #~ msgid "Extra %c" #~ msgstr "Extra %c" #~ msgid "Unmatched #else" #~ msgstr "#else desaparellat" #~ msgid "Unmatched #elif" #~ msgstr "#elif desaparellat" #~ msgid "Unmatched #endif" #~ msgstr "#endif desaparellat" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "ús: indent fitxer [-o fitxer_de_sortida ] [ opcions ]\n" indent-2.2.11/po/sk.gmo0000644000177400010010000001232011331327563011533 00000000000000Þ•5ÄGlˆ+‰%µ/Û /$Tj…Ÿ2¸2ë7Upv’G­õ  )7(I'rš«¿5Þ+BSs ˜'¥!Íï) , B "Y | <• :Ò 0 *> :i ¤ &° ]× D5 8z (³ 2Ü  2) !\ (~ '§ %Ï 6õ 6,,c.'¿ç)í*JB$ÂÕê& "0Sg-|Dªï - E#f Š–(©0Ò9Pk(‡°BÐEJY4¤NÙ (&4t[ 5" 21,/)$ 3'#& -4!(%.* 0+ stack[%d] => stack: %d ind_level: %d %s: missing argument to parameter %s %s: option ``%s'' requires a numeric parameter %s: unknown option "%s" (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readFile named by environment variable %s does not exist or is not readableGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningcommand lineindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s set_option: internal error: p_type %d usage: indent file [-o outfile ] [ options ] indent file1 file2 ... fileN [ options ] Project-Id-Version: indent 2.2.10 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2008-05-22 06:36+0200 Last-Translator: Marcel Telka Language-Team: Slovak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8-bit zásobník[%d] => zásobník: %d ind_úroveň: %d %s: chýbajúci argument k parametru %s %s: voľba ``%s'' vyžaduje ako parameter Äíslo %s: neznáma voľba "%s" (Riadkov s komentármi)/(Riadkov s kódom): %6.3f NEPODARILO SA NÃJSŤ SÚBOR '@'!Nemôžem zatvoriÅ¥ výstupný súbor %sNemôžem otvoriÅ¥ záložný súbor %sNemôžem otvoriÅ¥ vstupný súbor %sNemôžem zachovaÅ¥ Äas zmeny záložného súboru %sNemôžem zachovaÅ¥ Äas zmeny výstupného súboru %sNemôžem zistiÅ¥ stav vstupného súboru %sNemôžem zapísaÅ¥ do záložného súboru %sV komentári sa vyskytol koniec súboruChybaChyba pri Äítaní vstupného súboru %sSúbor %s je príliÅ¡ veľký na ÄítanieSúbor urÄený premennou prostredia %s neexistuje alebo je neÄitateľnýGNU indent: %s Interná chyba vyrovnávacej pamäteRiadok poÅ¡kodenýRiadok poÅ¡kodený 2Zásobník analyzátora [%d]: Profil obsahuje neukonÄený komentárProfil obsahuje nepríjemné znakyČítaÅ¥ profil %s Chyba vnorenia stmt.Systémový problém pri Äítaní súboru %sSpracovaných %d neprázdnych výstupných riadkov a %d komentárov NeoÄakávaný koniec súboruAnalyzátor nepozná tento kódNezodpovedajúce 'else'NeukonÄená znaková konÅ¡tantaNeukonÄená reÅ¥azcová konÅ¡tantaUpozorneniepríkazový riadokindent: Divná hodnota version-control indent: Použijú sa existujúce oÄíslované indent: %s:%d: %s:indent: Nemôžem vytvoriÅ¥ záložnú kópiu súboru %s indent: Závažná chyba: indent: Systémová chyba: indent: VyÄerpaná virtuálna pamäť. indent: nemôžem vytvoriÅ¥ %s indent: nemožno zadaÅ¥ súbory, ak ste zadali Å¡tandardný vstup indent: iba jeden vstupný súbor, keÄ je zadaný výstupný súbor indent: iba jeden vstupný súbor, keÄ je použitý Å¡tandardný výstup indent: iba jeden výstupný súbor (druhý bol %s) nejednoznaÄnosÅ¥ priradenia starého Å¡týlu v "=%c". Predpokladá sa "= %c" voľba: %s set_option: interná chyba: p_type %d použitie: indent súbor [-o výstupný_súbor ] [ voľby ] indent súbor1 súbor2 ... súborN [ voľby ] indent-2.2.11/po/remove-potcdate.sin0000644000177400010010000000066011041664103014217 00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } indent-2.2.11/po/zh_TW.Big5.po0000644000177400010010000001520011331327562012571 00000000000000# Language file for GNU indent (use indent.pot as template). # Copyright (C) 2001 Free Software Foundation, Inc. # Carlo Wood , 2001. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2001-09-05 08:38+0800\n" "Last-Translator: Franklin W. \n" "Language-Team: zh_TW.Big5 \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=big5\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent <¿é¤JÀÉ1> <¿é¤JÀÉ2> ... [ ¿ï¶µ ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: §ä¤£¨ì %s ªº°Ñ¼Æ\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: ¥¼ª¾ªº¿ï¶µ \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "¿ï¶µ¡G%s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: ``%s'' ¿ï¶µ»Ý­n¤@­Ó¼Æ¦r°µ¬°°Ñ¼Æ\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: ¤º³¡¿ù»~¡Gset_option ¨ç¦¡¤¤¥X²{¿ù»~ªº proto type %d\n" #: src/args.c:977 #, fuzzy msgid "Profile contains an unterminated comment" msgstr "³]©wÀɤ¤§t¦³¿ù»~ªº¦r¤¸" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "³]©wÀɤ¤§t¦³¿ù»~ªº¦r¤¸" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: ª©¥»±±¨î¸ê°T¦³¿ù»~\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: ±N§ï±Ä²{¦sªºª©¥»¸¹\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: µLªk²£¥Í %s ªº³Æ¥÷ÀÉ\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "µLªk¶}±Ò³Æ¥÷ÀÉ %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "µLªk¼g¤J³Æ¥÷ÀÉ %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "µLªk¦b³Æ¥÷ÀÉ %s ¤¤«O¯d³Ì«áÅܧó¤é´Á" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: µêÀÀ°O¾ÐÅé¤w¥Î§¹\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: ÄY­«¿ù»~¡G" #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: ¨t²Î¿ù»~¡G" #: src/globs.h:27 msgid "Warning" msgstr "" #: src/globs.h:31 msgid "Error" msgstr "" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "¦bµù¸Ñ¤¤¸I¨ìÀÉ®×µ²§À" #: src/indent.c:345 msgid "Line broken" msgstr "¦³¤@¦Ü¼Æ¦æ³Q¤À³Î¡A½Ð½T»{" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "ÀÉ®×µ²§À¦³°ÝÃD" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "¤w½s±Æ %d ­Ó«DªÅ¥Õ¦æ»P %d ­Óµù¸Ñ\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "µù¸Ñ¦æ»Pµ{¦¡½X¦æªº¤ñ¨Ò¬°¡G%6.3f\n" #: src/indent.c:556 #, fuzzy msgid "Line broken 2" msgstr "¦³¤@¦Ü¼Æ¦æ³Q¤À³Î¡A½Ð½T»{" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: ¥u¯à¦³¤@­Ó¿é¥XÀÉ (±z«ü©w¤F²Ä¤G­Ó¿é¥XÀɬ° %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: «ü©w¿é¥XÀɮɡA¥u¯à¦³¤@­Ó¿é¤JÀÉ\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: «ü©w¨Ï¥Î¼Ð·Ç¿é¤J®É¡A¤£¯àªþ±a¿é¤JÀɦW\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: ¨Ï¥Î¼Ð·Ç¿é¥X®É¡A¥u¯à¦³¤@­Ó¿é¤JÀÉ\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Ū¨ú³]©wÀÉ %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "¤º³¡¼È¦s¾¹¥X²{¿ù»~" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "µLªk¶}±Ò¿é¤JÀÉ %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "µLªk§ä¨ì¿é¤JÀÉ %s ªº¸ê°T" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "ĵ§i¡GÀÉ®× %s ¨S¦³¤º®e" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "ÀÉ®× %s ¤Ó¤j¡AµLªkŪ¨ú" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Ū¨úÀÉ®× %s ®Éµo¥Í¨t²Î°ÝÃD" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Ū¨ú¿é¤JÀÉ %s ®Éµo¥Í¿ù»~" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Ãö³¬¿é¤JÀÉ %s ®Éµo¥Í°ÝÃD" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "ĵ§i¡GÀÉ®× %s ¥]§tªÅ¦r¤¸¡]NULL-char¡^\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "¥i¯à¤Ö±¼¤@­Ó¦r¤¸³æ¤Þ¸¹" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "¥i¯à¤Ö±¼¤@­Ó¦r¦êÂù¤Þ¸¹" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "¦³ºÃ¸qªº«ü©w±Ô­z \"=%c\"¡A¥i¯à¬°Â¦¡ªº¼gªk¡Cindent ±N°²³]¥¦¬° \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: µLªk²£¥Í %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "µLªkÃö³¬¿é¥XÀÉ %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "µLªk¦b¿é¥XÀÉ %s «O¯d³Ì«áÅܧó¤é´Á" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "else §ä¤£¨ì¬Û¹ïÀ³ªº if" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "±_ª¬±Ô­z¦³¿ù»~¡C" #: src/parse.c:515 msgid "Unknown code to parser" msgstr "µLªk­åªRªºµ{¦¡½X" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr "" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "µLªk§ä¨ì '@' ÀɮסC" #~ msgid "Ran out of memory" #~ msgstr "°O¾ÐÅé¤w¥Î§¹" #~ msgid "Extra %c" #~ msgstr "¦hªº¦r¤¸ %c" #~ msgid "Unmatched #else" #~ msgstr "#else §ä¤£¨ì¬Û¹ïÀ³ªºÃöÁä¦r" #~ msgid "Unmatched #elif" #~ msgstr "#elif §ä¤£¨ì¬Û¹ïÀ³ªºÃöÁä¦r" #~ msgid "Unmatched #endif" #~ msgstr "#endif §ä¤£¨ì¬Û¹ïÀ³ªºÃöÁä¦r" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "¥Îªk¡Gindent <¿é¤JÀÉ> [-o ¿é¥XÀÉ] [¿ï¶µ]\n" indent-2.2.11/po/gl.gmo0000644000177400010010000001041611331327563011524 00000000000000Þ•,|;ÜÈ+É/õ%;Vp2‰2¼ï&AGc~ ¦ ²'Àèù 5,by¡ÁÞ'æ!0)Cmƒ"š½<Ö:0N*:ª å]ñ+O 2{ $® *Ó 6þ *5 S` E´ 7ú :2 )m — $œ )Á ë ú   '/ W #h (Œ 6µ ì $,!Bdƒ.‰%¸ÞAò4I"c†R¡KôF@3‡F» ) &%$# ! *(,'  "+ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2Profile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.7 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2002-01-03 18:05+0100 Last-Translator: Jacobo Tarrío Barreiro Language-Team: Galician MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8-bit stack[%d] => stack: %d ind_level: %d (Liñas con comentarios)/(Liñas con código): %6.3f ¡NON SE PUIDO ATOPA-LO FICHEIRO '@'!Non se puido pecha-lo ficheiro de saída %sNon se pode abri-lo ficheiro de copia de seguridade %sNon se pode abri-lo ficheiro de entrada %sNon se pode conserva-lo tempo de modificación no ficheiro de copia de seguridade %sNon se pode conserva-lo tempo de modificación no ficheiro de saída %sNon se pode obter información do ficheiro de entrada %sNon se pode escribir no ficheiro de copia de seguridade %sChegouse á fin do ficheiro nun comentarioErroErro ao le-lo ficheiro de entrada %sO ficheiro %s é grande de máis para o lerGNU indent %s Erro interno nos buffersLiña cortadaLiña cortada 2O perfil contén caracteres inaceptablesLe-lo perfil %s Erro de aniñamento de instruccións.Problema no sistema ao le-lo ficheiro %sHoubo %d liñas de saída non baleiras e %d comentarios Fin de ficheiro inesperadaCódigo descoñecido para o analizador'else' sen o seu 'if'Constante de carácter sen rematarConstante de cadea sen rematarAvisoindent: Valor do control de versións estrano indent: Usando numeradas-se-existen indent: %s:%d: %s: indent: Non se pode compoñe-lo nome da copia de seguridade de %s indent: Erro Grave: indent: Erro do Sistema: indent: Memoria virtual esgotada. indent: non podo crear %s indent: non se poden ter nomes de ficheiro cando se especifica a entrada estándar indent: só un ficheiro de entrada cando se especifica un ficheiro de saida indent: só se debe indicar un ficheiro de entrada cando se usa stdout indent: só un ficheiro de saída (o segundo era %s) ambigüidade na asignación ao vello estilo en "=%c". Supoñendo "= %c" opción: %s indent-2.2.11/po/ru.gmo0000644000177400010010000001505311331327563011552 00000000000000Þ•5ÄGlˆ+‰%µ/Û /$Tj…Ÿ2¸2ë7Upv’G­õ  )7(I'rš«¿5Þ+BSs ˜'¥!Íï) , B "Y | <• :Ò 0 *> :i ¤ &° ]× Ê5 7 E8 S~ 1Ò ),.?[N›=ês(eœPPS9¤ Þ8ë9$•^ô8!=#_ƒQ•Gç/)O:yX´, ;:vB@Ð.7NE†ÌWß/7)gD‘/Öyi€oêQZw¬$9:¶t 5" 21,/)$ 3'#& -4!(%.* 0+ stack[%d] => stack: %d ind_level: %d %s: missing argument to parameter %s %s: option ``%s'' requires a numeric parameter %s: unknown option "%s" (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readFile named by environment variable %s does not exist or is not readableGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningcommand lineindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s set_option: internal error: p_type %d usage: indent file [-o outfile ] [ options ] indent file1 file2 ... fileN [ options ] Project-Id-Version: indent 2.2.10 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2009-07-07 21:25+0400 Last-Translator: Yuri Kozlov Language-Team: Russian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: KBabel 1.11.4 Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Ñтек[%d] => Ñтек: %d уровень: %d %s: отÑутÑтвует аргумент у параметра %s %s: параметру «%s» необходим чиÑловой аргумент %s: неизвеÑтный параметр "%s" (комментарии)/(код): %6.3f ÐЕ УДÐЛОСЬ ÐÐЙТИ ФÐЙЛ '@'!Ðе удалоÑÑŒ закрыть выходной файл %sÐе удалоÑÑŒ открыть резервную копию файла %sÐе удалоÑÑŒ открыть входной файл %sÐе удалоÑÑŒ Ñохранить дату Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð½Ð° файле резервной копии %sÐе удалоÑÑŒ Ñохранить Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð²Ñ‹Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %sÐе удалоÑÑŒ получить ÑÑ‚Ð°Ñ‚ÑƒÑ Ð²Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %sÐе удалоÑÑŒ запиÑать резервную копию файла %sКонец файла внутри комментариÑОшибкаОшибка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð²Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %sФайл %s Ñлишком велик Ð´Ð»Ñ Ñ‡Ñ‚ÐµÐ½Ð¸ÑФайл, указанный в переменной Ð¾ÐºÑ€ÑƒÐ¶ÐµÐ½Ð¸Ñ %s, не ÑущеÑтвует или недоÑтупен Ð´Ð»Ñ Ñ‡Ñ‚ÐµÐ½Ð¸ÑGNU indent: %s ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ° буферизацииСтрока поврежденаСтрока повреждена 2ParseStack [%d]: Профиль Ñодержит незавершённый комментарийПрофиль Ñодержит недопуÑтимые ÑимволыЧтение Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ %s Ошибка вложенноÑти stmt.СиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð° %sБыло %d непуÑтых выходных Ñтрок и %d комментариев Ðеожиданный конец файлаÐеизвеÑтный Ð´Ð»Ñ Ð°Ð½Ð°Ð»Ð¸Ð·Ð°Ñ‚Ð¾Ñ€Ð° код'else' без парыÐÐµÐ·Ð°Ð²ÐµÑ€ÑˆÑ‘Ð½Ð½Ð°Ñ ÑÐ¸Ð¼Ð²Ð¾Ð»ÑŒÐ½Ð°Ñ ÐºÐ¾Ð½ÑтантаÐÐµÐ·Ð°Ð²ÐµÑ€ÑˆÑ‘Ð½Ð½Ð°Ñ ÑÑ‚Ñ€Ð¾ÐºÐ¾Ð²Ð°Ñ ÐºÐ¾Ð½ÑÑ‚Ð°Ð½Ñ‚Ð°ÐŸÑ€ÐµÐ´ÑƒÐ¿Ñ€ÐµÐ¶Ð´ÐµÐ½Ð¸ÐµÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрокаindent: Странное значение верÑии indent: ИÑпользуютÑÑ ÑущеÑтвующие чиÑла indent: %s:%d: %s:indent: Ðе удалоÑÑŒ Ñоздать резервную копию файла %s indent: ÐеиÑÐ¿Ñ€Ð°Ð²Ð¸Ð¼Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°: indent: СиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°: indent: ЗакончилаÑÑŒ Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ð°Ñ Ð¿Ð°Ð¼Ñть. indent: невозможно Ñоздать %s indent: Ð½ÐµÐ»ÑŒÐ·Ñ ÑƒÐºÐ°Ð·Ñ‹Ð²Ð°Ñ‚ÑŒ имена файлов, когда указан Ñтандартный ввод indent: только один входной файл, когда указан выходной файл indent: только один входной файл, когда указан Ñтандартный ввод indent: только один выходной файл (второй был %s) двуÑмыÑленное приÑваивание в Ñтаром Ñтиле в "=%c". ПринимаетÑÑ "= %c" параметр: %s set_option: внутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°: p_type %d иÑпользование: indent файл [-o выходной­­_файл ] [ параметры ] indent файл1 файл2 ... файлN [ параметры ] indent-2.2.11/po/ko.gmo0000644000177400010010000000301211331327563011525 00000000000000Þ•” h+i/•Å Þêû&'7"_‚<›0Ø F)\'†® ¿Ëåõ "@_>~B½      stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f Internal buffering errorLine brokenRead profile %s Stmt nesting error.Unknown code to parserUnmatched 'else'indent: Strange version-control value indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when stdout is used option: %s Project-Id-Version: indent 1.9.1a Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 1997-01-24 10:21+0900 Last-Translator: Bang Jun-Young Language-Team: Korean MIME-Version: 1.0 Content-Type: text/plain; charset=EUC-KR Content-Transfer-Encoding: 8-bit ½ºÅÃ[%d] => ½ºÅÃ: %d ind_level: %d (ÁÖ¼®À¸·Î µÈ Çà)/(ÄÚµå·Î µÈ Çà): %6.3f ³»ºÎ ¹öÆÛ¸µ ¿À·ùÇàÀÌ ±ú¾îÁüÇÁ·ÎÆÄÀÏ %sÀ» Àоú½À´Ï´Ù ¹®Àå Áßø ¿À·ù.ÆÄ¼­°¡ ¾Ë ¼ö ¾ø´Â ÄÚµå¦ÀÌ ¸ÂÁö ¾Ê´Â 'else'indent: ÀÌ»óÇÑ ¹öÀü-Á¦¾î °ª indent: °¡»ó ¸Þ¸ð¸®°¡ ¹Ù´Ú³². indent: %s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù indent: Ç¥ÁØ ÀÔ·ÂÀ» ÁöÁ¤ÇÒ ¶§¿¡´Â ÆÄÀϸíÀ» ÁöÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù indent: Ç¥ÁØÃâ·ÂÀÌ »ç¿ëµÇ¸é ÀÔ·Â ÆÄÀÏÀº ¿ÀÁ÷ Çϳª¸¸ ÀÖ¾î¾ß ÇÕ´Ï´Ù ¿É¼Ç: %s indent-2.2.11/po/ja.po0000644000177400010010000001627611331327561011360 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) 2002 Free Software Foundation, Inc. # GOTO Masanori , 2002-2006. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2006-03-20 10:36+0900\n" "Last-Translator: GOTO Masanori \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=EUC-JP\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent ¥Õ¥¡¥¤¥ë1 ¥Õ¥¡¥¤¥ë2 ... ¥Õ¥¡¥¤¥ëN [ ¥ª¥×¥·¥ç¥ó ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: ¥Ñ¥é¥á¡¼¥¿ %s ¤Ø¤Î°ú¿ô¤¬Â­¤ê¤Þ¤»¤ó\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: ÉÔÌÀ¤Ê¥ª¥×¥·¥ç¥ó \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "¥ª¥×¥·¥ç¥ó: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: ¥ª¥×¥·¥ç¥ó ``%s'' ¤Ë¤Ï¿ôÃͥѥé¥á¡¼¥¿¤¬É¬ÍפǤ¹\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: ÆâÉô¥¨¥é¡¼: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "¥×¥í¥Õ¥¡¥¤¥ë¤ÏÊĤ¸¤Æ¤¤¤Ê¤¤¥³¥á¥ó¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "¥×¥í¥Õ¥¡¥¤¥ë¤ÏŬÀڤǤʤ¤Ê¸»ú¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: ¤ª¤«¤·¤Ê version-control ÃͤǤ¹\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: numbered-existing ¤ò»ÈÍѤ·¤Þ¤¹\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: ¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë̾ %s ¤òºîÀ®¤Ç¤­¤Þ¤»¤ó\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë %s ¤¬³«¤±¤Þ¤»¤ó" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë %s ¤Ë½ñ¹þ¤á¤Þ¤»¤ó" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë %s ¤ÎÊѹ¹»þ¹ï¤òÊݸ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: ¥á¥â¥ê¤ò»È¤¤²Ì¤¿¤·¤Þ¤·¤¿.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Ã×̿Ū¥¨¥é¡¼: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: ¥·¥¹¥Æ¥à¥¨¥é¡¼: " #: src/globs.h:27 msgid "Warning" msgstr "·Ù¹ð" #: src/globs.h:31 msgid "Error" msgstr "¥¨¥é¡¼" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "¥³¥á¥ó¥ÈÃæ¤Ç EOF ¤ËÁø¶ø¤·¤Þ¤·¤¿" #: src/indent.c:345 msgid "Line broken" msgstr "¹Ô¤¬²õ¤ì¤Æ¤¤¤Þ¤¹" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "ͽ´ü¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤Ç¤¹" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Èó¶õ¹Ô¤¬ %d ¹Ô¡¢¥³¥á¥ó¥È¤¬ %d ¹Ô¤¢¤ê¤Þ¤¹\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(¥³¥á¥ó¥ÈÉÕ¤­¤Î¹Ô)/(¥³¡¼¥ÉÉÕ¤­¤Î¹Ô): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "¹Ô¤¬²õ¤ì¤Æ¤¤¤Þ¤¹ 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: Í£°ì¤Î½ÐÎÏ¥Õ¥¡¥¤¥ë (2ÈÖÌÜ¤Ï %s ¤Ç¤·¤¿)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: ½ÐÎÏ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤¿¤È¤­¤ÎÍ£°ì¤ÎÆþÎÏ¥Õ¥¡¥¤¥ë¤Ç¤¹\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: ɸ½àÆþÎϤǻØÄꤵ¤ì¤¿»þ¤Ë¥Õ¥¡¥¤¥ë̾¤¬¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: stdout ¤¬»ÈÍѤµ¤ì¤¿»þÍ£°ì¤ÎÆþÎÏ¥Õ¥¡¥¤¥ë¤Ç¤¹\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "¥×¥í¥Õ¥¡¥¤¥ë %s ¤òÆÉ¤ß¤Þ¤¹\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "ÆâÉô¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥¨¥é¡¼" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "ÆþÎÏ¥Õ¥¡¥¤¥ë %s ¤¬³«¤±¤Þ¤»¤ó" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "ÆþÎÏ¥Õ¥¡¥¤¥ë %s ¤ò stat ¤Ç¤­¤Þ¤»¤ó" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "·Ù¹ð: Ťµ¥¼¥í¤Î¥Õ¥¡¥¤¥ë %s ¤Ç¤¹" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "¥Õ¥¡¥¤¥ë %s ¤ÏÆÉ¹þ¤à¤Ë¤ÏÂ礭¤¹¤®¤Þ¤¹" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "¥Õ¥¡¥¤¥ë %s ¤òÆÉ¹þ¤ßÃæ¤Ë¥·¥¹¥Æ¥àÌäÂ꤬ȯÀ¸¤·¤Þ¤·¤¿" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "ÆþÎÏ¥Õ¥¡¥¤¥ë %s ¤ÎÆÉ¹þ¤ß¥¨¥é¡¼" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "ÆþÎÏ¥Õ¥¡¥¤¥ë %s ¤òÊĤ¸¤ë¤È¤­¤Ë¥¨¥é¡¼" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "·Ù¹ð: ¥Õ¥¡¥¤¥ë %s ¤Ï NULLʸ»ú¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "ʸ»úÄê¿ô¤¬½ªÎ»¤·¤Æ¤¤¤Þ¤»¤ó" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "ʸ»úÎ󤬽ªÎ»¤·¤Æ¤¤¤Þ¤»¤ó" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "\"=%c\" Ãæ¤Ç¸Å¤¤¥¹¥¿¥¤¥ë¤Î³äÅö¤Æ¤ÎÛ£Ëæ¤Êɽ¸½. \"= %c\" ¤È²¾Äꤷ¤Þ¤¹\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: %s ¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "½ÐÎÏ¥Õ¥¡¥¤¥ë %s ¤òÊĤ¸¤é¤ì¤Þ¤»¤ó" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "½ÐÎÏ¥Õ¥¡¥¤¥ë %s ¤ÎÊѹ¹»þ¹ï¤òÊݸ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "'else' ¤¬ÉÔ°ìÃ×" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "stmt ¥Í¥¹¥È¥¨¥é¡¼." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "¥Ñ¡¼¥µ¡¼¤Ø¤ÎÉÔÌÀ¤Ê¥³¡¼¥É" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "'@' ¥Õ¥¡¥¤¥ë¤ò¸«¤Ä¤±¤é¤ì¤Þ¤»¤ó!" #~ msgid "Ran out of memory" #~ msgstr "¥á¥â¥ê¤ò»È¤¤²Ì¤¿¤·¤Þ¤·¤¿" #~ msgid "Extra %c" #~ msgstr ";·×¤Ê %c" #~ msgid "Unmatched #else" #~ msgstr "#else ¤¬°ìÃפ·¤Þ¤»¤ó" #~ msgid "Unmatched #elif" #~ msgstr "#elif ¤¬°ìÃפ·¤Þ¤»¤ó" #~ msgid "Unmatched #endif" #~ msgstr "#endif ¤¬°ìÃפ·¤Þ¤»¤ó" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "" #~ "»ÈÍÑË¡: indent ¥Õ¥¡¥¤¥ë [-o ½ÐÎÏ¥Õ¥¡¥¤¥ë ] [ ¥ª¥×¥·¥ç¥ó ]\n" #~ "\n" indent-2.2.11/po/sv.gmo0000644000177400010010000001013111331327563011544 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H AT +– / ò  !) K 7i 3¡ $Õ 'ú " B !F "h ‹ š ¯ º Ç *Ý $ - @ %[ 7 ¹ Ï ä ñ  #(+&T{8ŽÇà#ô935m4£4Ø?  M  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.8 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2002-10-25 19:20+0200 Last-Translator: Christian Rose Language-Team: Swedish MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit stack[%d] => stack: %d ind_level: %d (Rader med kommentarer)/(Rader med kod): %6.3f KAN INTE HITTA "@"-FIL!Kan inte stänga utdatafilen %sKan inte öppna säkerhetskopian %sKan inte öppna indatafilen %sKan inte bevara modifieringstiden på säkerhetskopian %sKan inte bevara modifieringstiden på utdatafilen %sKan inte ta status på indatafilen %sKan inte skriva till säkerhetskopian %sFilslut påträffades i kommentarFelFel vid läsning av indatafilen %sFilen %s är för stor för att läsasGNU indent %s Internt buffringsfelRad brutenRad bruten 2Tolkningsstack [%d]: Profilen innehåller en oavslutad kommentarProfilen innehåller osmakliga teckenLäste profilen %s Fel i kapsling av uttryck.Systemproblem vid läsning av filen %sDet fanns %d icke-tomma utdatarader och %d kommentarer Oväntat slut på filenKod okänd för tolkenOmaka "else"Oavslutad teckenkonstantOavslutad strängkonstantVarningindent: Konstigt versionskontrollvärde indent: Använder "numbered-existing" indent: %s:%d: %s:indent: Kan inte skapa filnamn för säkerhetskopia av %s indent: Ödesdigert fel: indent: Systemfel: indent: Virtuellt minne förbrukat. indent: kan inte skapa %s indent: filnamn är inte tillåtna när standard in används indent: endast en indatafil när utdatafil är angiven indent: endast en indatafil när standard ut används indent: endast en utdatafil tillåten (andra var %s) tvetydighet i tilldelningen "=%c" (gammal form). Antar "= %c" flagga: %s indent-2.2.11/po/boldquot.sed0000644000177400010010000000033111041664103012727 00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g indent-2.2.11/po/Makevars0000644000177400010010000000207310775646104012120 00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = indent-2.2.11/po/fi.gmo0000644000177400010010000001220311331327563011514 00000000000000Þ•5ÄGlˆ+‰%µ/Û /$Tj…Ÿ2¸2ë7Upv’G­õ  )7(I'rš«¿5Þ+BSs ˜'¥!Íï) , B "Y | <• :Ò 0 *> :i ¤ &° ]× U5 +‹ (· 3à ! D6 { ˜ "¸ Û 5û 11%c(‰ ²Ó#Ù&ýJ$o~™¨¹)Ë+õ!6,PE}Ã ß 0Q Z#f0Š»>Î $!A"cK†DÒC0[GŒ Ô'âx  5" 21,/)$ 3'#& -4!(%.* 0+ stack[%d] => stack: %d ind_level: %d %s: missing argument to parameter %s %s: option ``%s'' requires a numeric parameter %s: unknown option "%s" (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readFile named by environment variable %s does not exist or is not readableGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningcommand lineindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s set_option: internal error: p_type %d usage: indent file [-o outfile ] [ options ] indent file1 file2 ... fileN [ options ] Project-Id-Version: indent 2.2.10 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2009-08-02 12:16+0300 Last-Translator: Lauri Nurmi Language-Team: Finnish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stack[%d] => stack: %d ind_level: %d %s: puuttuva argumentti parametrille %s %s: valitsin â€%s†vaatii numeerisen parametrin %s: tuntematon valitsin â€%s†(Kommentin sisältävät rivit)/(Koodia sisältävät rivit): %6.3f â€@â€-TIEDOSTOA EI LÖYDY!Ei voi sulkea tulostiedostoa %sEi voi avata varmistustiedostoa %sEi voi avata syötetiedostoa %sEi voi säilyttää varmistustiedoston %s muutosaikaaTulostiedoston %s muutosaikaa ei voi säilyttääEi voi lukea syötetiedoston %s tilaaEi voi kirjoittaa varmistustiedostoon %sTiedoston loppu kesken kommentinVirheVirhe luettaessa syötetiedostoa %sTiedosto %s on liian suuri luettavaksiYmpäristömuuttujassa %s annettu tiedosto ei ole olemassa tai luettavissaGNU indent %s Sisäinen puskurointivirheKatkennut riviKatkennut rivi 2ParseStack [%d]: Profiilissa on päättämätön kommenttiProfiilissa on epämiellyttäviä merkkejäLuetaan profiili %s Stmt-sisäkkäistysvirhe.Järjestelmäongelma luettaessa tiedostoa %sEi-tyhjiä tulosrivejä oli %d kappaletta, kommentteja %d kappaletta Odottamaton tiedoston loppuJäsentäjälle tuntematon koodiPariton â€elseâ€Päättämätön merkkivakioPäättämätön merkkijonovakioVaroituskomentoriviindent: Outo versionhallinta-arvo indent: Käytetään numeroitua-olemassaolevaa indent: %s:%d: %s:indent: Ei voi luoda varmistustiedoston nimeä tiedostolle %s indent: Vakava virhe: indent: Järjestelmävirhe: indent: Virtuaalimuisti lopussa. indent: tiedostoa %s ei voi luoda indent: tiedostonimiä ei voi käyttää, kun käytetään vakiosyötettä indent: vain yksi syötetiedosto, kun tulostiedosto on määritetty indent: vain yksi syötetiedosto, kun käytetään vakiotulostetta indent: vain yksi tulostiedosto (toinen oli %s) vanhan tyylin moniselitteinen sijoitus â€=%câ€. Oletetaan â€= %c†valitsin: %s set_option: sisäinen virhe: p_type %d käyttö: indent tiedosto [-o tulostied] [ valitsimet ] indent tiedosto1 tiedosto2 ... tiedostoN [ valitsimet ] indent-2.2.11/po/it.gmo0000644000177400010010000001051011331327563011531 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H LT +¡ /Í ý ) 'E &m A” AÖ ) )B l Š )‘ +» ç ö  ! 2 -D )r œ ± 'Ì 3ô (#Bf(|&¥ Ì*×"%=8vŽ#ªÎQíE?;…3ÁEõ ;  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: GNU indent 2.2.8 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2002-10-23 22:17+0200 Last-Translator: Marco Parrone Language-Team: Italian MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit stack[%d] => stack: %d ind_level: %d (Linee con commenti)/(Linee con codice): %6.3f IMPOSSIBILE TROVARE FILE «@»!Impossibile chiudere il file di output %sImpossibile aprire il file di backup %sImpossibile aprire il file di input %sImpossibile preservare il modification time sui file di backup %sImpossibile preservare il modification time sul file di output %sImpossibile esaminare il file di input %sImpossibile scrivere al file di backup %sIncontrato EOF in un commentoErroreErrore nella lettura del file di input %sIl file %s è troppo grande per essere lettoGNU indent %s Errore di buffering internoLinea spezzataLinea spezzata 2ParseStack [%d]: Il profilo contiene un commento non terminatoIl profilo contiene caratteri non graditiLetto il profilo %s Errore di annidazione StmtProblema di sistema leggendo il file %sC'erano %d linee di output non vuote e %d commenti Fine del file inaspettataCodice sconosciuto all'analizzatore«else» non accoppiatoCostante di tipo carattere non terminataCostante di tipo stringa non terminataAttenzioneindent: Strano valore di version-control indent: numbered-existing in uso indent: %s:%d: %s:indent: Impossibile creare il nome del file di backup per %s indent: Errore fatale: indent: Errore di sistema: indent: Memoria virtuale esaurita. indent: impossibile creare %s indent: non è possibile avere nomi di file quando si specifica lo standard input indent: solo un file di input quando è specificato il file di output indent: solo un file di input quando viene usato lo stdout indent: solo un file di output (il secondo era %s) ambiguità nell'assegnamento di vecchio stile in «=%c». Assumo «= %c» opzione: %s indent-2.2.11/po/hu.po0000644000177400010010000001644611331327561011401 00000000000000# Hungarian translate of the indent # Copyright (C) 2002 Free Software Foundation, Inc. # Gábor István , 2002. # Tímár András , 2003. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2003-04-17 14:46+0200\n" "Last-Translator: Andras Timar \n" "Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-2\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent fájl1 fájl2 ... fájlN [ kapcsolók ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: a %s paraméter argumentuma hiányzik\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: ismeretlen kapcsoló \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "kapcsoló:%s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: a ``%s'' kapcsoló számparamétert igényel\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: belsõ hiba: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "A profil nem lezárt megjegyzést tartalmaz" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "A profil oda nem illõ karaktert tartalmaz" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Furcsa verziókövetés-érték\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Számozott-létezõ használata\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: %s fájlról nem lehet biztonsági mentést készíteni\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Nem lehet megnyitni a %s biztonsági mentés fájlt" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Nem lehet írni a %s biztonsági mentés fájlba" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Nem lehet megõrizni a %s biztonsági mentés fájl módosításának idejét" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Virtuális memória elfogyott.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Végzetes hiba: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Rendszerhiba " #: src/globs.h:27 msgid "Warning" msgstr "Figyelmeztetés" #: src/globs.h:31 msgid "Error" msgstr "Hiba" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "EOF (fájl vége) a megjegyzésben" #: src/indent.c:345 msgid "Line broken" msgstr "Törött sor" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Váratlan fájlvég" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "%d nem üres sor és %d megjegyzés volt\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Megjegyzéssorok)/(Kódsorok):%6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Törött sor 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: csak egy kimeneti fájl van (a második %s volt)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "" "indent: csak egy bemeneti fájl lehet, amikor a kimenet meg van határozva\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: nem lehet megadni fájlnevet amikor a standard bemenet van " "meghatározva\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: csak egy bemeneti fájl lehet, amikor az stdout van használva\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "A %s profil olvasása\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Belsõ pufferhiba" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Nem lehet megnyitni a %s bemeneti fájlt" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Nem lehet a statolni a %s bemeneti fájlt" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Figyelmeztetés: %s fájl nulla hosszúságú" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "A %s fájl túl hosszú az olvasáshoz" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Rendszerprobléma a %s fájl olvasása közben" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Hiba a %s bemeneti fájl olvasása közben" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Hiba a %s bemeneti fájl lezárásakor" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Figyelmeztetés: A %s fájl NULL karaktereket tartalmaz\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Lezáratlan karakterállandó" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Lezáratlan karakterlánc-állandó" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "régi stílusú kétértelmû hozzárendelés \"=%c\". \"= %c\" feltételezve\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: nem lehet létrehozni a %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Nem lehet a %s kimeneti fájlt lezárni" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Nem lehet a %s kimeneti fájl módosítási idejét megõrizni" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Pár nélküli 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Stmt beágyazási hiba." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Ismeretlen kód a feldolgozóban" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " verem[%d] => verem: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "NINCS MEG A '@' FÁJL!" #~ msgid "Ran out of memory" #~ msgstr "A memória elfogyott" #~ msgid "Extra %c" #~ msgstr "Extra %c" #~ msgid "Unmatched #else" #~ msgstr "Pár nélküli #else" #~ msgid "Unmatched #elif" #~ msgstr "Pár nélküli #elif" #~ msgid "Unmatched #endif" #~ msgstr "Pár nélküli #endif" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "használat: indent fájl [-o kimenet ] [ kapcsolók ]\n" indent-2.2.11/po/insert-header.sin0000644000177400010010000000124011041664103013646 00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } indent-2.2.11/po/eo.po0000644000177400010010000001647711331327561011374 00000000000000# Esperantaj mesaÄoj por GNU indent. # This file is distributed under the same license as the indent package. # # Copyright (C) 2002 Free Software Foundation, Inc. # Edmund GRIMLEY EVANS , 2001-2002. # Felipe Castro , 2009. # msgid "" msgstr "" "Project-Id-Version: GNU indent 2.2.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2009-01-20 12:00-0300\n" "Last-Translator: Edmund GRIMLEY EVANS \n" "Language-Team: Esperanto \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr "" "uzado: indent dosiero [-o eligdosiero ] [ opcioj ]\n" " indent dosiero1 dosiero2 ... dosieroN [ opcioj ]\n" #: src/args.c:677 #, c-format msgid "%s: missing argument to parameter %s\n" msgstr "%s: argumento mankas por parametro %s\n" #: src/args.c:802 #, c-format msgid "%s: unknown option \"%s\"\n" msgstr "%s: nekonata opcio \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "opcio: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "%s: opcio \"%s\" bezonas numeran parametron\n" #: src/args.c:921 #, c-format msgid "set_option: internal error: p_type %d\n" msgstr "set_option: interna eraro: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profilo enhavas nefinitan komenton" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profilo enhavas malagrablajn signojn" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" "La dosiero nomita de la ĉirkaÅ­aĵa variablo %s ne ekzistas aÅ­ ne legeblas" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Stranga valoro por versi-administrado\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Uzas 'numbered-existing'\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Ne povas fari sekurkopian dosiernomon de %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Ne povas malfermi sekurkopian dosieron %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Ne povas skribi al sekurkopia dosiero %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Ne povas konservi modif-tempon en la sekurkopia dosiero %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Virtuala memoro elĉerpiÄis.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Grava Eraro: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Sistem-Eraro: " #: src/globs.h:27 msgid "Warning" msgstr "Averto" #: src/globs.h:31 msgid "Error" msgstr "Eraro" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Dosierfino (EOF) en komento" #: src/indent.c:345 msgid "Line broken" msgstr "Linio rompita" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Neatendita fino de dosiero" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Estis %d nemalplenaj eliglinioj kaj %d komentoj\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Linioj kun komentoj)/(Linioj kun kodumo): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Linio rompita 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: nur unu eligdosiero (dua estis %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: nur unu enigdosiero, kiam eligdosiero estas specifita\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: dosiernomoj ne eblas, kiam la normala enigo estas specifita\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: nur unu enigdosiero, kiam la normala eligo estas uzata\n" #: src/indent.c:857 msgid "command line" msgstr "komand-linio" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Legi profilon %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Interna eraro ĉe bufrado" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Ne povas malfermi enigdosieron %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Ne povas uzi 'stat' sur enigdosiero %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Avero: Malplena dosiero %s" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Dosiero %s estas tro granda por legado" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Sistemproblemo ĉe legado de %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Eraro dum legado de %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Eraro dum fermado de %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Averto: Dosiero %s enhavas NUL-signojn\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Nefinita signo-konstanto" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Nefinita ĉen-konstanto" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "malnovstila plursenceco de atribuado en \"=%c\". Supozas \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: ne povas krei %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Ne povas fermi eligdosieron %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Ne povas konservi modif-tempon en la eligdosiero %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Senpara 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Eraro en ingado de ordonoj." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Nekonata kodo por analizilo" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "NE POVAS TROVI '@'-DOSIERON!" #~ msgid "Ran out of memory" #~ msgstr "Memoro elĉerpiÄis" #~ msgid "Extra %c" #~ msgstr "Kroma %c" #~ msgid "Unmatched #else" #~ msgstr "Senpara #else" #~ msgid "Unmatched #elif" #~ msgstr "Senpara #elif" #~ msgid "Unmatched #endif" #~ msgstr "Senpara #endif" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "uzado: indent dosiero [-o eligdosiero ] [ opcioj ]\n" indent-2.2.11/po/ko.po0000644000177400010010000001557511331327562011401 00000000000000# Korean messages for indent. # Copyright (C) 1996 Free Software Foundation, Inc. # Bang Jun-Young , 1997. # msgid "" msgstr "" "Project-Id-Version: indent 1.9.1a\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 1997-01-24 10:21+0900\n" "Last-Translator: Bang Jun-Young \n" "Language-Team: Korean \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=EUC-KR\n" "Content-Transfer-Encoding: 8-bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " %s ÆÄÀÏ1 ÆÄÀÏ2 ... ÆÄÀÏ# [ ¿É¼Ç ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: ¸Å°³º¯¼ö %s¿¡ ´ëÇÑ Àμö°¡ ºüÁ³À½\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: ¾Ë ¼ö ¾ø´Â ¿É¼Ç \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "¿É¼Ç: %s\n" #: src/args.c:828 #, fuzzy, c-format msgid "GNU indent %s\n" msgstr "indent: %s" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: ¿É¼Ç `%s''´Â ¼ýÀÚ ¸Å°³º¯¼ö°¡ ÇÊ¿äÇÕ´Ï´Ù\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: ³»ºÎ ¿À·ù: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: ÀÌ»óÇÑ ¹öÀü-Á¦¾î °ª\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "" #: src/backup.c:498 #, fuzzy, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: %sÀÇ º¸°ü¿ë ÆÄÀÏÀ̸§À» ¸¸µé ¼ö ¾ø½À´Ï´Ù" #: src/backup.c:506 #, fuzzy, c-format msgid "Can't open backup file %s" msgstr "indent: %sÀÇ º¸°ü¿ë ÆÄÀÏÀ̸§À» ¸¸µé ¼ö ¾ø½À´Ï´Ù" #: src/backup.c:513 #, fuzzy, c-format msgid "Can't write to backup file %s" msgstr "indent: %sÀÇ º¸°ü¿ë ÆÄÀÏÀ̸§À» ¸¸µé ¼ö ¾ø½À´Ï´Ù" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: °¡»ó ¸Þ¸ð¸®°¡ ¹Ù´Ú³².\n" #: src/globs.c:93 #, fuzzy, c-format msgid "indent: %s:%d: %s:" msgstr "indent:%s:%d: %s: " #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "" #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "" #: src/globs.h:27 msgid "Warning" msgstr "" #: src/globs.h:31 msgid "Error" msgstr "" #: src/indent.c:284 #, fuzzy msgid "EOF encountered in comment" msgstr "´ÝÈ÷Áö ¾ÊÀº ÁÖ¼®" #: src/indent.c:345 msgid "Line broken" msgstr "ÇàÀÌ ±ú¾îÁü" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "" #: src/indent.c:528 #, fuzzy, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "%d °³ÀÇ Ãâ·ÂÇà°ú %d °³ÀÇ ÁÖ¼®\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(ÁÖ¼®À¸·Î µÈ Çà)/(ÄÚµå·Î µÈ Çà): %6.3f\n" #: src/indent.c:556 #, fuzzy msgid "Line broken 2" msgstr "ÇàÀÌ ±ú¾îÁü" #: src/indent.c:778 #, fuzzy, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "%s: ¿ÀÁ÷ ÇϳªÀÇ Ãâ·Â ÆÄÀÏ (µÎ¹øÂ°´Â %s)\n" #: src/indent.c:787 src/indent.c:813 #, fuzzy, c-format msgid "indent: only one input file when output file is specified\n" msgstr "%s: Ãâ·Â ÆÄÀÏÀÌ ÁöÁ¤µÇ¸é ÀÔ·Â ÆÄÀÏÀº ¿ÀÁ÷ Çϳª¸¸ ÀÖ¾î¾ß ÇÕ´Ï´Ù\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: Ç¥ÁØ ÀÔ·ÂÀ» ÁöÁ¤ÇÒ ¶§¿¡´Â ÆÄÀϸíÀ» ÁöÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: Ç¥ÁØÃâ·ÂÀÌ »ç¿ëµÇ¸é ÀÔ·Â ÆÄÀÏÀº ¿ÀÁ÷ Çϳª¸¸ ÀÖ¾î¾ß ÇÕ´Ï´Ù\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "ÇÁ·ÎÆÄÀÏ %sÀ» Àоú½À´Ï´Ù\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "³»ºÎ ¹öÆÛ¸µ ¿À·ù" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "°æ°í: ÆÄÀÏ %s´Â Å©±â°¡ 0ÀÔ´Ï´Ù" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "" #: src/code_io.c:317 #, c-format msgid "Error closing input file %s" msgstr "" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "°æ°í: ÆÄÀÏ %s´Â NULL ¹®ÀÚ¸¦ Æ÷ÇÔÇϰí ÀÖ½À´Ï´Ù\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: %s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "¦ÀÌ ¸ÂÁö ¾Ê´Â 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "¹®Àå Áßø ¿À·ù." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "ÆÄ¼­°¡ ¾Ë ¼ö ¾ø´Â ÄÚµå" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " ½ºÅÃ[%d] => ½ºÅÃ: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "" #~ msgid "Extra %c" #~ msgstr "¿©ºÐÀÇ %c" #~ msgid "Unmatched #else" #~ msgstr "¦ÀÌ ¸ÂÁö ¾Ê´Â #else" #, fuzzy #~ msgid "Unmatched #elif" #~ msgstr "¦ÀÌ ¸ÂÁö ¾Ê´Â #endif" #~ msgid "Unmatched #endif" #~ msgstr "¦ÀÌ ¸ÂÁö ¾Ê´Â #endif" #~ msgid "usage: %s file [-o outfile ] [ options ]\n" #~ msgstr "»ç¿ë¹ý: %s ÆÄÀÏ [-o Ãâ·ÂÆÄÀÏ] [ ¿É¼Ç ]\n" #~ msgid "Stuff missing from end of file." #~ msgstr "ÆÄÀϳ¡ÀÇ ºüÁø ºÎºÐ" #~ msgid "Unbalanced parens" #~ msgstr "±ÕÇüÀÌ ¸ÂÁö ¾Ê´Â °ýÈ£" #~ msgid "%s: can't have filenames when specifying standard input\n" #~ msgstr "%s: Ç¥ÁØ ÀÔ·ÂÀ» ÁöÁ¤ÇÒ ¶§¿¡´Â ÆÄÀϸíÀ» ÁöÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù\n" #~ msgid "Standard input" #~ msgstr "Ç¥ÁØ ÀÔ·Â" #~ msgid "indent: bad font specification: %s\n" #~ msgstr "indent: À߸øµÈ ÆùÆ® ÁöÁ¤: %s\n" #~ msgid "" #~ "\n" #~ "*** Debug output marker line ***\n" #~ msgstr "" #~ "\n" #~ "*** µð¹ö±× Ãâ·Â Ç¥½ÃÇà ***\n" indent-2.2.11/po/indent.pot0000644000177400010010000001165311331327560012424 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr "" #: src/args.c:677 #, c-format msgid "%s: missing argument to parameter %s\n" msgstr "" #: src/args.c:802 #, c-format msgid "%s: unknown option \"%s\"\n" msgstr "" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "" #: src/args.c:913 #, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "" #: src/args.c:921 #, c-format msgid "set_option: internal error: p_type %d\n" msgstr "" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "" #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "" #: src/globs.h:27 msgid "Warning" msgstr "" #: src/globs.h:31 msgid "Error" msgstr "" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "" #: src/indent.c:345 msgid "Line broken" msgstr "" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "" #: src/indent.c:556 msgid "Line broken 2" msgstr "" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "" #: src/code_io.c:272 #, c-format msgid "Zero-length file %s" msgstr "" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "" #: src/code_io.c:317 #, c-format msgid "Error closing input file %s" msgstr "" #: src/code_io.c:507 #, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "" #: src/parse.c:515 msgid "Unknown code to parser" msgstr "" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr "" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "" indent-2.2.11/po/LINGUAS0000644000177400010010000000010710775646104011445 00000000000000ca da de eo et fi fr gl hu it ja ko nl pl pt_BR ru sk sv tr zh_TW.Big5 indent-2.2.11/po/nl.po0000644000177400010010000001704011331327562011366 00000000000000# Dutch translations for indent. # Copyright (C) 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the indent package. # # Gerald Raucamp , 2000. # Benno Schulenberg , 2005, 2007, 2008. msgid "" msgstr "" "Project-Id-Version: indent-2.2.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2008-05-17 21:27+0200\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/args.c:611 msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr "" "Gebruik: indent BESTAND [-o UITVOERBESTAND] [OPTIES]\n" " of: indent BESTAND1 BESTAND2 ... BESTANDn [OPTIES]\n" #: src/args.c:677 #, c-format msgid "%s: missing argument to parameter %s\n" msgstr "%s: ontbrekend argument bij optie %s\n" #: src/args.c:802 #, c-format msgid "%s: unknown option \"%s\"\n" msgstr "%s: onbekende optie '%s'\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "optie: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "%s: optie '%s' vereist een numeriek argument\n" #: src/args.c:921 #, c-format msgid "set_option: internal error: p_type %d\n" msgstr "set_option(): *interne fout*: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profiel bevat een onafgemaakt commentaar" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profiel bevat ongeldige tekens" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" "Het bestand genoemd in omgevingsvariable %s bestaat niet\n" "of is niet leesbaar" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: vreemde waarde voor versiebeheer\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: bestaande nummering wordt gebruikt\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: kan geen bestandsnaam maken voor een reservekopie van %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Kan reservekopiebestand %s niet openen" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Kan reservekopiebestand %s niet schrijven" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Kan wijzigingstijd van reservekopiebestand %s niet behouden" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Onvoldoende virtueel geheugen beschikbaar.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Fatale fout: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Systeemfout: " #: src/globs.h:27 msgid "Warning" msgstr "Waarschuwing" #: src/globs.h:31 msgid "Error" msgstr "Fout" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Einde van bestand werd bereikt midden in een commentaar" #: src/indent.c:345 msgid "Line broken" msgstr "Regel afgebroken" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Onverwacht bestandseinde" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Er waren %d niet-lege uitvoerregels en %d commentaarregels\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Regels met commentaar)/(Regels met code): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Regel afgebroken 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: slechts één uitvoerbestand is mogelijk (het tweede was %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "" "indent: slechts één invoerbestand is toegestaan als uitvoerbestand gegeven " "is\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: bestandsnamen niet toegestaan bij gebruik van standaardinvoer\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "" "indent: slechts één invoerbestand toegestaan bij gebruik van " "standaarduitvoer\n" #: src/indent.c:857 msgid "command line" msgstr "opdrachtregel" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Profiel %s gelezen\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "*Interne bufferfout*" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Kan invoerbestand %s niet openen" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Kan status van invoerbestand %s niet opvragen" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Waarschuwing: bestand %s heeft lengte nul" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Bestand %s is te groot om in te lezen" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Systeem heeft problemen met het lezen van bestand %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Fout bij lezen van invoerbestand %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Fout bij sluiten van invoerbestand %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Waarschuwing: bestand %s bevat NULL-tekens\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Onafgemaakte tekenconstante" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Onafgemaakte tekenreeksconstante" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "toewijzing in oude stijl ('=%c') is meerduidig; begrepen als '= %c'\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: kan %s niet aanmaken\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Kan uitvoerbestand %s niet sluiten" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Kan wijzigingstijd van uitvoerbestand %s niet behouden" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Losse 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Nestingsfout van statements." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Onbekende code voor de ontleder" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "OntleedStapel [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stapel[%d] => stapel: %d inspring_niveau: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "KAN '@'-BESTAND NIET VINDEN!" #~ msgid "Ran out of memory" #~ msgstr "Onvoldoende geheugen beschikbaar" #~ msgid "Extra %c" #~ msgstr "Extra %c" #~ msgid "Unmatched #else" #~ msgstr "Losse '#else'" #~ msgid "Unmatched #elif" #~ msgstr "Losse '#elif'" #~ msgid "Unmatched #endif" #~ msgstr "Losse '#endif'" indent-2.2.11/po/de.gmo0000644000177400010010000001064111331327562011511 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H FT +› 2Ç ú 2 'J +r Iž Eè :. 5i Ÿ º &Á &è   5 F Y 4l )¡ "Ë $î 36G~–µ Êë /4CxBŒÏè'ÿ 'JH@“9Ô;JJ •  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: GNU indent 2.2.8 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2002-10-24 21:39+0200 Last-Translator: Martin von Löwis Language-Team: German MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8-bit stack[%d] => stack: %d ind_level: %d (Zeilen mit Kommentaren)/(Zeilen mit Code): %6.3f KANN DATEI '@' NICHT FINDEN!Die Ausgabedatei %s kann nicht geschlossen werden.Backup-Datei %s läßt sich nicht öffnen.Die Eingabedatei %s läßt sich nicht öffnen.Die Modifikationszeit kann für die Backup-Datei %s nicht erhalten werden.Die Modifikationszeit der Ausgabedatei %s kann nicht erhalten werden.Für die Eingabedatei %s kann stat nicht ausgeführt werden.In die Backup-Datei %s kann nicht geschrieben werden.EOF in Kommentar gefunden.FehlerFehler beim Lesen der Eingabedatei %s.Die Datei %s ist zu groß zum Einlesen.GNU indent: %s Interner PufferfehlerZeile umbrochen.Zeile umbrochen 2.Parse-Stack [%d]: Das Profile enthält einen nicht-beendeten Kommentar.Das Profile enthält ungenießbare Zeichen.Lese Vorgabedatei (»profile«) %s. Fehler in Anweisungsverschachtelung.Ein Systemproblem trat beim Lesen der Datei %s auf.Es gab %d nichtleere Ausgabezeilen und %d Kommentare. Unerwartetes Dateiende.Code ist dem Parser unbekannt.Unerwartetes »else«.Nicht-beendete Zeichenkonstante.Nicht-beendete Stringkonstante.Warnungindent: Seltsamer Wert für Versionsverwaltung. indent: nummeriert-falls-vorhanden wird verwendet. indent: %s:%d: %s: indent: Name der Backup-Datei für %s kann nicht ermittelt werden. indent: Fataler Fehler: indent: Systemfehler: indent: Virtueller Speicher erschöpft. indent: Kann %s nicht erzeugen. indent: Dateinamen sind nicht erlaubt bei Verwendung der Standardeingabe. indent: Nur eine Eingabedatei, wenn Ausgabedatei angegeben ist. indent: Nur eine Eingabedatei bei Verwendung von stdout. indent: Nur eine Ausgabedatei erlaubt (die zweite war %s). Mehrdeutigkeit der Zuweisung in "=%c" (alte Form). "= %c" wird verwendet. option: %s indent-2.2.11/po/fr.gmo0000644000177400010010000001070511331327563011532 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H €T /Õ 4 ": &] &„ %« EÑ A (Y +‚ 2® á (è & 8 H c p  ,‘ -¾ ì $1(3ZŽ%¨Î$á$ +/97i¡3´è#=SWJ«Nö3E?y ¹  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: GNU indent 2.2.8 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2004-05-10 08:00-0500 Last-Translator: Michel Robitaille Language-Team: French MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8-bit Plural-Forms: nplurals=2; plural=(n > 1); pile[%d] => pile: %d niveau_indirect: %d (Lignes avec commantaire)/(Lignes de codage): %6.3f NE PEUT REPÉRER LE FICHIER « @ » !Ne peut fermer le fichier de sortie %sNe peut ouvrir le fichier d'archive %sNe peut ouvrir le fichier d'entrée %sNe peut préserver la date de modification sur le fichier d'archive %sNe peut préserver la date de modification du fichier de sortie %sNe peut évaluer le fichier %s par stat()Ne peut écrire dans le fichier d'archive %sFin de fichier (EOF) rencontré dans le commentaireErreurErreur de lecture du fichier d'entrée %sFichier %s est trop grand pour être luGNU indent: %s ERREUR interne de stockageLigne briséeLigne 2 briséeParseStack [%d]: Profile contient un commentaire non complétéProfile contient des caractères non conformesLecture du profile %s ERREUR de bouclage d'une déclarationProblème système lors de la lecture de fichier %sIl y a eu %d lignes non vides et %d commentaire(s) Fin de fichier inattendueCode inconnu à l'analyseur syntaxique« else » non pairéConstante de caractères non terminéeConstante de caractères non terminéeAvertissementindent: étrange valeur de version de contrôle indent: utilisation d'un code de terminaison numérique indent: %s:%d: %s:indent: ne peut créer le fichier d'archivage de %s indent: erreur fatale: indent: erreur système: indent: mémoire virtuelle épuisée. indent: ne peut créer %s indent: ne peut avoir des noms de fichiers lorsque l'entrée standard est spécifiée indent: un seul fichier d'entrée lorsqu'un fichier de sortie est spécifié indent: seulement un fichier d'entrée lorsque la sortie standard est utilisée indent: un seul fichier de sortie (le 2e était %s) Vieux style d'affectation ambigü dans "=%c". On assume "= %c" option: %s indent-2.2.11/po/fi.po0000644000177400010010000001652511331327561011361 00000000000000# Finnish translation for GNU indent. # Copyright © 2002, 2009 Free Software Foundation, Inc. # This file is distributed under the same license as the indent package. # Lauri Nurmi , 2002, 2009. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2009-08-02 12:16+0300\n" "Last-Translator: Lauri Nurmi \n" "Language-Team: Finnish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr "" "käyttö: indent tiedosto [-o tulostied] [ valitsimet ]\n" " indent tiedosto1 tiedosto2 ... tiedostoN [ valitsimet ]\n" #: src/args.c:677 #, c-format msgid "%s: missing argument to parameter %s\n" msgstr "%s: puuttuva argumentti parametrille %s\n" #: src/args.c:802 #, c-format msgid "%s: unknown option \"%s\"\n" msgstr "%s: tuntematon valitsin â€%sâ€\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "valitsin: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "%s: valitsin â€%s†vaatii numeerisen parametrin\n" #: src/args.c:921 #, c-format msgid "set_option: internal error: p_type %d\n" msgstr "set_option: sisäinen virhe: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profiilissa on päättämätön kommentti" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profiilissa on epämiellyttäviä merkkejä" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" "Ympäristömuuttujassa %s annettu tiedosto ei ole olemassa tai luettavissa" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Outo versionhallinta-arvo\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Käytetään numeroitua-olemassaolevaa\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Ei voi luoda varmistustiedoston nimeä tiedostolle %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Ei voi avata varmistustiedostoa %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Ei voi kirjoittaa varmistustiedostoon %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Ei voi säilyttää varmistustiedoston %s muutosaikaa" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Virtuaalimuisti lopussa.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Vakava virhe: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Järjestelmävirhe: " #: src/globs.h:27 msgid "Warning" msgstr "Varoitus" #: src/globs.h:31 msgid "Error" msgstr "Virhe" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Tiedoston loppu kesken kommentin" #: src/indent.c:345 msgid "Line broken" msgstr "Katkennut rivi" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Odottamaton tiedoston loppu" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Ei-tyhjiä tulosrivejä oli %d kappaletta, kommentteja %d kappaletta\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Kommentin sisältävät rivit)/(Koodia sisältävät rivit): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Katkennut rivi 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: vain yksi tulostiedosto (toinen oli %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: vain yksi syötetiedosto, kun tulostiedosto on määritetty\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: tiedostonimiä ei voi käyttää, kun käytetään vakiosyötettä\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: vain yksi syötetiedosto, kun käytetään vakiotulostetta\n" #: src/indent.c:857 msgid "command line" msgstr "komentorivi" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Luetaan profiili %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Sisäinen puskurointivirhe" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Ei voi avata syötetiedostoa %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Ei voi lukea syötetiedoston %s tilaa" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Varoitus: Nollan pituinen tiedosto %s" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Tiedosto %s on liian suuri luettavaksi" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Järjestelmäongelma luettaessa tiedostoa %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Virhe luettaessa syötetiedostoa %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Virhe suljettaessa syötetiedostoa %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Varoitus: Tiedostossa %s on NULL-merkkejä\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Päättämätön merkkivakio" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Päättämätön merkkijonovakio" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "vanhan tyylin moniselitteinen sijoitus â€=%câ€. Oletetaan â€= %câ€\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: tiedostoa %s ei voi luoda\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Ei voi sulkea tulostiedostoa %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Tulostiedoston %s muutosaikaa ei voi säilyttää" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Pariton â€elseâ€" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Stmt-sisäkkäistysvirhe." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Jäsentäjälle tuntematon koodi" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "â€@â€-TIEDOSTOA EI LÖYDY!" #~ msgid "Ran out of memory" #~ msgstr "Muisti loppui" #~ msgid "Extra %c" #~ msgstr "Ylimääräinen %c" #~ msgid "Unmatched #else" #~ msgstr "Pariton #else" #~ msgid "Unmatched #elif" #~ msgstr "Pariton #elif" #~ msgid "Unmatched #endif" #~ msgstr "Pariton #endif" indent-2.2.11/po/Rules-quot0000644000177400010010000000323111041664103012406 00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header indent-2.2.11/po/quot.sed0000644000177400010010000000023111041664103012065 00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g indent-2.2.11/po/fr.po0000644000177400010010000002041711331327561011365 00000000000000# Messages français pour GNU concernant enscript. # Copyright © 2004 Free Software Foundation, Inc. # Michel Robitaille , traducteur depuis/since 1996. # msgid "" msgstr "" "Project-Id-Version: GNU indent 2.2.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2004-05-10 08:00-0500\n" "Last-Translator: Michel Robitaille \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent fichier1 fichier2 ... fichierN [ options ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: paramètre de l'option %s est manquant\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: option inconnue « %s »\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "option: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent: %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: l'option « %s » requiert un paramètre numérique\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: ERREUR interne: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profile contient un commentaire non complété" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profile contient des caractères non conformes" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: étrange valeur de version de contrôle\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: utilisation d'un code de terminaison numérique\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: ne peut créer le fichier d'archivage de %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Ne peut ouvrir le fichier d'archive %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Ne peut écrire dans le fichier d'archive %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Ne peut préserver la date de modification sur le fichier d'archive %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: mémoire virtuelle épuisée.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: erreur fatale: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: erreur système: " #: src/globs.h:27 msgid "Warning" msgstr "Avertissement" #: src/globs.h:31 msgid "Error" msgstr "Erreur" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Fin de fichier (EOF) rencontré dans le commentaire" #: src/indent.c:345 msgid "Line broken" msgstr "Ligne brisée" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Fin de fichier inattendue" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Il y a eu %d lignes non vides et %d commentaire(s)\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Lignes avec commantaire)/(Lignes de codage): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Ligne 2 brisée" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: un seul fichier de sortie (le 2e était %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "" "indent: un seul fichier d'entrée lorsqu'un fichier de sortie est spécifié\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: ne peut avoir des noms de fichiers lorsque l'entrée standard est " "spécifiée\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "" "indent: seulement un fichier d'entrée lorsque la sortie standard est " "utilisée\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Lecture du profile %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "ERREUR interne de stockage" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Ne peut ouvrir le fichier d'entrée %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Ne peut évaluer le fichier %s par stat()" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "AVERTISSEMENT: le fichier %s est vide." #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Fichier %s est trop grand pour être lu" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Problème système lors de la lecture de fichier %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Erreur de lecture du fichier d'entrée %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Erreur de fermeture du fichier d'entrée %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "AVERTISSEMENT: le fichier %s contient des caractères NULL.\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Constante de caractères non terminée" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Constante de caractères non terminée" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "Vieux style d'affectation ambigü dans \"=%c\". On assume \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: ne peut créer %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Ne peut fermer le fichier de sortie %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Ne peut préserver la date de modification du fichier de sortie %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "« else » non pairé" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "ERREUR de bouclage d'une déclaration" #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Code inconnu à l'analyseur syntaxique" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " pile[%d] => pile: %d niveau_indirect: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "NE PEUT REPÉRER LE FICHIER « @ » !" #~ msgid "Ran out of memory" #~ msgstr "Mémoire épuisée" #~ msgid "Extra %c" #~ msgstr "%c est superflu" #~ msgid "Unmatched #else" #~ msgstr "#else non pairé" #~ msgid "Unmatched #elif" #~ msgstr "#elif non pairé" #~ msgid "Unmatched #endif" #~ msgstr "#endif non pairé" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "usage: indent fichier [-o fichier_de_sortie] [options]\n" #~ msgid "Stuff missing from end of file." #~ msgstr "Quelque chose est manquant depuis la fin du fichier." #~ msgid "Unbalanced parens" #~ msgstr "Parenthèse(s) non fermée(s)" #~ msgid "%s: can't have filenames when specifying standard input\n" #~ msgstr "" #~ "%s: ne peut utiliser un nom de fichier lorsque l'entrée standard est " #~ "utilisée\n" #~ msgid "Standard input" #~ msgstr "Entrée statdard" #~ msgid "indent: bad font specification: %s\n" #~ msgstr "indent: spécifications erronées de la fonte: %s\n" #~ msgid "" #~ "\n" #~ "*** Debug output marker line ***\n" #~ msgstr "" #~ "\n" #~ "*** Ligne de démarcation de mise au point ***\n" #~ msgid "Parse: Unknown code: %d for %s\n" #~ msgstr "Analyseur syntaxique: code inconnu: %d pour %s\n" indent-2.2.11/po/eo.gmo0000644000177400010010000001173111331327563011526 00000000000000Þ•5ÄGlˆ+‰%µ/Û /$Tj…Ÿ2¸2ë7Upv’G­õ  )7(I'rš«¿5Þ+BSs ˜'¥!Íï) , B "Y | <• :Ò 0 *> :i ¤ &° ]× f5 +œ &È *ï  13 e ‚ )¡ !Ë :í 3(&\(ƒ¬ÈÎ&åL Yh ‚ "²$Õú (0Hy”°¿Øð ÷/"4W4jŸµ&ÌóD >R?‘+Ñ>ý <%Gkm 5" 21,/)$ 3'#& -4!(%.* 0+ stack[%d] => stack: %d ind_level: %d %s: missing argument to parameter %s %s: option ``%s'' requires a numeric parameter %s: unknown option "%s" (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readFile named by environment variable %s does not exist or is not readableGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningcommand lineindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s set_option: internal error: p_type %d usage: indent file [-o outfile ] [ options ] indent file1 file2 ... fileN [ options ] Project-Id-Version: GNU indent 2.2.10 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2009-01-20 12:00-0300 Last-Translator: Edmund GRIMLEY EVANS Language-Team: Esperanto MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit stack[%d] => stack: %d ind_level: %d %s: argumento mankas por parametro %s %s: opcio "%s" bezonas numeran parametron %s: nekonata opcio "%s" (Linioj kun komentoj)/(Linioj kun kodumo): %6.3f NE POVAS TROVI '@'-DOSIERON!Ne povas fermi eligdosieron %sNe povas malfermi sekurkopian dosieron %sNe povas malfermi enigdosieron %sNe povas konservi modif-tempon en la sekurkopia dosiero %sNe povas konservi modif-tempon en la eligdosiero %sNe povas uzi 'stat' sur enigdosiero %sNe povas skribi al sekurkopia dosiero %sDosierfino (EOF) en komentoEraroEraro dum legado de %sDosiero %s estas tro granda por legadoLa dosiero nomita de la ĉirkaÅ­aĵa variablo %s ne ekzistas aÅ­ ne legeblasGNU indent %s Interna eraro ĉe bufradoLinio rompitaLinio rompita 2ParseStack [%d]: Profilo enhavas nefinitan komentonProfilo enhavas malagrablajn signojnLegi profilon %s Eraro en ingado de ordonoj.Sistemproblemo ĉe legado de %sEstis %d nemalplenaj eliglinioj kaj %d komentoj Neatendita fino de dosieroNekonata kodo por analiziloSenpara 'else'Nefinita signo-konstantoNefinita ĉen-konstantoAvertokomand-linioindent: Stranga valoro por versi-administrado indent: Uzas 'numbered-existing' indent: %s:%d: %s:indent: Ne povas fari sekurkopian dosiernomon de %s indent: Grava Eraro: indent: Sistem-Eraro: indent: Virtuala memoro elĉerpiÄis. indent: ne povas krei %s indent: dosiernomoj ne eblas, kiam la normala enigo estas specifita indent: nur unu enigdosiero, kiam eligdosiero estas specifita indent: nur unu enigdosiero, kiam la normala eligo estas uzata indent: nur unu eligdosiero (dua estis %s) malnovstila plursenceco de atribuado en "=%c". Supozas "= %c" opcio: %s set_option: interna eraro: p_type %d uzado: indent dosiero [-o eligdosiero ] [ opcioj ] indent dosiero1 dosiero2 ... dosieroN [ opcioj ] indent-2.2.11/po/POTFILES.in0000644000177400010010000000022410775646104012175 00000000000000src/args.c src/backup.c src/globs.c src/globs.h src/indent.c src/indent.h src/code_io.c src/lexi.c src/output.c src/parse.c src/sys.h src/wildexp.c indent-2.2.11/po/pl.gmo0000644000177400010010000001220511331327563011533 00000000000000Þ•5ÄGlˆ+‰%µ/Û /$Tj…Ÿ2¸2ë7Upv’G­õ  )7(I'rš«¿5Þ+BSs ˜'¥!Íï) , B "Y | <• :Ò 0 *> :i ¤ &° ]× a5 *— $ 3ç  '4 \ &y +  'Ì =ô 92-l*š!Åç)ì/IFŸ»ËÝ'ï!9N*m5˜Îé8X ^2lDŸä:÷2K%dŠC©=íH+3tC¨ ì'÷e 5" 21,/)$ 3'#& -4!(%.* 0+ stack[%d] => stack: %d ind_level: %d %s: missing argument to parameter %s %s: option ``%s'' requires a numeric parameter %s: unknown option "%s" (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readFile named by environment variable %s does not exist or is not readableGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningcommand lineindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s set_option: internal error: p_type %d usage: indent file [-o outfile ] [ options ] indent file1 file2 ... fileN [ options ] Project-Id-Version: indent 2.2.10 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2008-05-18 23:00+0200 Last-Translator: Jakub Bogusz Language-Team: Polish MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8-bit stack[%d] => stos: %d ind_level: %d %s: brak argumentu dla parametru %s %s: opcja ``%s'' wymaga podania warto¶ci liczbowej %s: nieznana opcja "%s" (Linii komentarza)/(Linii kodu): %6.3f NIE MO¯NA ZNALE¬Æ PLIKU '@'!Nie mo¿na zamkn±æ pliku wyj¶ciowego %sNie mo¿na otworzyæ pliku kopii zapasowej %sNie mo¿na otworzyæ pliku wej¶ciowego %sNie mo¿na zachowaæ czasu modyfikacji pliku kopii zapasowej %sNie mo¿na zachowaæ czasu modyfikacji pliku wyj¶ciowego %sNie mo¿na wykonaæ stat na pliku wej¶ciowym %sNie mo¿na zapisaæ pliku kopii zapasowej %sNapotkano EOF wewn±trz komentarzaB³±dB³±d podczas odczytu pliku wej¶ciowego %sPlik %s jest zbyt du¿y, ¿eby móg³ byæ odczytanyPlik okre¶lony zmienn± ¶rodowiskow± %s nie istnieje lub nie jest czytelnyGNU indent %s Wewnêtrzny b³±d buforowaniaPrzerwana liniaPrzerwana linia 2ParseStack [%d]: Profil zawiera nie zakoñczony komentarzProfil zawiera nieprzyjemne znakiCzytanie profilu %s B³±d zagnie¿d¿enia instrukcji.Problem systemowy podczas odczytu pliku %sBy³o %d niepustych linii wyj¶ciowych i %d komentarzy Nieoczekiwany koniec plikuKod nieznany dla analizatoraNiedopasowane 'else'Nie zakoñczona sta³a znakowaNie zakoñczona sta³a ³añcuchowaUwagalinia poleceñindent: Dziwna warto¶æ znacznika kontroli wersji indent: U¿ycie trybu numbered-existing (numerowane je¶li istniej±) indent: %s:%d: %s:indent: Nie mo¿na utworzyæ nazwy kopii zapasowej pliku %s indent: B³±d krytyczny: indent: B³±d systemowy: indent: Zabrak³o pamiêci wirtualnej. indent: nie mo¿na utworzyæ %s indent: nie mo¿na podaæ nazw plików gdy podano standardowe wej¶cie indent: tylko jeden plik wej¶ciowy gdy podano plik wyj¶ciowy indent: tylko jeden plik wej¶ciowy gdy u¿ywane jest standardowe wyj¶cie indent: tylko jeden plik wyj¶ciowy (drugim by³ %s) Niejasno¶æ przy starym stylu przypisania w "=%c". Za³o¿ono "= %c" opcja: %s set_option: wewnêtrzny b³±d: p_type %d sk³adnia: indent plik [-o plik_wyj¶ciowy] [ opcje ] indent plik1 plik2 ... plikN [ opcje ] indent-2.2.11/po/da.gmo0000644000177400010010000001156611331327562011514 00000000000000Þ•5ÄGlˆ+‰%µ/Û /$Tj…Ÿ2¸2ë7Upv’G­õ  )7(I'rš«¿5Þ+BSs ˜'¥!Íï) , B "Y | <• :Ò 0 *> :i ¤ &° ]× B5 +x '¤ 1Ì þ & > V r “ :° 3ë &%Fl|"&¤HË$ 6 AN+`"Œ¯Ã$Þ59Ts†ž¸ Á'Ï1÷).<k€$•º6Õ; :H.ƒ<² ï#üU  5" 21,/)$ 3'#& -4!(%.* 0+ stack[%d] => stack: %d ind_level: %d %s: missing argument to parameter %s %s: option ``%s'' requires a numeric parameter %s: unknown option "%s" (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readFile named by environment variable %s does not exist or is not readableGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningcommand lineindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s set_option: internal error: p_type %d usage: indent file [-o outfile ] [ options ] indent file1 file2 ... fileN [ options ] Project-Id-Version: indent-2.2.10 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2009-04-29 00:00+0000 Last-Translator: Keld Simonsen Language-Team: Danish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stak[%d] => stak: %d indry_kning: %d %s: argument mangler til parametren %s %s: tilvalg ``%s'' kræver en numerisk parameter %s: ukendt tilvalg "%s" (Kommentarlinjer)/(Kodelinjer): %6.3f KAN IKKE FINDE '@' FIL!Kan ikke lukke uddatafil %sKan ikke Ã¥bne sikkerhedskopi %sKan ikke Ã¥bne inddatafil %sKan ikke bevare ændringstidsstempel pÃ¥ sikkerhedskopi %sKan ikke bevare ændringstidspunkt pÃ¥ uddatafil %sKan ikke give status pÃ¥ inddatafil %sKan ikke skrive til sikkerhedskopi %sEOF i kommentarFejlFejl ved læsning af inddatafil %sFil %s er for stor til at kunne læsesFil navngivet af miljøvariabel %s eksisterer ikke eller kan ikke læsesGNU indent: %s Intern bufferfejlLinje deltLinje delt 2ParseStack [%d]: Profil indeholder en uafsluttet bemærkningProfil indeholder uacceptable tegnLæste profilen %s Fejl i lagdelt erklæring.Systemproblem ved læsning af fil %sDer var %d ikke-tomme uddatalinjer og %d kommentarer Uventet afslutning pÃ¥ filParser fandt en uventet værdiUbalanceret 'else'Uafsluttet tegnkonstantUafsluttet strengkonstantAdvarselkommandolinjeindent: Ukendt versionskontrol-værdi indent: Anvender nummereret sikkerhedskopiering indent: %s:%d: %s:indent: Kan ikke fortage sikkerhedskopi af %s indent: Fatal fejl: indent: Systemfejl: indent: Virtuel hukommelse opbrugt. indent: kan ikke danne %s indent: ingen filnavne, nÃ¥r standard inddata angives indent: Netop én inddatafil, nÃ¥r en uddatafil er angivet indent: netop én inddatafil, nÃ¥r standarduddata angives indent: Netop én uddatafil (nummer 2 var %s) tildeling i gammel stil er flertydig: "=%c". Antager "= %c" tilvalg: %s set_option: intern fejl: p_type %d brug: indent fil [-o udfil ] [ tilvalg ] indent fil1 fil2 ... filN [ tilvalg ] indent-2.2.11/po/pt_BR.gmo0000644000177400010010000001054511331327563012133 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H pT +Å 4ñ #& 'J %r (˜ EÁ D 5L )‚ ¬ É "Î &ñ  ' @ N ^ +p 'œ Ä "Ó &ö ;Y%u›$­"Òõ.û%*P1c•ª"ÄçONT:£6ÞD Z  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.8 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2002-10-28 23:00-0300 Last-Translator: Alexandre Folle de Menezes Language-Team: Brazilian Portuguese MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8-bit stack[%d] => stack: %d ind_level: %d (Linhas com comentários)/(Linhas com código): %6.3f IMPOSSÍVEL ENCONTRAR O ARQUIVO '@'!Impossível fechar o arquivo de saída %sImpossível abrir arquivo de backup %sImpossível abrir o arquivo de entrada %sImpossível preservar o horário de modificação do arquivo de backup %sImpossível conservar o horário de modificação do arquivo de saída %sImpossível obter informações do arquivo de entrada %sImpossível gravar no arquivo de backup %sEOF encontrado em comentárioErroErro lendo o arquivo de entrada %sO arquivo %s é grande de mais para lerGNU indent %s Erro interno nos buffersLinha cortadaLinha cortada 2ParseStack [%d]: O Perfil contém um comentário não terminadoO Perfil contém caracteres inaceitáveisLer perfil %s Erro de aninhamento de instruções.Problema de sistema lendo o arquivo %sEncontradas %d linhas de saída não-vazias e %d comentários Final de arquivo inesperadoCódigo desconhecido para o analisador'else' sem o 'if'Constante de caracter sem terminadorConstante de string sem terminadorAvisoindent: Valor estranho do controle de versão indent: Usando existentes-numeradas indent: %s:%d: %s:indent: Impossível criar um nome de backup de %s indent: Erro Fatal: indent: Erro do Sistema: indent: Memória virtual esgotada. indent: impossível criar %s indent: não se pode ter nomes de arquivo quando se especifica a entrada padrão indent: apenas um arquivo de entrada quando se especifica um arquivo de saída indent: apenas um arquivo de entrada quando se usa stdout indent: apenas um arquivo de saída (o segundo era %s) ambigüidade na designação estilo antigo em "=%c". Assumindo "= %c" opção: %s indent-2.2.11/po/sv.po0000644000177400010010000001727611331327562011420 00000000000000# Swedish messages for indent. # Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. # Christian Rose , 1999, 2000, 2001. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2002-10-25 19:20+0200\n" "Last-Translator: Christian Rose \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent fil1 fil2 ... filN [ flaggor ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: parametern %s saknar argument\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: okänd flagga \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "flagga: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: flaggan \"%s\" kräver en numerisk parameter\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: internt fel: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profilen innehåller en oavslutad kommentar" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profilen innehåller osmakliga tecken" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Konstigt versionskontrollvärde\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Använder \"numbered-existing\"\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Kan inte skapa filnamn för säkerhetskopia av %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Kan inte öppna säkerhetskopian %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Kan inte skriva till säkerhetskopian %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Kan inte bevara modifieringstiden på säkerhetskopian %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Virtuellt minne förbrukat.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Ödesdigert fel: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Systemfel: " #: src/globs.h:27 msgid "Warning" msgstr "Varning" #: src/globs.h:31 msgid "Error" msgstr "Fel" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Filslut påträffades i kommentar" #: src/indent.c:345 msgid "Line broken" msgstr "Rad bruten" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Oväntat slut på filen" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Det fanns %d icke-tomma utdatarader och %d kommentarer\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Rader med kommentarer)/(Rader med kod): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Rad bruten 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: endast en utdatafil tillåten (andra var %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: endast en indatafil när utdatafil är angiven\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: filnamn är inte tillåtna när standard in används\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: endast en indatafil när standard ut används\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Läste profilen %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Internt buffringsfel" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Kan inte öppna indatafilen %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Kan inte ta status på indatafilen %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Varning: Filen %s är tom" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Filen %s är för stor för att läsas" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Systemproblem vid läsning av filen %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Fel vid läsning av indatafilen %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Fel vid stängning av indatafilen %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Varning: Filen %s innehåller NULL-tecken\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Oavslutad teckenkonstant" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Oavslutad strängkonstant" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "tvetydighet i tilldelningen \"=%c\" (gammal form). Antar \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: kan inte skapa %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Kan inte stänga utdatafilen %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Kan inte bevara modifieringstiden på utdatafilen %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Omaka \"else\"" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Fel i kapsling av uttryck." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Kod okänd för tolken" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "Tolkningsstack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "KAN INTE HITTA \"@\"-FIL!" #~ msgid "Ran out of memory" #~ msgstr "Slut på minne" #~ msgid "Extra %c" #~ msgstr "Överflödigt %c" #~ msgid "Unmatched #else" #~ msgstr "Omaka #else" #~ msgid "Unmatched #elif" #~ msgstr "Omaka #elif" #~ msgid "Unmatched #endif" #~ msgstr "Omaka #endif" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "användning: indent fil [-o utfil ] [ flaggor ]\n" #~ msgid "Stuff missing from end of file." #~ msgstr "Saker saknas i slutet av filen." #~ msgid "Unbalanced parens" #~ msgstr "Obalanserade parenteser" #~ msgid "%s: can't have filenames when specifying standard input\n" #~ msgstr "%s: filnamn är inte tillåtna när standard in används\n" #~ msgid "Standard input" #~ msgstr "Standard in" #~ msgid "indent: bad font specification: %s\n" #~ msgstr "indent: felaktig fontspecifikation: %s\n" #~ msgid "" #~ "\n" #~ "*** Debug output marker line ***\n" #~ msgstr "" #~ "\n" #~ "*** Markör för felsökningsinformation ***\n" #~ msgid "Parse: Unknown code: %d for %s\n" #~ msgstr "Parse: Okänd kod: %d för %s\n" indent-2.2.11/po/pl.po0000644000177400010010000001667011331327562011400 00000000000000# Polish translation for indent. # Copyright (C) 1996, 1997, 2007, 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the indent package. # # Wojciech Marek Ga³±zka , 1997. # Jakub Bogusz , 2002-2008. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2008-05-18 23:00+0200\n" "Last-Translator: Jakub Bogusz \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-2\n" "Content-Transfer-Encoding: 8-bit\n" #: src/args.c:611 msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr "" "sk³adnia: indent plik [-o plik_wyj¶ciowy] [ opcje ]\n" " indent plik1 plik2 ... plikN [ opcje ]\n" #: src/args.c:677 #, c-format msgid "%s: missing argument to parameter %s\n" msgstr "%s: brak argumentu dla parametru %s\n" #: src/args.c:802 #, c-format msgid "%s: unknown option \"%s\"\n" msgstr "%s: nieznana opcja \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "opcja: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "%s: opcja ``%s'' wymaga podania warto¶ci liczbowej\n" #: src/args.c:921 #, c-format msgid "set_option: internal error: p_type %d\n" msgstr "set_option: wewnêtrzny b³±d: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profil zawiera nie zakoñczony komentarz" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profil zawiera nieprzyjemne znaki" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" "Plik okre¶lony zmienn± ¶rodowiskow± %s nie istnieje lub nie jest czytelny" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Dziwna warto¶æ znacznika kontroli wersji\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: U¿ycie trybu numbered-existing (numerowane je¶li istniej±)\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Nie mo¿na utworzyæ nazwy kopii zapasowej pliku %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Nie mo¿na otworzyæ pliku kopii zapasowej %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Nie mo¿na zapisaæ pliku kopii zapasowej %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Nie mo¿na zachowaæ czasu modyfikacji pliku kopii zapasowej %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Zabrak³o pamiêci wirtualnej.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: B³±d krytyczny: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: B³±d systemowy: " #: src/globs.h:27 msgid "Warning" msgstr "Uwaga" #: src/globs.h:31 msgid "Error" msgstr "B³±d" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Napotkano EOF wewn±trz komentarza" #: src/indent.c:345 msgid "Line broken" msgstr "Przerwana linia" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Nieoczekiwany koniec pliku" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "By³o %d niepustych linii wyj¶ciowych i %d komentarzy\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Linii komentarza)/(Linii kodu): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Przerwana linia 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: tylko jeden plik wyj¶ciowy (drugim by³ %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: tylko jeden plik wej¶ciowy gdy podano plik wyj¶ciowy\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: nie mo¿na podaæ nazw plików gdy podano standardowe wej¶cie\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "" "indent: tylko jeden plik wej¶ciowy gdy u¿ywane jest standardowe wyj¶cie\n" #: src/indent.c:857 msgid "command line" msgstr "linia poleceñ" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Czytanie profilu %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Wewnêtrzny b³±d buforowania" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Nie mo¿na otworzyæ pliku wej¶ciowego %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Nie mo¿na wykonaæ stat na pliku wej¶ciowym %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Uwaga: Plik o zerowej d³ugo¶ci: %s" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Plik %s jest zbyt du¿y, ¿eby móg³ byæ odczytany" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Problem systemowy podczas odczytu pliku %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "B³±d podczas odczytu pliku wej¶ciowego %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "B³±d podczas zamykania pliku wej¶ciowego %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Uwaga: Plik %s zawiera znaki NULL\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Nie zakoñczona sta³a znakowa" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Nie zakoñczona sta³a ³añcuchowa" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "Niejasno¶æ przy starym stylu przypisania w \"=%c\". Za³o¿ono \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: nie mo¿na utworzyæ %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Nie mo¿na zamkn±æ pliku wyj¶ciowego %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Nie mo¿na zachowaæ czasu modyfikacji pliku wyj¶ciowego %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Niedopasowane 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "B³±d zagnie¿d¿enia instrukcji." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Kod nieznany dla analizatora" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stos: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "NIE MO¯NA ZNALE¬Æ PLIKU '@'!" #~ msgid "Ran out of memory" #~ msgstr "Pamiêæ siê skoñczy³a" #~ msgid "Extra %c" #~ msgstr "Nadmiarowe %c" #~ msgid "Unmatched #else" #~ msgstr "Nadmiarowe #else" #~ msgid "Unmatched #elif" #~ msgstr "Niedopasowane #elif" #~ msgid "Unmatched #endif" #~ msgstr "Niedopasowane #endif" indent-2.2.11/po/zh_TW.Big5.gmo0000644000177400010010000000644011331327563012744 00000000000000Þ•&L5|P/Q—²Ì2å2Kd‚¹Ô í'ù!2F5e›²ÉÚú'!?)a‹¡"¸Û<ô:10l*:È = M n ‚ ” ¦ "¸ Û ü  ' < U l  ˜ ¯ ¾ Ï !ê   , C Z q  © Ç Ú í  - 'J )r 5œ CÒ    ! % $#" &(Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentError reading input file %sFile %s is too big to readInternal buffering errorLine brokenProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantindent: Strange version-control value indent: Using numbered-existing indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.7 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2001-09-05 08:38+0800 Last-Translator: Franklin W. Language-Team: zh_TW.Big5 MIME-Version: 1.0 Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: 8bit µù¸Ñ¦æ»Pµ{¦¡½X¦æªº¤ñ¨Ò¬°¡G%6.3f µLªk§ä¨ì '@' ÀɮסCµLªkÃö³¬¿é¥XÀÉ %sµLªk¶}±Ò³Æ¥÷ÀÉ %sµLªk¶}±Ò¿é¤JÀÉ %sµLªk¦b³Æ¥÷ÀÉ %s ¤¤«O¯d³Ì«áÅܧó¤é´ÁµLªk¦b¿é¥XÀÉ %s «O¯d³Ì«áÅܧó¤é´ÁµLªk§ä¨ì¿é¤JÀÉ %s ªº¸ê°TµLªk¼g¤J³Æ¥÷ÀÉ %s¦bµù¸Ñ¤¤¸I¨ìÀÉ®×µ²§ÀŪ¨ú¿é¤JÀÉ %s ®Éµo¥Í¿ù»~ÀÉ®× %s ¤Ó¤j¡AµLªkŪ¨ú¤º³¡¼È¦s¾¹¥X²{¿ù»~¦³¤@¦Ü¼Æ¦æ³Q¤À³Î¡A½Ð½T»{³]©wÀɤ¤§t¦³¿ù»~ªº¦r¤¸Åª¨ú³]©wÀÉ %s ±_ª¬±Ô­z¦³¿ù»~¡CŪ¨úÀÉ®× %s ®Éµo¥Í¨t²Î°ÝÃD¤w½s±Æ %d ­Ó«DªÅ¥Õ¦æ»P %d ­Óµù¸Ñ ÀÉ®×µ²§À¦³°ÝÃDµLªk­åªRªºµ{¦¡½Xelse §ä¤£¨ì¬Û¹ïÀ³ªº if¥i¯à¤Ö±¼¤@­Ó¦r¤¸³æ¤Þ¸¹¥i¯à¤Ö±¼¤@­Ó¦r¦êÂù¤Þ¸¹indent: ª©¥»±±¨î¸ê°T¦³¿ù»~ indent: ±N§ï±Ä²{¦sªºª©¥»¸¹ indent: µLªk²£¥Í %s ªº³Æ¥÷ÀÉ indent: ÄY­«¿ù»~¡Gindent: ¨t²Î¿ù»~¡Gindent: µêÀÀ°O¾ÐÅé¤w¥Î§¹ indent: µLªk²£¥Í %s indent: «ü©w¨Ï¥Î¼Ð·Ç¿é¤J®É¡A¤£¯àªþ±a¿é¤JÀɦW indent: «ü©w¿é¥XÀɮɡA¥u¯à¦³¤@­Ó¿é¤JÀÉ indent: ¨Ï¥Î¼Ð·Ç¿é¥X®É¡A¥u¯à¦³¤@­Ó¿é¤JÀÉ indent: ¥u¯à¦³¤@­Ó¿é¥XÀÉ (±z«ü©w¤F²Ä¤G­Ó¿é¥XÀɬ° %s) ¦³ºÃ¸qªº«ü©w±Ô­z "=%c"¡A¥i¯à¬°Â¦¡ªº¼gªk¡Cindent ±N°²³]¥¦¬° "= %c" ¿ï¶µ¡G%s indent-2.2.11/po/gl.po0000644000177400010010000002027511331327561011362 00000000000000# Galician translation of indent. # Copyright (C) 2000 Free Software Foundation, Inc. # Jacobo Tarrío Barreiro , 2000. # msgid "" msgstr "" "Project-Id-Version: indent 2.2.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2002-01-03 18:05+0100\n" "Last-Translator: Jacobo Tarrío Barreiro \n" "Language-Team: Galician \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent ficheiro1 ficheiro2 ... ficheiroN [ opcións ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: falta un argumento do parámetro %s\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: opción descoñecida \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "opción: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: a opción ``%s'' precisa un parámetro numérico\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: erro interno: p_type %d\n" #: src/args.c:977 #, fuzzy msgid "Profile contains an unterminated comment" msgstr "O perfil contén caracteres inaceptables" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "O perfil contén caracteres inaceptables" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Valor do control de versións estrano\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Usando numeradas-se-existen\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Non se pode compoñe-lo nome da copia de seguridade de %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Non se pode abri-lo ficheiro de copia de seguridade %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Non se pode escribir no ficheiro de copia de seguridade %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "" "Non se pode conserva-lo tempo de modificación no ficheiro de copia de " "seguridade %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Memoria virtual esgotada.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s: " #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Erro Grave: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Erro do Sistema: " #: src/globs.h:27 msgid "Warning" msgstr "Aviso" #: src/globs.h:31 msgid "Error" msgstr "Erro" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Chegouse á fin do ficheiro nun comentario" #: src/indent.c:345 msgid "Line broken" msgstr "Liña cortada" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Fin de ficheiro inesperada" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Houbo %d liñas de saída non baleiras e %d comentarios\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Liñas con comentarios)/(Liñas con código): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Liña cortada 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: só un ficheiro de saída (o segundo era %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "" "indent: só un ficheiro de entrada cando se especifica un ficheiro de saida\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: non se poden ter nomes de ficheiro cando se especifica a entrada " "estándar\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "" "indent: só se debe indicar un ficheiro de entrada cando se usa stdout\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Le-lo perfil %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Erro interno nos buffers" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Non se pode abri-lo ficheiro de entrada %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Non se pode obter información do ficheiro de entrada %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Aviso: Ficheiro de lonxitude cero %s" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "O ficheiro %s é grande de máis para o ler" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Problema no sistema ao le-lo ficheiro %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Erro ao le-lo ficheiro de entrada %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Erro ao pecha-lo ficheiro de entrada %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Aviso: O ficheiro %s contén caracteres nulos\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Constante de carácter sen rematar" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Constante de cadea sen rematar" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "ambigüidade na asignación ao vello estilo en \"=%c\". Supoñendo \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: non podo crear %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Non se puido pecha-lo ficheiro de saída %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Non se pode conserva-lo tempo de modificación no ficheiro de saída %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "'else' sen o seu 'if'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Erro de aniñamento de instruccións." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Código descoñecido para o analizador" #: src/parse.c:525 #, fuzzy, c-format msgid "ParseStack [%d]:\n" msgstr "" "\n" "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "¡NON SE PUIDO ATOPA-LO FICHEIRO '@'!" #~ msgid "Ran out of memory" #~ msgstr "Esgotouse a memoria" #~ msgid "Extra %c" #~ msgstr "%c extra" #~ msgid "Unmatched #else" #~ msgstr "#else sen o seu #if" #~ msgid "Unmatched #elif" #~ msgstr "#elif sen o seu #if" #~ msgid "Unmatched #endif" #~ msgstr "#endif sen o seu #if" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "uso: indent ficheiro [-o ficheiro-saída ] [ opcións ]\n" #~ msgid "Stuff missing from end of file." #~ msgstr "Faltan cousas na fin do ficheiro." #~ msgid "Unbalanced parens" #~ msgstr "Parénteses non balanceadas" #~ msgid "%s: can't have filenames when specifying standard input\n" #~ msgstr "" #~ "%s: non se poden ter nomes de ficheiro cando se especifica a entrada " #~ "estándar\n" #~ msgid "Standard input" #~ msgstr "Entrada estándar" #~ msgid "indent: bad font specification: %s\n" #~ msgstr "indent: especificación de fonte incorrecta: %s\n" #~ msgid "" #~ "\n" #~ "*** Debug output marker line ***\n" #~ msgstr "" #~ "\n" #~ "*** Liña marcadora en saída de depuración ***\n" #~ msgid "Parse: Unknown code: %d for %s\n" #~ msgstr "Análise: Código descoñecido: %d para %s\n" indent-2.2.11/po/ja.gmo0000644000177400010010000001025411331327563011514 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H \T +± +Ý  ) $J o 8Œ 0Å "ö & @ ` g $† « º Ó ä ÷ 0 *: e  2” )Ç ñ '7Rk)p(šÃ3Ö !":]=z=¸4ö/+@[œ  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.9 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2006-03-20 10:36+0900 Last-Translator: GOTO Masanori Language-Team: Japanese MIME-Version: 1.0 Content-Type: text/plain; charset=EUC-JP Content-Transfer-Encoding: 8bit stack[%d] => stack: %d ind_level: %d (¥³¥á¥ó¥ÈÉÕ¤­¤Î¹Ô)/(¥³¡¼¥ÉÉÕ¤­¤Î¹Ô): %6.3f '@' ¥Õ¥¡¥¤¥ë¤ò¸«¤Ä¤±¤é¤ì¤Þ¤»¤ó!½ÐÎÏ¥Õ¥¡¥¤¥ë %s ¤òÊĤ¸¤é¤ì¤Þ¤»¤ó¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë %s ¤¬³«¤±¤Þ¤»¤óÆþÎÏ¥Õ¥¡¥¤¥ë %s ¤¬³«¤±¤Þ¤»¤ó¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë %s ¤ÎÊѹ¹»þ¹ï¤òÊݸ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿½ÐÎÏ¥Õ¥¡¥¤¥ë %s ¤ÎÊѹ¹»þ¹ï¤òÊݸ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿ÆþÎÏ¥Õ¥¡¥¤¥ë %s ¤ò stat ¤Ç¤­¤Þ¤»¤ó¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë %s ¤Ë½ñ¹þ¤á¤Þ¤»¤ó¥³¥á¥ó¥ÈÃæ¤Ç EOF ¤ËÁø¶ø¤·¤Þ¤·¤¿¥¨¥é¡¼ÆþÎÏ¥Õ¥¡¥¤¥ë %s ¤ÎÆÉ¹þ¤ß¥¨¥é¡¼¥Õ¥¡¥¤¥ë %s ¤ÏÆÉ¹þ¤à¤Ë¤ÏÂ礭¤¹¤®¤Þ¤¹GNU indent %s ÆâÉô¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¥¨¥é¡¼¹Ô¤¬²õ¤ì¤Æ¤¤¤Þ¤¹¹Ô¤¬²õ¤ì¤Æ¤¤¤Þ¤¹ 2ParseStack [%d]: ¥×¥í¥Õ¥¡¥¤¥ë¤ÏÊĤ¸¤Æ¤¤¤Ê¤¤¥³¥á¥ó¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¥×¥í¥Õ¥¡¥¤¥ë¤ÏŬÀڤǤʤ¤Ê¸»ú¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¥×¥í¥Õ¥¡¥¤¥ë %s ¤òÆÉ¤ß¤Þ¤¹ stmt ¥Í¥¹¥È¥¨¥é¡¼.¥Õ¥¡¥¤¥ë %s ¤òÆÉ¹þ¤ßÃæ¤Ë¥·¥¹¥Æ¥àÌäÂ꤬ȯÀ¸¤·¤Þ¤·¤¿Èó¶õ¹Ô¤¬ %d ¹Ô¡¢¥³¥á¥ó¥È¤¬ %d ¹Ô¤¢¤ê¤Þ¤¹ ͽ´ü¤·¤Ê¤¤¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤Ç¤¹¥Ñ¡¼¥µ¡¼¤Ø¤ÎÉÔÌÀ¤Ê¥³¡¼¥É'else' ¤¬ÉÔ°ìÃ×ʸ»úÄê¿ô¤¬½ªÎ»¤·¤Æ¤¤¤Þ¤»¤óʸ»úÎ󤬽ªÎ»¤·¤Æ¤¤¤Þ¤»¤ó·Ù¹ðindent: ¤ª¤«¤·¤Ê version-control ÃͤǤ¹ indent: numbered-existing ¤ò»ÈÍѤ·¤Þ¤¹ indent: %s:%d: %s:indent: ¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë̾ %s ¤òºîÀ®¤Ç¤­¤Þ¤»¤ó indent: Ã×̿Ū¥¨¥é¡¼: indent: ¥·¥¹¥Æ¥à¥¨¥é¡¼: indent: ¥á¥â¥ê¤ò»È¤¤²Ì¤¿¤·¤Þ¤·¤¿. indent: %s ¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó indent: ɸ½àÆþÎϤǻØÄꤵ¤ì¤¿»þ¤Ë¥Õ¥¡¥¤¥ë̾¤¬¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿ indent: ½ÐÎÏ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤¿¤È¤­¤ÎÍ£°ì¤ÎÆþÎÏ¥Õ¥¡¥¤¥ë¤Ç¤¹ indent: stdout ¤¬»ÈÍѤµ¤ì¤¿»þÍ£°ì¤ÎÆþÎÏ¥Õ¥¡¥¤¥ë¤Ç¤¹ indent: Í£°ì¤Î½ÐÎÏ¥Õ¥¡¥¤¥ë (2ÈÖÌÜ¤Ï %s ¤Ç¤·¤¿) "=%c" Ãæ¤Ç¸Å¤¤¥¹¥¿¥¤¥ë¤Î³äÅö¤Æ¤ÎÛ£Ëæ¤Êɽ¸½. "= %c" ¤È²¾Äꤷ¤Þ¤¹ ¥ª¥×¥·¥ç¥ó: %s indent-2.2.11/po/et.gmo0000644000177400010010000001013111331327563011524 00000000000000Þ•.Œ=üð+ñ/Mc~˜2±2ä0Nio‹¦µ Î Úè(ú'#K\p5ÅÜó$A'I!q“)¦Ðæ"ý <9:v0±*â: H IT +ž *Ê õ " $+ P 6p 2§ *Ú ( . ? D b ƒ ’ « ¸ Ç 'Ù & ( = !M 3o £ ¶ Ð Þ ù ()Cm0€±ÉáùGJYL¤.ñ.  O  -), *. & "#'(% +!$ stack[%d] => stack: %d ind_level: %d (Lines with comments)/(Lines with code): %6.3f CANNOT FIND '@' FILE!Can't close output file %sCan't open backup file %sCan't open input file %sCan't preserve modification time on backup file %sCan't preserve modification time on output file %sCan't stat input file %sCan't write to backup file %sEOF encountered in commentErrorError reading input file %sFile %s is too big to readGNU indent %s Internal buffering errorLine brokenLine broken 2ParseStack [%d]: Profile contains an unterminated commentProfile contains unpalatable charactersRead profile %s Stmt nesting error.System problem reading file %sThere were %d non-blank output lines and %d comments Unexpected end of fileUnknown code to parserUnmatched 'else'Unterminated character constantUnterminated string constantWarningindent: Strange version-control value indent: Using numbered-existing indent: %s:%d: %s:indent: Can't make backup filename of %s indent: Fatal Error: indent: System Error: indent: Virtual memory exhausted. indent: can't create %s indent: can't have filenames when specifying standard input indent: only one input file when output file is specified indent: only one input file when stdout is used indent: only one output file (2nd was %s) old style assignment ambiguity in "=%c". Assuming "= %c" option: %s Project-Id-Version: indent 2.2.8 Report-Msgid-Bugs-To: POT-Creation-Date: 2010-01-31 17:27+0100 PO-Revision-Date: 2002-10-25 10:14+03:00 Last-Translator: Toomas Soome Language-Team: Estonian MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8-bit stack[%d] => stack: %d ind_level: %d (Kommentaaridega ridu)/(Koodiridu): %6.3f EI LEIA '@' FAILI!Ei õnnestu sulgeda väljundfaili %sEi õnnestu avada varukoopia faili %sEi õnnestu avada sisendfaili %sEi õnnestu säilitada varukoopia faili %s muutmise aegaEi õnnestu säilitada väljundfaili %s muutmise aegaEi õnnestu lugeda sisendfaili %s atribuuteEi õnnestu kirjutada varukoopia faili %sEOF kommentaarisVigaViga sisendfaili %s lugemiselFail %s on lugemiseks liiga suurGNU indent %s Sisemine puhverduse vigaKatkine ridaKatkine rida 2ParseStack [%d]: Profiil sisaldab lõpetamata kommentaariProfiil sisaldab ebasobivaid sümboleidLugesin profiili %s Viga avaldises.Süsteemi tõrge faili %s lugemiselSaime %d mitte-tühja väljundrida ja %d kommentaari Ootamatu faililõppParser sai tundmatu koodiPuudub 'else'Lõpetamata sümbol konstantLõpetamata sõne konstantHoiatusindent: Veider versioonihalduse väärtus indent: Kasutan nummerdatud olemasolevat indent: %s:%d: %s:indent: Ei õnnestu luua %s varukoopia failinime indent: Fataalne viga: indent: Süsteemi viga: indent: Mälu on otsas. indent: %s ei saa luua indent: failinimesid ei saa kasutada, kui kasutatakse standardsisendit indent: kui väljundfail on määratud, saab kasutada ainult üht sisendfaili indent: kui kasutame standardväljundit, saab kasutada ainult üht failinimie indent: ainult üks väljundfail (teine oli %s) vanas stiilis omistamine "=%c". Eeldan "= %c" võti: %s indent-2.2.11/po/it.po0000644000177400010010000001652311331327561011375 00000000000000# Italian localization for indent. # Copyright (C) 2002 Free Software Foundation, Inc. # Marco Parrone , 2002. # msgid "" msgstr "" "Project-Id-Version: GNU indent 2.2.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2002-10-23 22:17+0200\n" "Last-Translator: Marco Parrone \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 #, fuzzy msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr " indent file1 file2 ... fileN [ opzioni ]\n" #: src/args.c:677 #, fuzzy, c-format msgid "%s: missing argument to parameter %s\n" msgstr "indent: argomento mancante al parametro %s\n" #: src/args.c:802 #, fuzzy, c-format msgid "%s: unknown option \"%s\"\n" msgstr "indent: opzione «%s» sconosciuta\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "opzione: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent %s\n" #: src/args.c:913 #, fuzzy, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "indent: l'opzione «%s» richiede un parametro numerico\n" #: src/args.c:921 #, fuzzy, c-format msgid "set_option: internal error: p_type %d\n" msgstr "indent: set_option: errore interno: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Il profilo contiene un commento non terminato" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Il profilo contiene caratteri non graditi" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Strano valore di version-control\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: numbered-existing in uso\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Impossibile creare il nome del file di backup per %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Impossibile aprire il file di backup %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Impossibile scrivere al file di backup %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Impossibile preservare il modification time sui file di backup %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Memoria virtuale esaurita.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Errore fatale: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Errore di sistema: " #: src/globs.h:27 msgid "Warning" msgstr "Attenzione" #: src/globs.h:31 msgid "Error" msgstr "Errore" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Incontrato EOF in un commento" #: src/indent.c:345 msgid "Line broken" msgstr "Linea spezzata" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Fine del file inaspettata" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "C'erano %d linee di output non vuote e %d commenti\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Linee con commenti)/(Linee con codice): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Linea spezzata 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: solo un file di output (il secondo era %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: solo un file di input quando è specificato il file di output\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "" "indent: non è possibile avere nomi di file quando si specifica lo standard " "input\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: solo un file di input quando viene usato lo stdout\n" #: src/indent.c:857 msgid "command line" msgstr "" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Letto il profilo %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Errore di buffering interno" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Impossibile aprire il file di input %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Impossibile esaminare il file di input %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Attenzione: il file %s ha una lunghezza uguale a zero" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Il file %s è troppo grande per essere letto" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Problema di sistema leggendo il file %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Errore nella lettura del file di input %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Errore nella chiusura del file di input %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Attenzione: il file %s contiene caratteri NULL\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Costante di tipo carattere non terminata" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Costante di tipo stringa non terminata" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "ambiguità nell'assegnamento di vecchio stile in «=%c». Assumo «= %c»\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: impossibile creare %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Impossibile chiudere il file di output %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Impossibile preservare il modification time sul file di output %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "«else» non accoppiato" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Errore di annidazione Stmt" #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Codice sconosciuto all'analizzatore" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stack[%d] => stack: %d ind_level: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "IMPOSSIBILE TROVARE FILE «@»!" #~ msgid "Ran out of memory" #~ msgstr "Memoria esaurita" #~ msgid "Extra %c" #~ msgstr "%c superfluo" #~ msgid "Unmatched #else" #~ msgstr "#else non accoppiato" #~ msgid "Unmatched #elif" #~ msgstr "#elif non accoppiato" #~ msgid "Unmatched #endif" #~ msgstr "#endif non accoppiato" #~ msgid "usage: indent file [-o outfile ] [ options ]\n" #~ msgstr "uso: indent file [-o outfile ] [ opzioni ]\n" indent-2.2.11/po/da.po0000644000177400010010000002043111331327561011336 00000000000000# Danske tekststrenge til GNU indent # Copyright (C) 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the indent package. # Anders Wegge Jakobsen , 1997. # Joe Hansen , 2008, 2009. # Keld Simonsen , 2008, 2009. # # Konventioner # options -> tilvalg (har bibeholdt denne da den var der da jeg ajourførte joe 12.09.08) # NB der er konsekvent brugt lille bogstav efter kolon pÃ¥ dansk nÃ¥r det er tilfældet pÃ¥ engelsk # (det kan være i orden, men det sikreste er vel at bruge stort bogstav pÃ¥ dansk i alle tilfælde). # character -> tegn (alternativ var karakter der er fravalgt) msgid "" msgstr "" "Project-Id-Version: indent-2.2.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2009-04-29 00:00+0000\n" "Last-Translator: Keld Simonsen \n" "Language-Team: Danish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/args.c:611 msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr "" "brug: indent fil [-o udfil ] [ tilvalg ]\n" " indent fil1 fil2 ... filN [ tilvalg ]\n" #: src/args.c:677 #, c-format msgid "%s: missing argument to parameter %s\n" msgstr "%s: argument mangler til parametren %s\n" #: src/args.c:802 #, c-format msgid "%s: unknown option \"%s\"\n" msgstr "%s: ukendt tilvalg \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "tilvalg: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent: %s\n" #: src/args.c:913 #, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "%s: tilvalg ``%s'' kræver en numerisk parameter\n" #: src/args.c:921 #, c-format msgid "set_option: internal error: p_type %d\n" msgstr "set_option: intern fejl: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Profil indeholder en uafsluttet bemærkning" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Profil indeholder uacceptable tegn" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "Fil navngivet af miljøvariabel %s eksisterer ikke eller kan ikke læses" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Ukendt versionskontrol-værdi\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: Anvender nummereret sikkerhedskopiering\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Kan ikke fortage sikkerhedskopi af %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Kan ikke Ã¥bne sikkerhedskopi %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Kan ikke skrive til sikkerhedskopi %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Kan ikke bevare ændringstidsstempel pÃ¥ sikkerhedskopi %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: Virtuel hukommelse opbrugt.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: Fatal fejl: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: Systemfejl: " #: src/globs.h:27 msgid "Warning" msgstr "Advarsel" #: src/globs.h:31 msgid "Error" msgstr "Fejl" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "EOF i kommentar" #: src/indent.c:345 msgid "Line broken" msgstr "Linje delt" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Uventet afslutning pÃ¥ fil" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Der var %d ikke-tomme uddatalinjer og %d kommentarer\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(Kommentarlinjer)/(Kodelinjer): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Linje delt 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: Netop én uddatafil (nummer 2 var %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: Netop én inddatafil, nÃ¥r en uddatafil er angivet\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: ingen filnavne, nÃ¥r standard inddata angives\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: netop én inddatafil, nÃ¥r standarduddata angives\n" #: src/indent.c:857 msgid "command line" msgstr "kommandolinje" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Læste profilen %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "Intern bufferfejl" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Kan ikke Ã¥bne inddatafil %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Kan ikke give status pÃ¥ inddatafil %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Advarsel: tom fil %s" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Fil %s er for stor til at kunne læses" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "Systemproblem ved læsning af fil %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Fejl ved læsning af inddatafil %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Fejl ved lukning af inddatafil %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Advarsel: Filen %s indeholder NULL-tegn\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "Uafsluttet tegnkonstant" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "Uafsluttet strengkonstant" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "tildeling i gammel stil er flertydig: \"=%c\". Antager \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: kan ikke danne %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Kan ikke lukke uddatafil %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Kan ikke bevare ændringstidspunkt pÃ¥ uddatafil %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "Ubalanceret 'else'" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Fejl i lagdelt erklæring." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "Parser fandt en uventet værdi" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " stak[%d] => stak: %d indry_kning: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "KAN IKKE FINDE '@' FIL!" #~ msgid "Ran out of memory" #~ msgstr "Løb tør for hukommelse" #~ msgid "Extra %c" #~ msgstr "Overskydende %c" #~ msgid "Unmatched #else" #~ msgstr "Ubalanceret #else" #~ msgid "Unmatched #elif" #~ msgstr "Ubalanceret #elif" #~ msgid "Unmatched #endif" #~ msgstr "Ubalanceret #endif" #~ msgid "usage: %s file [-o outfile ] [ options ]\n" #~ msgstr "anvendelse: %s fil [-o outputfil ] [ tilvalg ]\n" #~ msgid "Stuff missing from end of file." #~ msgstr "Uventet filafslutning." #~ msgid "Unbalanced parens" #~ msgstr "Ubalancerede parenteser" #~ msgid "%s: can't have filenames when specifying standard input\n" #~ msgstr "%s: ingen filnavne, nÃ¥r standard input angives\n" #~ msgid "Standard input" #~ msgstr "Standard input" #~ msgid "indent: bad font specification: %s\n" #~ msgstr "indent: fejlagtig angivelse af skriftsnit: %s\n" #~ msgid "" #~ "\n" #~ "*** Debug output marker line ***\n" #~ msgstr "" #~ "\n" #~ "*** Debug output markørlinie ***\n" #~ msgid "Parse: Unknown code: %d for %s\n" #~ msgstr "Parse: Ukendt kode: %d for %s\n" indent-2.2.11/po/en@boldquot.header0000644000177400010010000000247111041664103014036 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # indent-2.2.11/po/en@quot.header0000644000177400010010000000226311041664103013174 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # indent-2.2.11/po/ru.po0000644000177400010010000002206311331327562011404 00000000000000# translation of indent-2.2.10.ru.po to Russian # Ð›Ð¾ÐºÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ indent # This file is distributed under the same license as the indent package. # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc. # # Denis Perchine , 1997, 1998, 1999, 2000, 2001, 2002. # Yuri Kozlov , 2009. msgid "" msgstr "" "Project-Id-Version: indent 2.2.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-31 17:27+0100\n" "PO-Revision-Date: 2009-07-07 21:25+0400\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: src/args.c:611 msgid "" "usage: indent file [-o outfile ] [ options ]\n" " indent file1 file2 ... fileN [ options ]\n" msgstr "" "иÑпользование: indent файл [-o выходной­­_файл ] [ параметры ]\n" " indent файл1 файл2 ... файлN [ параметры ]\n" #: src/args.c:677 #, c-format msgid "%s: missing argument to parameter %s\n" msgstr "%s: отÑутÑтвует аргумент у параметра %s\n" #: src/args.c:802 #, c-format msgid "%s: unknown option \"%s\"\n" msgstr "%s: неизвеÑтный параметр \"%s\"\n" #: src/args.c:812 #, c-format msgid "option: %s\n" msgstr "параметр: %s\n" #: src/args.c:828 #, c-format msgid "GNU indent %s\n" msgstr "GNU indent: %s\n" #: src/args.c:913 #, c-format msgid "%s: option ``%s'' requires a numeric parameter\n" msgstr "%s: параметру «%s» необходим чиÑловой аргумент\n" #: src/args.c:921 #, c-format msgid "set_option: internal error: p_type %d\n" msgstr "set_option: внутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°: p_type %d\n" #: src/args.c:977 msgid "Profile contains an unterminated comment" msgstr "Профиль Ñодержит незавершённый комментарий" #: src/args.c:1015 msgid "Profile contains unpalatable characters" msgstr "Профиль Ñодержит недопуÑтимые Ñимволы" #: src/args.c:1183 #, c-format msgid "File named by environment variable %s does not exist or is not readable" msgstr "" "Файл, указанный в переменной Ð¾ÐºÑ€ÑƒÐ¶ÐµÐ½Ð¸Ñ %s, не ÑущеÑтвует или недоÑтупен Ð´Ð»Ñ " "чтениÑ" #: src/backup.c:466 #, c-format msgid "indent: Strange version-control value\n" msgstr "indent: Странное значение верÑии\n" #: src/backup.c:467 #, c-format msgid "indent: Using numbered-existing\n" msgstr "indent: ИÑпользуютÑÑ ÑущеÑтвующие чиÑла\n" #: src/backup.c:498 #, c-format msgid "indent: Can't make backup filename of %s\n" msgstr "indent: Ðе удалоÑÑŒ Ñоздать резервную копию файла %s\n" #: src/backup.c:506 #, c-format msgid "Can't open backup file %s" msgstr "Ðе удалоÑÑŒ открыть резервную копию файла %s" #: src/backup.c:513 #, c-format msgid "Can't write to backup file %s" msgstr "Ðе удалоÑÑŒ запиÑать резервную копию файла %s" #: src/backup.c:526 #, c-format msgid "Can't preserve modification time on backup file %s" msgstr "Ðе удалоÑÑŒ Ñохранить дату Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð½Ð° файле резервной копии %s" #: src/globs.c:49 src/globs.c:74 #, c-format msgid "indent: Virtual memory exhausted.\n" msgstr "indent: ЗакончилаÑÑŒ Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ð°Ñ Ð¿Ð°Ð¼Ñть.\n" #: src/globs.c:93 #, c-format msgid "indent: %s:%d: %s:" msgstr "indent: %s:%d: %s:" #: src/globs.c:109 #, c-format msgid "indent: Fatal Error: " msgstr "indent: ÐеиÑÐ¿Ñ€Ð°Ð²Ð¸Ð¼Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°: " #: src/globs.c:119 #, c-format msgid "indent: System Error: " msgstr "indent: СиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°: " #: src/globs.h:27 msgid "Warning" msgstr "Предупреждение" #: src/globs.h:31 msgid "Error" msgstr "Ошибка" #: src/indent.c:284 msgid "EOF encountered in comment" msgstr "Конец файла внутри комментариÑ" #: src/indent.c:345 msgid "Line broken" msgstr "Строка повреждена" #: src/indent.c:522 msgid "Unexpected end of file" msgstr "Ðеожиданный конец файла" #: src/indent.c:528 #, c-format msgid "There were %d non-blank output lines and %d comments\n" msgstr "Было %d непуÑтых выходных Ñтрок и %d комментариев\n" #: src/indent.c:532 #, c-format msgid "(Lines with comments)/(Lines with code): %6.3f\n" msgstr "(комментарии)/(код): %6.3f\n" #: src/indent.c:556 msgid "Line broken 2" msgstr "Строка повреждена 2" #: src/indent.c:778 #, c-format msgid "indent: only one output file (2nd was %s)\n" msgstr "indent: только один выходной файл (второй был %s)\n" #: src/indent.c:787 src/indent.c:813 #, c-format msgid "indent: only one input file when output file is specified\n" msgstr "indent: только один входной файл, когда указан выходной файл\n" #: src/indent.c:801 src/indent.c:848 #, c-format msgid "indent: can't have filenames when specifying standard input\n" msgstr "indent: Ð½ÐµÐ»ÑŒÐ·Ñ ÑƒÐºÐ°Ð·Ñ‹Ð²Ð°Ñ‚ÑŒ имена файлов, когда указан Ñтандартный ввод\n" #: src/indent.c:821 #, c-format msgid "indent: only one input file when stdout is used\n" msgstr "indent: только один входной файл, когда указан Ñтандартный ввод\n" #: src/indent.c:857 msgid "command line" msgstr "ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока" #: src/indent.c:1049 #, c-format msgid "Read profile %s\n" msgstr "Чтение Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ %s\n" #: src/code_io.c:169 msgid "Internal buffering error" msgstr "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ° буферизации" #: src/code_io.c:262 #, c-format msgid "Can't open input file %s" msgstr "Ðе удалоÑÑŒ открыть входной файл %s" #: src/code_io.c:267 #, c-format msgid "Can't stat input file %s" msgstr "Ðе удалоÑÑŒ получить ÑÑ‚Ð°Ñ‚ÑƒÑ Ð²Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %s" #: src/code_io.c:272 #, fuzzy, c-format msgid "Zero-length file %s" msgstr "Предупреждение: Файл %s имеет нулевую длину" #: src/code_io.c:280 #, c-format msgid "File %s is too big to read" msgstr "Файл %s Ñлишком велик Ð´Ð»Ñ Ñ‡Ñ‚ÐµÐ½Ð¸Ñ" #: src/code_io.c:288 #, c-format msgid "System problem reading file %s" msgstr "СиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð° %s" #: src/code_io.c:312 #, c-format msgid "Error reading input file %s" msgstr "Ошибка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð²Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %s" #: src/code_io.c:317 #, fuzzy, c-format msgid "Error closing input file %s" msgstr "Ошибка Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð²Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %s" #: src/code_io.c:507 #, fuzzy, c-format msgid "File %s contains NULL-characters: cannot proceed\n" msgstr "Предупреждение: Файл %s Ñодержит Ñимволы NULL\n" #: src/lexi.c:786 msgid "Unterminated character constant" msgstr "ÐÐµÐ·Ð°Ð²ÐµÑ€ÑˆÑ‘Ð½Ð½Ð°Ñ ÑÐ¸Ð¼Ð²Ð¾Ð»ÑŒÐ½Ð°Ñ ÐºÐ¾Ð½Ñтанта" #: src/lexi.c:787 msgid "Unterminated string constant" msgstr "ÐÐµÐ·Ð°Ð²ÐµÑ€ÑˆÑ‘Ð½Ð½Ð°Ñ ÑÑ‚Ñ€Ð¾ÐºÐ¾Ð²Ð°Ñ ÐºÐ¾Ð½Ñтанта" #: src/lexi.c:1044 #, c-format msgid "old style assignment ambiguity in \"=%c\". Assuming \"= %c\"\n" msgstr "" "двуÑмыÑленное приÑваивание в Ñтаром Ñтиле в \"=%c\". ПринимаетÑÑ \"= %c\"\n" #: src/output.c:1315 #, c-format msgid "indent: can't create %s\n" msgstr "indent: невозможно Ñоздать %s\n" #: src/output.c:1354 #, c-format msgid "Can't close output file %s" msgstr "Ðе удалоÑÑŒ закрыть выходной файл %s" #: src/output.c:1367 #, c-format msgid "Can't preserve modification time on output file %s" msgstr "Ðе удалоÑÑŒ Ñохранить Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð²Ñ‹Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %s" #: src/parse.c:447 msgid "Unmatched 'else'" msgstr "'else' без пары" #: src/parse.c:473 msgid "Stmt nesting error." msgstr "Ошибка вложенноÑти stmt." #: src/parse.c:515 msgid "Unknown code to parser" msgstr "ÐеизвеÑтный Ð´Ð»Ñ Ð°Ð½Ð°Ð»Ð¸Ð·Ð°Ñ‚Ð¾Ñ€Ð° код" #: src/parse.c:525 #, c-format msgid "ParseStack [%d]:\n" msgstr "ParseStack [%d]:\n" #: src/parse.c:529 #, c-format msgid " stack[%d] => stack: %d ind_level: %d\n" msgstr " Ñтек[%d] => Ñтек: %d уровень: %d\n" #: src/wildexp.c:126 msgid "CANNOT FIND '@' FILE!" msgstr "ÐЕ УДÐЛОСЬ ÐÐЙТИ ФÐЙЛ '@'!" #~ msgid "Ran out of memory" #~ msgstr "ЗакончилаÑÑŒ памÑть" #~ msgid "Extra %c" #~ msgstr "Лишний %c" #~ msgid "Unmatched #else" #~ msgstr "#else без пары" #~ msgid "Unmatched #elif" #~ msgstr "#elif без пары" #~ msgid "Unmatched #endif" #~ msgstr "#endif без пары" indent-2.2.11/Makefile.in0000644000177400010010000006443311331327377012060 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @MAINTAINER_MODE_TRUE@am__append_1 = -g -Wall -I. @MAINTAINER_MODE_FALSE@am__append_2 = -I. subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure $(top_srcdir)/intl/Makefile.in \ ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS \ config/config.guess config/config.rpath config/config.sub \ config/depcomp config/install-sh config/mdate-sh \ config/missing config/mkinstalldirs config/texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/aclocal/UTIMBUF.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intdiv0.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = intl/Makefile CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ $(am__append_1) $(am__append_2) CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = no-texinfo.tex SUBDIRS = intl src doc po man BUILT_SOURCES = EXTRA_DIST = README \ config/config.rpath config/mkinstalldirs \ ChangeLog-1990 ChangeLog-1998 ChangeLog-2001 \ miscel/make-decc.com miscel/vaxc-make.com miscel/gnuc-make.com \ aclocal/UTIMBUF.m4 \ miscel/Makefile.mingw32 \ miscel/makefile.watcom \ miscel/README.vc++ \ miscel/README.VMS \ bootstrap \ regression DISTCLEANFILES = config/config.cache config/config.log config.h # --------------- Maintainer's Section MAINTAINERCLEANFILES = intl/* aclocal.m4 Makefile.in \ config.h.in config/* \ po/Makefile.in.in po/Rules-quot po/boldquot.sed po/en@boldquot.header \ po/en@quot.header po/insert-header.sin po/quot.sed po/remove-potcdate.sin \ stamp-h1 stamp-h.in configure \ @PACKAGE@-1.spec \ @PACKAGE@.lsm indent-2.spec .gdbinit \ INSTALL ABOUT-NLS @MAINTAINER_MODE_TRUE@WWWDIR = /home/david/www/@PACKAGE@ @MAINTAINER_MODE_TRUE@REDHAT = $(shell grep '^%_topdir' rpm/macros | cut -d \ -f 2) @MAINTAINER_MODE_TRUE@SPECFILE = @PACKAGE@-${shell echo "@VERSION@" | cut -d. -f1}.spec ACLOCAL_AMFLAGS = -I m4 all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ --with-included-gettext \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf-am: ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am ps: cd doc && $(MAKE) @PACKAGE@.ps pdf: cd doc && $(MAKE) @PACKAGE@.pdf html: cd doc && $(MAKE) html html-split: cd doc && $(MAKE) html-split @MAINTAINER_MODE_TRUE@README: Makefile miscel/README.in configure.ac @MAINTAINER_MODE_TRUE@ sed -e 's%!VERSION!%@VERSION@%g' miscel/$@.in > $@ @MAINTAINER_MODE_TRUE@miscel/Makefile.mingw32 miscel/makefile.watcom :%: %.in @MAINTAINER_MODE_TRUE@ cat $@.in | perl -e 'while (<>) {chomp; print "$$_\015\012"; }' > $@ @MAINTAINER_MODE_TRUE@miscel/README.vc++ miscel/README.VMS @PACKAGE@.lsm :%: Makefile %.in @MAINTAINER_MODE_TRUE@ sed -e 's%!VERSION!%@VERSION@%g' $@.in > $@ @MAINTAINER_MODE_TRUE@tar: @MAINTAINER_MODE_TRUE@ $(MAKE) dist @MAINTAINER_MODE_TRUE@ install -D @PACKAGE@-@VERSION@.tar.gz $(REDHAT)/SOURCES/@PACKAGE@-@VERSION@.tar.gz @MAINTAINER_MODE_TRUE@rpm: tar $(SPECFILE) @MAINTAINER_MODE_TRUE@ rpm --rcfile=/usr/lib/rpm/rpmrc:rpm/rpmrc --target=$(TARGET) --sign --clean -ba $(SPECFILE) @MAINTAINER_MODE_TRUE@$(SPECFILE): rpm/$(SPECFILE).in configure.ac @MAINTAINER_MODE_TRUE@ cvs commit rpm/$(SPECFILE).in @MAINTAINER_MODE_TRUE@ sed -e 's/!VERSION!/@VERSION@/g' rpm/$(SPECFILE).in | grep -B2000 '!CHANGELOG!' | grep -v '!CHANGELOG!' > $(SPECFILE) @MAINTAINER_MODE_TRUE@ echo -n "%changelog" >> $(SPECFILE) @MAINTAINER_MODE_TRUE@ cvs log rpm/$(SPECFILE).in | \ @MAINTAINER_MODE_TRUE@ grep -A2000 '^-----' | \ @MAINTAINER_MODE_TRUE@ egrep -v '^-----|^=====|^revision' | \ @MAINTAINER_MODE_TRUE@ awk -F'[ ;]' --assign lastdate="" '{ if ($$0~/^date: /) { \ @MAINTAINER_MODE_TRUE@ if (lastdate != $$2) { \ @MAINTAINER_MODE_TRUE@ lastdate=$$2; \ @MAINTAINER_MODE_TRUE@ printf("\n* "); \ @MAINTAINER_MODE_TRUE@ system("echo -n `date --date \""$$2" "$$3"\" \"+%a %b %d %Y\"`"); \ @MAINTAINER_MODE_TRUE@ printf(" $(AUTHOR)\n"); \ @MAINTAINER_MODE_TRUE@ } \ @MAINTAINER_MODE_TRUE@ } else if ($$0~/^[A-Z]/) { printf("- %s\n", $$0); } else if ($$0~/./) { printf(" %s\n", $$0); } else {print} }' >> $(SPECFILE) @MAINTAINER_MODE_TRUE@ grep -A2000 '!CHANGELOG!' rpm/$(SPECFILE).in | grep -v '!CHANGELOG!' >> $(SPECFILE) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: indent-2.2.11/m4/0000777000177400010010000000000011331331065010372 500000000000000indent-2.2.11/m4/inttypes.m40000644000177400010010000000171710775646224012456 00000000000000# inttypes.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. # Define HAVE_INTTYPES_H if exists and doesn't clash with # . AC_DEFUN([gt_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, [ AC_TRY_COMPILE( [#include #include ], [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) ]) if test $gt_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, [Define if exists and doesn't clash with .]) fi ]) indent-2.2.11/m4/lib-ld.m40000644000177400010010000000626010775646224011740 00000000000000# lib-ld.m4 serial 1 (gettext-0.11) dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no fi]) with_gnu_ld=$acl_cv_prog_gnu_ld ]) dnl From libtool-1.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) indent-2.2.11/m4/progtest.m40000644000177400010010000000407410775646224012445 00000000000000# progtest.m4 serial 2 (gettext-0.10.40) dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) indent-2.2.11/m4/codeset.m40000644000177400010010000000157610775646223012227 00000000000000# codeset.m4 serial AM1 (gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) indent-2.2.11/m4/lib-link.m40000644000177400010010000005563310775646224012306 00000000000000# lib-link.m4 serial 3 (gettext-0.11.3) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L, dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. AC_DEFUN([AC_LIB_RPATH], [ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) indent-2.2.11/m4/ulonglong.m40000644000177400010010000000200010775646224012565 00000000000000# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40) dnl Copyright (C) 1999-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], [unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull;], ac_cv_type_unsigned_long_long=yes, ac_cv_type_unsigned_long_long=no)]) if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the unsigned long long type.]) fi ]) indent-2.2.11/m4/lib-prefix.m40000644000177400010010000001175510775646224012643 00000000000000# lib-prefix.m4 serial 1 (gettext-0.11) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) indent-2.2.11/m4/stdint_h.m40000644000177400010010000000204310775646224012404 00000000000000# stdint_h.m4 serial 2 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([jm_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], jm_ac_cv_header_stdint_h=yes, jm_ac_cv_header_stdint_h=no)]) if test $jm_ac_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) indent-2.2.11/m4/uintmax_t.m40000644000177400010010000000211410775646224012577 00000000000000# uintmax_t.m4 serial 6 (gettext-0.11) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to `unsigned long' or `unsigned long long' # if does not exist. AC_DEFUN([jm_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) AC_REQUIRE([jm_AC_HEADER_STDINT_H]) if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) fi ]) indent-2.2.11/m4/glibc21.m40000644000177400010010000000172710775646223012022 00000000000000# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([jm_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) indent-2.2.11/m4/intdiv0.m40000644000177400010010000000356510775646224012157 00000000000000# intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) indent-2.2.11/m4/isc-posix.m40000644000177400010010000000213310775646224012506 00000000000000# isc-posix.m4 serial 2 (gettext-0.11.2) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) indent-2.2.11/m4/gettext.m40000644000177400010010000005730710775646223012270 00000000000000# gettext.m4 serial 17 (gettext-0.11.5) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2002. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define(gt_included_intl, ifelse([$1], [external], [no], [yes])) define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. dnl Add a version number to the cache macros. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return (long) gettext ("")]ifelse([$2], [need-ngettext], [ + (long) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias ();], [bindtextdomain ("", ""); return (long) gettext ("")]ifelse([$2], [need-ngettext], [ + (long) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) dnl Now see whether libintl exists and depends on libiconv. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias ();], [bindtextdomain ("", ""); return (long) gettext ("")]ifelse([$2], [need-ngettext], [ + (long) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext_libintl=yes ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. INTLOBJS="\$(GETTOBJS)" BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) AC_SUBST(INTLOBJS) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for all prerequisites of the po subdirectory, dnl except for USE_NLS. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Search for GNU xgettext 0.11 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then dnl If it is no GNU msgfmt we define it as : so that the dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` AC_MSG_RESULT( [found $GMSGFMT program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po fi AC_OUTPUT_COMMANDS([ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' fi case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= GMOFILES= UPDATEPOFILES= DUMMYPOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it # from automake. eval 'ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([jm_GLIBC21])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) AM_ICONV AM_LANGINFO_CODESET if test $ac_cv_header_locale_h = yes; then AM_LC_MESSAGES fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) AC_DEFUN([AM_MKINSTALLDIRS], [ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) indent-2.2.11/m4/lcmessage.m40000644000177400010010000000261610775646224012541 00000000000000# lcmessage.m4 serial 3 (gettext-0.11.3) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995. # Check whether LC_MESSAGES is available in . AC_DEFUN([AM_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) indent-2.2.11/m4/iconv.m40000644000177400010010000000665310775646224011721 00000000000000# iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) indent-2.2.11/m4/inttypes-pri.m40000644000177400010010000000222710775646224013243 00000000000000# inttypes-pri.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_REQUIRE([gt_HEADER_INTTYPES_H]) if test $gt_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) fi ]) indent-2.2.11/m4/inttypes_h.m40000644000177400010010000000207310775646224012761 00000000000000# inttypes_h.m4 serial 4 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([jm_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], jm_ac_cv_header_inttypes_h=yes, jm_ac_cv_header_inttypes_h=no)]) if test $jm_ac_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) indent-2.2.11/doc/0000777000177400010010000000000011331331066010620 500000000000000indent-2.2.11/doc/indent.texinfo0000644000177400010010000021022111041703633013412 00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename indent.info @settitle @command{indent}: Indent and Format C Program Source @finalout @include version.texi @c %**end of header @c smallbook @c Note: some of the long options are too long for the index in @c smallbook format. This will need some thought. --rjc @dircategory Indent Code Formatter @direntry * Indent: (indent). C code formatter. @end direntry @synindex cp ky @setchapternewpage odd @c !BEGIN INTRO @ifinfo This is Edition @value{EDITION} of @cite{The @command{indent} Manual}, for Indent Version @value{VERSION}, last updated @value{UPDATED}. @c !END INTRO @c @vskip 0pt plus 1filll @c !BEGIN COPYING Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Copyright (C) 1995, 1996 Joseph Arceneaux. Copyright (C) 1999 Carlo Wood. Copyright (C) 2001 David Ingamells. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the section entitled ``GNU General Public License'' is included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that the section entitled ``GNU General Public License'' may be included in a translation approved by the author instead of in the original English. @end ignore @c !END COPYING @end ifinfo @titlepage @title Indent @subtitle Format C Code @sp 1 @subtitle Edition @value{EDITION}, for Indent Version @value{VERSION} @subtitle @value{UPDATED} @c !BEGIN AUTHORS @author Carlo Wood @author Joseph Arceneaux @author Jim Kingdon @author David Ingamells @c !END AUTHORS @page @vskip 0pt plus1filll Copyright @copyright{} 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Copyright @copyright{} 1995, 1996 Joseph Arceneaux. Copyright @copyright{} 1999, Carlo Wood. Copyright @copyright{} 2001, David Ingamells. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation. @end titlepage @page @c put the following line in the file dir in the info directory @c under wherever you have installed emacs (assuming that @c the info file made from this file is in the file "indent") @c * indent:(indent). How to change the appearance of a C program. @ifinfo @node Top, Indent Program, (dir), (dir) @top @command{indent}: Indent and Format C Program Source The @command{indent} program @c !BEGIN NAME changes the appearance of a C program by inserting or deleting whitespace. @c !END NAME This is Edition @value{EDITION}, @value{UPDATED}, of @cite{The @command{indent} Manual}, for Indent Version @value{VERSION}. @menu * Indent Program:: The @command{indent} Program * Option Summary:: Option Summary * Index:: Index @end menu @end ifinfo @node Indent Program, Option Summary, Top, Top @chapter The @command{indent} Program @c !BEGIN DESCRIPTION @iftex The @command{indent} program changes the appearance of a C program by inserting or deleting whitespace. @end iftex @ifinfo The @command{indent} program @end ifinfo @iftex It @end iftex can be used to make code easier to read. It can also convert from one style of writing C to another. @command{indent} understands a substantial amount about the syntax of C, but it also attempts to cope with incomplete and misformed syntax. In version 1.2 and more recent versions, the GNU style of indenting is the default. @c !END DESCRIPTION @menu * Invoking indent:: Invoking @command{indent} * Backup files:: Backup Files * Common styles:: Common styles * Blank lines:: Blank lines * Comments:: Comments * Statements:: Statements * Declarations:: Declarations * Indentation:: Indentation * Breaking long lines:: Breaking long lines * Disabling Formatting:: Disabling Formatting * Miscellaneous options:: Miscellaneous options * Bugs:: Bugs * Copyright:: Copyright @end menu @c !BEGIN THEREST @node Invoking indent, Backup files, , Indent Program @section Invoking @command{indent} @cindex Invoking @command{indent} @cindex Starting @command{indent} @cindex Beginning @command{indent} As of version 1.3, the format of the @command{indent} command is: @example @group indent [@var{options}] [@var{input-files}] indent [@var{options}] [@var{single-input-file}] [-o @var{output-file}] @end group @end example This format is different from earlier versions and other versions of @command{indent}. In the first form, one or more input files are specified. @command{indent} makes a backup copy of each file, and the original file is replaced with its indented version. @xref{Backup files}, for an explanation of how backups are made. @cindex Output File Specification @kindex -o @kindex --output-file In the second form, only one input file is specified. In this case, or when the standard input is used, you may specify an output file after the @option{-o} option. @cindex Standard Output @kindex -st @kindex --standard-output To cause @command{indent} to write to standard output, use the @option{-st} option. This is only allowed when there is only one input file, or when the standard input is used. @cindex Using Standard Input If no input files are named, the standard input is read for input. Also, if a filename named @option{-} is specified, then the standard input is read. As an example, each of the following commands will input the program @file{slithy_toves.c} and write its indented text to @file{slithy_toves.out}: @example @group indent slithy_toves.c -o slithy_toves.out indent -st slithy_toves.c > slithy_toves.out cat slithy_toves.c | indent -o slithy_toves.out @end group @end example @cindex Long options, use of Most other options to @command{indent} control how programs are formatted. As of version 1.2, @command{indent} also recognizes a long name for each option name. Long options are prefixed by either @option{--} or @option{+}. @footnote{ @option{+} is being superseded by @option{--} to maintain consistency with the POSIX standard.} In most of this document, the traditional, short names are used for the sake of brevity. @xref{Option Summary}, for a list of options, including both long and short names. Here is another example: @example indent -br test/metabolism.c -l85 @end example This will indent the program @file{test/metabolism.c} using the @option{-br} and @option{-l85} options, write the output back to @file{test/metabolism.c}, and write the original contents of @file{test/metabolism.c} to a backup file in the directory @file{test}. Equivalent invocations using long option names for this example would be: @example @group indent --braces-on-if-line --line-length185 test/metabolism.c indent +braces-on-if-line +line-length185 test/metabolism.c @end group @end example @cindex @file{.indent.pro} file @cindex Initialization file @kindex -npro @kindex --ignore-profile If you find that you often use @command{indent} with the same options, you may put those options into a file named @file{.indent.pro}. @command{indent} will look for a profile file in three places. First it will check the environment variable @env{INDENT_PROFILE}. If that exists its value is expected to name the file that is to be used. If the environment variable does not exist, indent looks for @file{.indent.pro} in the current directory and use that if found. Finally @command{indent} will search your home directory for @file{.indent.pro} and use that file if it is found. This behaviour is different from that of other versions of @command{indent}, which load both files if they both exist. The format of @file{.indent.pro} is simply a list of options, just as they would appear on the command line, separated by white space (tabs, spaces, and newlines). Options in @file{.indent.pro} may be surrounded by C or C++ comments, in which case they are ignored. Command line switches are handled @emph{after} processing @file{.indent.pro}. Options specified later override arguments specified earlier, with one exception: Explicitly specified options always override background options (@pxref{Common styles}). You can prevent @command{indent} from reading an @file{.indent.pro} file by specifying the @option{-npro} option.@refill @node Backup files, Common styles, Invoking indent, Indent Program @comment node-name, next, previous, up @section Backup Files @cindex backup files As of version 1.3, GNU @command{indent} makes GNU-style backup files, the same way GNU Emacs does. This means that either @dfn{simple} or @dfn{numbered} backup filenames may be made. Simple backup file names are generated by appending a suffix to the original file name. The default for this suffix is the one-character string @file{~} (tilde). Thus, the backup file for @file{python.c} would be @file{python.c~}. Instead of the default, you may specify any string as a suffix by setting the environment variable @env{SIMPLE_BACKUP_SUFFIX} to your preferred suffix. Numbered backup versions of a file @file{momeraths.c} look like @file{momeraths.c.~23~}, where 23 is the version of this particular backup. When making a numbered backup of the file @file{src/momeraths.c}, the backup file will be named @file{src/momeraths.c.~@var{V}~}, where @var{V} is one greater than the highest version currently existing in the directory @file{src}. The environment variable @env{VERSION_WIDTH} controls the number of digits, using left zero padding when necessary. For instance, setting this variable to "2" will lead to the backup file being named @file{momeraths.c.~04~}. The type of backup file made is controlled by the value of the environment variable @env{VERSION_CONTROL}. If it is the string @samp{simple}, then only simple backups will be made. If its value is the string @samp{numbered}, then numbered backups will be made. If its value is @samp{numbered-existing}, then numbered backups will be made if there @emph{already exist} numbered backups for the file being indented; otherwise, a simple backup is made. If @env{VERSION_CONTROL} is not set, then @command{indent} assumes the behaviour of @samp{numbered-existing}. Other versions of @command{indent} use the suffix @file{.BAK} in naming backup files. This behaviour can be emulated by setting @env{SIMPLE_BACKUP_SUFFIX} to @samp{.BAK}. Note also that other versions of @command{indent} make backups in the current directory, rather than in the directory of the source file as GNU @command{indent} now does. @node Common styles, Blank lines, Backup files, Indent Program @comment node-name, next, previous, up @section Common styles There are several common styles of C code, including the GNU style, the Kernighan & Ritchie style, and the original Berkeley style. A style may be selected with a single @dfn{background} option, which specifies a set of values for all other options. However, explicitly specified options always override options implied by a background option. @cindex GNU style @kindex -gnu @kindex --gnu-style As of version 1.2, the default style of GNU @command{indent} is the GNU style. Thus, it is no longer necessary to specify the option @option{-gnu} to obtain this format, although doing so will not cause an error. Option settings which correspond to the GNU style are: @example @group -nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2 -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob @end group @end example The GNU coding style is that preferred by the GNU project. It is the style that the GNU Emacs C mode encourages and which is used in the C portions of GNU Emacs. (People interested in writing programs for Project GNU should get a copy of @cite{The GNU Coding Standards}, which also covers semantic and portability issues such as memory usage, the size of integers, etc.) @cindex Kernighan & Ritchie style @kindex -kr @kindex --k-and-r-style @comment --kernighan-and-ritchie-style works, too, as does @comment --kernighan-and-ritchie. Which is most intuitive? The Kernighan & Ritchie style is used throughout their well-known book @cite{The C Programming Language}. It is enabled with the @option{-kr} option. The Kernighan & Ritchie style corresponds to the following set of options: @example @group -nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf -sai -saw -nsc -nsob -nss @end group @end example @noindent Kernighan & Ritchie style does not put comments to the right of code in the same column at all times (nor does it use only one space to the right of the code), so for this style @command{indent} has arbitrarily chosen column 33. @cindex Berkeley style @cindex Original Berkeley style @kindex -orig @kindex --original The style of the original Berkeley @command{indent} may be obtained by specifying @option{-orig} (or by specifying @option{--original}, using the long option name). This style is equivalent to the following settings: @example @group -nbad -nbap -bbo -bc -br -brs -c33 -cd33 -cdb -ce -ci4 -cli0 -cp33 -di16 -fc1 -fca -hnl -i4 -ip4 -l75 -lp -npcs -nprs -psl -saf -sai -saw -sc -nsob -nss -ts8 @end group @end example @cindex Linux style @kindex -linux @kindex --linux-style The Linux style is used in the linux kernel code and drivers. Code generally has to follow the Linux coding style to be accepted. This style is equivalent to the following settings: @example @group -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1 @end group @end example @node Blank lines, Comments, Common styles, Indent Program @comment node-name, next, previous, up @section Blank lines @cindex Blank lines Various programming styles use blank lines in different places. @command{indent} has a number of options to insert or delete blank lines in specific places. The @option{-bad} option causes @command{indent} to force a blank line after every block of declarations. The @option{-nbad} option causes @command{indent} not to force such blank lines. The @option{-bap} option forces a blank line after every procedure body. The @option{-nbap} option forces no such blank line. @kindex -bbb @kindex --blank-lines-before-block-comments @kindex -nbbb @kindex --no-blank-lines-before-block-comments The @option{-bbb} option forces a blank line before every boxed comment (@xref{Comments}.) The @option{-nbbb} option does not force such blank lines. @kindex -sob @kindex --swallow-optional-blank-lines @kindex -nsob @kindex --leave-optional-blank-lines The @option{-sob} option causes @command{indent} to swallow optional blank lines (that is, any optional blank lines present in the input will be removed from the output). If the @option{-nsob} is specified, any blank lines present in the input file will be copied to the output file. @ifinfo @menu * -bad:: More on the @option{-bad} option. * -bap:: More on the @option{-bap} option. @end menu @end ifinfo @node -bad, -bap, , Blank lines @comment node-name, next, previous, up @subsection --blank-lines-after-declarations The @option{-bad} option forces a blank line after every block of declarations. The @option{-nbad} option does not add any such blank lines. For example, given the input @example @group char *foo; char *bar; /* This separates blocks of declarations. */ int baz; @end group @end example @kindex -bad @kindex --blank-lines-after-declarations @kindex -nbad @kindex --no-blank-lines-after-declarations @noindent @code{indent -bad} produces @example @group char *foo; char *bar; /* This separates blocks of declarations. */ int baz; @end group @end example @noindent and @code{indent -nbad} produces @example @group char *foo; char *bar; /* This separates blocks of declarations. */ int baz; @end group @end example @node -bap, , -bad, Blank lines @comment node-name, next, previous, up @subsection --blank-lines-after-procedures @kindex -bap @kindex --blank-lines-after-procedures @kindex -nbap @kindex --no-blank-lines-after-procedures The @option{-bap} option forces a blank line after every procedure body. For example, given the input @example @group int foo () @{ puts("Hi"); @} /* The procedure bar is even less interesting. */ char * bar () @{ puts("Hello"); @} @end group @end example @noindent @code{indent -bap} produces @example @group int foo () @{ puts ("Hi"); @} /* The procedure bar is even less interesting. */ char * bar () @{ puts ("Hello"); @} @end group @end example @noindent @c A better `group' would be better than `need'. @need 1250 and @code{indent -nbap} produces @example @group int foo () @{ puts ("Hi"); @} /* The procedure bar is even less interesting. */ char * bar () @{ puts ("Hello"); @} @end group @end example @noindent No blank line will be added after the procedure @code{foo}. @node Comments, Statements, Blank lines, Indent Program @comment node-name, next, previous, up @section Comments @cindex Comments @command{indent} formats both C and C++ comments. C comments are begun with @samp{/*}, terminated with @samp{*/} and may contain newline characters. C++ comments begin with the delimiter @samp{//} and end at the newline. @command{indent} handles comments differently depending upon their context. @command{indent} attempts to distinguish between comments which follow statements, comments which follow declarations, comments following preprocessor directives, and comments which are not preceded by code of any sort, i.e., they begin the text of the line (although not necessarily in column 1). @command{indent} further distinguishes between comments found outside of procedures and aggregates, and those found within them. In particular, comments beginning a line found within a procedure will be indented to the column at which code is currently indented. The exception to this is a comment beginning in the leftmost column; such a comment is output at that column. @command{indent} attempts to leave @dfn{boxed comments} unmodified. The general idea of such a comment is that it is enclosed in a rectangle or ``box'' of stars or dashes to visually set it apart. More precisely, boxed comments are defined as those in which the initial @samp{/*} is followed immediately by the character @samp{*}, @samp{=}, @samp{_}, or @samp{-}, or those in which the beginning comment delimiter (@samp{/*}) is on a line by itself, and the following line begins with a @samp{*} in the same column as the star of the opening delimiter. Examples of boxed comments are: @example @group /********************** * Comment in a box!! * **********************/ /* * A different kind of scent, * for a different kind of comment. */ @end group @end example @command{indent} attempts to leave boxed comments exactly as they are found in the source file. Thus the indentation of the comment is unchanged, and its length is not checked in any way. The only alteration made is that an embedded tab character may be converted into the appropriate number of spaces. If the @option{-bbb} option is specified, all such boxed comments will be preceded by a blank line, unless such a comment is preceded by code. @kindex -fca @kindex --format-all-comments @kindex -nfca @kindex --dont-format-comments @kindex -fc1 @kindex --format-first-column-comments @kindex -nfc1 @kindex --dont-format-first-column-comments Comments which are not boxed comments may be formatted, which means that the line is broken to fit within a right margin and left-filled with whitespace. Single newlines are equivalent to a space, but blank lines (two or more newlines in a row) are taken to mean a paragraph break. Formatting of comments which begin after the first column is enabled with the @option{-fca} option. To format those beginning in column one, specify @option{-fc1}. Such formatting is disabled by default. The right margin for formatting defaults to 78, but may be changed with the @option{-lc} option. If the margin specified does not allow the comment to be printed, the margin will be automatically extended for the duration of that comment. The margin is not respected if the comment is not being formatted. @kindex -d@var{n} @kindex --line-comments-indentation@var{n} If the comment begins a line (i.e., there is no program text to its left), it will be indented to the column it was found in unless the comment is within a block of code. In that case, such a comment will be aligned with the indented code of that block (unless the comment began in the first column). This alignment may be affected by the @option{-d} option, which specifies an amount by which such comments are moved to the @emph{left}, or unindented. For example, @option{-d2} places comments two spaces to the left of code. By default, comments are aligned with code, unless they begin in the first column, in which case they are left there by default --- to get them aligned with the code, specify @option{-fc1}. @kindex -c@var{n} @kindex --comment-indentation@var{n} @kindex -cd@var{n} @kindex --declaration-comment-column@var{n} @kindex -cp@var{n} @kindex --else-endif-column@var{n} @kindex --left-justify-declarations @kindex --dont-left-justify-declarations @kindex -dj @kindex -ndj Comments to the right of code will appear by default in column 33. This may be changed with one of three options. @option{-c} will specify the column for comments following code, @option{-cd} specifies the column for comments following declarations, and @option{-cp} specifies the column for comments following preprocessor directives @code{#else} and @code{#endif}. @option{-dj} together with @option{-cd0} can be used to suppress alignment of comments to the right of declarations, causing the comment to follow one tabstop from the end of the declaration. Normally @option{-cd0} causes @option{-c} to become effective. If the code to the left of the comment exceeds the beginning column, the comment column will be extended to the next tabstop column past the end of the code, or in the case of preprocessor directives, to one space past the end of the directive. This extension lasts only for the output of that particular comment. @kindex -cdb @kindex --comment-delimiters-on-blank-lines @kindex -ncdb @kindex --no-comment-delimiters-on-blank-lines The @option{-cdb} option places the comment delimiters on blank lines. Thus, a single line comment like @code{/* Loving hug */} can be transformed into: @example @group /* Loving hug */ @end group @end example @kindex -sc @kindex --star-left-side-of-comments @kindex -nsc @kindex --dont-star-comments Stars can be placed at the beginning of multi-line comments with the @option{-sc} option. Thus, the single-line comment above can be transformed (with @option{-cdb -sc}) into: @example @group /* * Loving hug */ @end group @end example @node Statements, Declarations, Comments, Indent Program @comment node-name, next, previous, up @section Statements @kindex -br @kindex --braces-on-if-line @kindex -bl @kindex --braces-after-if-line The @option{-br} or @option{-bl} option specifies how to format braces. @c another paragraph that needs to be attached to its example. @need 650 The @option{-br} option formats statement braces like this: @example @group if (x > 0) @{ x--; @} @end group @end example @noindent The @option{-bl} option formats them like this: @example @group if (x > 0) @{ x--; @} @end group @end example @kindex -bli@var{n} @kindex --brace-indent@var{n} If you use the @option{-bl} option, you may also want to specify the @option{-bli} option. This option specifies the number of spaces by which braces are indented. @option{-bli2}, the default, gives the result shown above. @option{-bli0} results in the following: @example @group if (x > 0) @{ x--; @} @end group @end example @kindex -ce @kindex --cuddle-else @kindex -dce @kindex --dont-cuddle-else If you are using the @option{-br} option, you probably want to also use the @option{-ce} option. This causes the @code{else} in an if-then-else construct to cuddle up to the immediately preceding @samp{@}}. For example, with @option{-br -ce} you get the following: @example @group if (x > 0) @{ x--; @} else @{ fprintf (stderr, "...something wrong?\n"); @} @end group @end example @noindent With @option{-br -nce} that code would appear as @example @group if (x > 0) @{ x--; @} else @{ fprintf (stderr, "...something wrong?\n"); @} @end group @end example @kindex -cdw @kindex --cuddle-do-while @kindex -ncdw @kindex --dont-cuddle-do-while This causes the @code{while} in a do-while loop to cuddle up to the immediately preceding @samp{@}}. For example, with @option{-cdw} you get the following: @example @group do @{ x--; @} while (x); @end group @end example @noindent With @option{-ncdw} that code would appear as @example @group do @{ x--; @} while (x); @end group @end example @kindex -cli@var{n} @kindex --case-indentation@var{n} The @option{-cli} option specifies the number of spaces that case labels should be indented to the right of the containing @code{switch} statement. @noindent The default gives code like: @example @group switch (i) @{ case 0: break; case 1: @{ ++i; @} default: break; @} @end group @end example @need 1550 Using the @option{-cli2} that would become: @example @group switch (i) @{ case 0: break; case 1: @{ ++i; @} default: break; @} @end group @end example @kindex -cbi@var{n} @kindex --case-brace-indentation@var{n} The indentation of the braces below a case statement can be controlled with the @option{-cbi@var{n}} option. For example, using @option{-cli2 -cbi0} results in: @example @group switch (i) @{ case 0: break; case 1: @{ ++i; @} default: break; @} @end group @end example @kindex -ss @kindex --space-special-semicolon @kindex -nss @kindex --dont-space-special-semicolon If a semicolon is on the same line as a @code{for} or @code{while} statement, the @option{-ss} option will cause a space to be placed before the semicolon. This emphasizes the semicolon, making it clear that the body of the @code{for} or @code{while} statement is an empty statement. @option{-nss} disables this feature. @kindex -pcs @kindex --space-after-procedure-calls @kindex -npcs @kindex --no-space-after-function-call-names The @option{-pcs} option causes a space to be placed between the name of the procedure being called and the @samp{(} (for example, @w{@code{puts ("Hi");}}. The @option{-npcs} option would give @code{puts("Hi");}). @refill @kindex -cs @kindex --space-after-cast @kindex -ncs @kindex --no-space-after-cast If the @option{-cs} option is specified, @command{indent} puts a space between a cast operator and the object to be cast. The @option{-ncs} ensures that there is no space between the cast operator and the object. Remember that @command{indent} only knows about the standard C data types and so cannot recognise user-defined types in casts. Thus @code{(mytype)thing} is not treated as a cast. @kindex -bs @kindex --blank-after-sizeof The @option{-bs} option ensures that there is a space between the keyword @code{sizeof} and its argument. In some versions, this is known as the @samp{Bill_Shannon} option. @kindex -saf @kindex --space-after-for @kindex -nsaf @kindex --no-space-after-for The @option{-saf} option forces a space between a @code{for} and the following parenthesis. This is the default. @kindex -sai @kindex --space-after-if @kindex -nsai @kindex --no-space-after-if The @option{-sai} option forces a space between a @code{if} and the following parenthesis. This is the default. @kindex -saw @kindex --space-after-while @kindex -nsaw @kindex --no-space-after-while The @option{-saw} option forces a space between a @code{while} and the following parenthesis. This is the default. @kindex -prs @kindex --space-after-parentheses The @option{-prs} option causes all parentheses to be separated with a space from whatever is between them. For example, using @option{-prs} results in code like: @example @group while ( ( e_code - s_code ) < ( dec_ind - 1 ) ) @{ set_buf_break ( bb_dec_ind ); *e_code++ = ' '; @} @end group @end example @node Declarations, Indentation, Statements, Indent Program @comment node-name, next, previous, up @section Declarations @kindex -di@var{n} @kindex --declaration-indentation@var{n} By default @command{indent} will line up identifiers, in the column specified by the @option{-di} option. For example, @option{-di16} makes things look like: @example @group int foo; char *bar; @end group @end example Using a small value (such as one or two) for the @option{-di} option can be used to cause the identifiers to be placed in the first available position; for example: @example @group int foo; char *bar; @end group @end example The value given to the @option{-di} option will still affect variables which are put on separate lines from their types, for example @option{-di2} will lead to: @example @group int foo; @end group @end example @kindex -bc @kindex --blank-lines-after-commas @kindex -nbc @kindex --no-blank-lines-after-commas If the @option{-bc} option is specified, a newline is forced after each comma in a declaration. For example, @example @group int a, b, c; @end group @end example @noindent With the @option{-nbc} option this would look like @example int a, b, c; @end example @kindex -bfda @kindex --break-function-decl-args @kindex -nbfda @kindex --dont-break-function-decl-args @kindex -bfde @kindex --break-function-decl-args-end @kindex -nbfde @kindex --dont-break-function-decl-args-end The @option{-bfda} option causes a newline to be forced after the comma separating the arguments of a function declaration. The arguments will appear at one indention level deeper than the function declaration. This is particularly helpful for functions with long argument lists. The option @option{-bfde} causes a newline to be forced before the closing bracket of the function declaration. For both options the 'n' setting is the default: -nbdfa and -nbdfe. For example, @example @group void foo (int arg1, char arg2, int *arg3, long arg4, char arg5); @end group @end example @noindent With the @option{-bfda} option this would look like @example void foo ( int arg1, char arg2, int *arg3, long arg4, char arg5); @end example With, in addition, the @option{-bfde} option this would look like @example void foo ( int arg1, char arg2, int *arg3, long arg4, char arg5 ); @end example @kindex -psl @kindex --procnames-start-lines @kindex -npsl @kindex --dont-break-procedure-type @cindex @command{etags} requires @option{-psl} The @option{-psl} option causes the type of a procedure being defined to be placed on the line before the name of the procedure. This style is required for the @command{etags} program to work correctly, as well as some of the @code{c-mode} functions of Emacs. @kindex -T @cindex Typenames @cindex typedef You must use the @option{-T} option to tell @command{indent} the name of all the typenames in your program that are defined by @code{typedef}. @option{-T} can be specified more than once, and all names specified are used. For example, if your program contains @example @group typedef unsigned long CODE_ADDR; typedef enum @{red, blue, green@} COLOR; @end group @end example @noindent you would use the options @option{-T CODE_ADDR -T COLOR}. @kindex -bls @kindex --braces-after-struct-decl-line @kindex -brs @kindex --braces-on-struct-decl-line The @option{-brs} or @option{-bls} option specifies how to format braces in struct declarations. The @option{-brs} option formats braces like this: @example @group struct foo @{ int x; @}; @end group @end example @noindent The @option{-bls} option formats them like this: @example @group struct foo @{ int x; @}; @end group @end example @kindex -blf @kindex --braces-after-func-def-line @kindex -brs @kindex --braces-on-func-def-line Similarly to the structure brace @option{-brs} and @option{-bls} options, the function brace options @option{-brf} or @option{-blf} specify how to format the braces in function definitions. The @option{-brf} option formats braces like this: @example @group int one(void) @{ return 1; @}; @end group @end example @noindent The @option{-blf} option formats them like this: @example @group int one(void) @{ return 1; @}; @end group @end example @node Indentation, Breaking long lines, Declarations, Indent Program @comment node-name, next, previous, up @section Indentation @kindex -i@var{n} @kindex --indent-level@var{n} @kindex -ci@var{n} @kindex --continuation-indentation@var{n} @kindex -lp @kindex --continue-at-parentheses @kindex -nlp @kindex --dont-line-up-parentheses One issue in the formatting of code is how far each line should be indented from the left margin. When the beginning of a statement such as @code{if} or @code{for} is encountered, the indentation level is increased by the value specified by the @option{-i} option. For example, use @option{-i8} to specify an eight character indentation for each level. When a statement is broken across two lines, the second line is indented by a number of additional spaces specified by the @option{-ci} option. @option{-ci} defaults to 0. However, if the @option{-lp} option is specified, and a line has a left parenthesis which is not closed on that line, then continuation lines will be lined up to start at the character position just after the left parenthesis. This processing also applies to @samp{[} and applies to @samp{@{} when it occurs in initialization lists. For example, a piece of continued code might look like this with @option{-nlp -ci3} in effect: @example @group p1 = first_procedure (second_procedure (p2, p3), third_procedure (p4, p5)); @end group @end example @noindent With @option{-lp} in effect the code looks somewhat clearer: @example @group p1 = first_procedure (second_procedure (p2, p3), third_procedure (p4, p5)); @end group @end example @kindex -ts@var{n} @kindex --tab-size@var{n} When a statement is broken in between two or more paren pairs (...), each extra pair causes the indentation level extra indentation: @example @group if ((((i < 2 && k > 0) || p == 0) && q == 1) || n = 0) @end group @end example @noindent The option @option{-ip@var{N}} can be used to set the extra offset per paren. For instance, @option{-ip0} would format the above as: @example @group if ((((i < 2 && k > 0) || p == 0) && q == 1) || n = 0) @end group @end example @noindent @command{indent} assumes that tabs are placed at regular intervals of both input and output character streams. These intervals are by default 8 columns wide, but (as of version 1.2) may be changed by the @option{-ts} option. Tabs are treated as the equivalent number of spaces. @kindex -ip@var{n} @kindex --parameter-indentation@var{n} @kindex -nip @kindex --no-parameter-indentation The indentation of type declarations in old-style function definitions is controlled by the @option{-ip} parameter. This is a numeric parameter specifying how many spaces to indent type declarations. For example, the default @w{@option{-ip5}} makes definitions look like this: @example @group char * create_world (x, y, scale) int x; int y; float scale; @{ . . . @} @end group @end example For compatibility with other versions of indent, the option @option{-nip} is provided, which is equivalent to @option{-ip0}. @kindex -lps @kindex --leave-preprocessor-space @kindex -nlps @kindex --remove-preprocessor-space ANSI C allows white space to be placed on preprocessor command lines between the character @samp{#} and the command name. By default, @command{indent} removes this space, but specifying the @option{-lps} option directs @command{indent} to leave this space unmodified. The option @option{-ppi} overrides @option{-nlps} and @option{-lps}. @kindex -ppi@var{n} @kindex --preprocessor-indentation@var{n} This option can be used to request that preprocessor conditional statements can be indented by to given number of spaces, for example with the option @option{-ppi 3} @example @group #if X #if Y #define Z 1 #else #define Z 0 #endif #endif @end group @end example becomes @example @group #if X # if Y # define Z 1 # else # define Z 0 # endif #endif @end group @end example @kindex -il@var{n} @kindex --indent-label@var{n} This option sets the offset at which a label (except case labels) will be positioned. If it is set to zero or a positive number, this indicates how far from the left margin to indent a label. If it is set to a negative number, this indicates how far back from the current indent level to place the label. The default setting is -2 which matches the behaviour of earlier versions of indent. Note that this parameter does not affect the placing of case labels; see the @option{-cli} parameter for that. For example with the option @option{-il 1} @example @group function() @{ if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; @} @end group @end example becomes @example @group function() @{ if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; @} @end group @end example @node Breaking long lines, Disabling Formatting, Indentation, Indent Program @comment node-name, next, previous, up @section Breaking long lines @kindex -l@var{n} @kindex --line-length@var{n} With the option @option{-l@var{n}}, or @option{--line-length@var{n}}, it is possible to specify the maximum length of a line of C code, not including possible comments that follow it. When lines become longer than the specified line length, GNU @command{indent} tries to break the line at a logical place. This is new as of version 2.1 however and not very intelligent or flexible yet. @kindex -bbo @kindex --break-before-boolean-operator @kindex -nbbo @kindex --break-after-boolean-operator @kindex -hnl @kindex --honour-newlines @kindex -nhnl @kindex --ignore-newlines Currently there are two options that allow one to interfere with the algorithm that determines where to break a line. The @option{-bbo} option causes GNU @command{indent} to prefer to break long lines before the boolean operators @code{&&} and @code{||}. The @option{-nbbo} option causes GNU @command{indent} not have that preference. For example, the default option @option{-bbo} (together with @option{--line-length60} and @option{--ignore-newlines}) makes code look like this: @example @group if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) @end group @end example Using the option @option{-nbbo} will make it look like this: @example @group if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) @end group @end example The default @option{-hnl}, however, honours newlines in the input file by giving them the highest possible priority to break lines at. For example, when the input file looks like this: @example @group if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) @end group @end example @noindent then using the option @option{-hnl}, or @option{--honour-newlines}, together with the previously mentioned @option{-nbbo} and @option{--line-length60}, will cause the output not to be what is given in the last example but instead will prefer to break at the positions where the code was broken in the input file: @example @group if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) @end group @end example The idea behind this option is that lines which are too long, but are already broken up, will not be touched by GNU @command{indent}. Really messy code should be run through @command{indent} at least once using the @option{--ignore-newlines} option though. @node Disabling Formatting, Miscellaneous options, Breaking long lines, Indent Program @comment node-name, next, previous, up @section Disabling Formatting Formatting of C code may be disabled for portions of a program by embedding special @dfn{control comments} in the program. To turn off formatting for a section of a program, place the disabling control comment @code{/* *INDENT-OFF* */} on a line by itself just before that section. Program text scanned after this control comment is output precisely as input with no modifications until the corresponding enabling comment is scanned on a line by itself. The disabling control comment is @code{/* *INDENT-ON* */}, and any text following the comment on the line is also output unformatted. Formatting begins again with the input line following the enabling control comment. More precisely, @command{indent} does not attempt to verify the closing delimiter (@code{*/}) for these C comments, and any whitespace on the line is totally transparent. These control comments also function in their C++ formats, namely @code{// *INDENT-OFF*} and @code{// *INDENT-ON*}. It should be noted that the internal state of @command{indent} remains unchanged over the course of the unformatted section. Thus, for example, turning off formatting in the middle of a function and continuing it after the end of the function may lead to bizarre results. It is therefore wise to be somewhat modular in selecting code to be left unformatted. As a historical note, some earlier versions of @command{indent} produced error messages beginning with @code{*INDENT**}. These versions of @command{indent} were written to ignore any input text lines which began with such error messages. I have removed this incestuous feature from GNU @command{indent}. @node Miscellaneous options, Bugs, Disabling Formatting, Indent Program @comment node-name, next, previous, up @section Miscellaneous options @kindex -version To find out what version of @command{indent} you have, use the command @code{indent -version}. This will report the version number of @command{indent}, without doing any of the normal processing. @kindex -v @kindex --verbose @kindex -nv @kindex --no-verbosity @comment Would --terse be better? I think not, but perhaps accepting @comment --no-verbose would avoid error messages. The @option{-v} option can be used to turn on verbose mode. When in verbose mode, @command{indent} reports when it splits one line of input into two more more lines of output, and gives some size statistics at completion. @kindex -pmt @kindex --preserve-mtime @kindex -npmt The @option{-pmt} option causes @command{indent} to preserve the access and modification times on the output files. Using this option has the advantage that running indent on all source and header files in a project won't cause @code{make} to rebuild all targets. This option is only available on Operating Systems that have the POSIX @code{utime(2)} function. @node Bugs, Copyright, Miscellaneous options, Indent Program @comment node-name, next, previous, up @section Bugs Please report any bugs to @email{bug-indent@@gnu.org}. When @command{indent} is run twice on a file, with the same profile, it should @emph{never} change that file the second time. With the current design of @command{indent}, this can not be guaranteed, and it has not been extensively tested. @command{indent} does not understand C. In some cases this leads to the inability to join lines. The result is that running a file through @command{indent} is @emph{irreversible}, even if the used input file was the result of running @command{indent} with a given profile (@file{.indent.pro}). While an attempt was made to get @command{indent} working for C++, it will not do a good job on any C++ source except the very simplest. @command{indent} does not look at the given @option{--line-length} option when writing comments to the output file. This results often in comments being put far to the right. In order to prohibit @command{indent} from joining a broken line that has a comment at the end, make sure that the comments start on the first line of the break. @command{indent} does not count lines and comments (see the @option{-v} option) when @command{indent} is turned off with @code{/* *INDENT-OFF* */}. Comments of the form @code{/*UPPERCASE*/} are not treated as comment but as an identifier, causing them to be joined with the next line. This renders comments of this type useless, unless they are embedded in the code to begin with. @node Copyright, , Bugs, Indent Program @comment node-name, next, previous, up @section Copyright The following copyright notice applies to the @command{indent} program. The copyright and copying permissions for this manual appear near the beginning of @file{indent.texinfo} and @file{indent.info}, and near the end of @file{indent.1}. @display Copyright @copyright{} 2001 David Ingamells. Copyright @copyright{} 1999 Carlo Wood. Copyright @copyright{} 1995, 1996 Joseph Arceneaux. Copyright @copyright{} 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation Copyright @copyright{} 1985 Sun Microsystems, Inc. Copyright @copyright{} 1980 The Regents of the University of California. Copyright @copyright{} 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. @end display @c !END THEREST @node Option Summary, Index, Indent Program, Top @appendix Option Summary Here is a list of all the options for @command{indent}, alphabetized by short option. It is followed by a cross key alphabetized by long option. @c !BEGIN OPTIONS @c The cross references are all on lines by themselves because this @c looks better in both printed output and Info. 4 Feb 1992 --rjc @table @samp @item -bad @itemx --blank-lines-after-declarations Force blank lines after the declarations.@* @xref{Blank lines}. @item -bap @itemx --blank-lines-after-procedures Force blank lines after procedure bodies.@* @xref{Blank lines}. @item -bbb @itemx --blank-lines-before-block-comments Force blank lines before block comments.@* @xref{Blank lines}. @item -bbo @itemx --break-before-boolean-operator Prefer to break long lines before boolean operators.@* @xref{Breaking long lines}. @item -bc @itemx --blank-lines-after-commas Force newline after comma in declaration.@* @xref{Declarations}. @item -bl @itemx --braces-after-if-line Put braces on line after @code{if}, etc.@* @xref{Statements}. @item -blf @itemx --braces-after-func-def-line Put braces on line following function definition line.@* @xref{Declarations}. @item -bli@var{n} @itemx --brace-indent@var{n} Indent braces @var{n} spaces.@* @xref{Statements}. @item -bls @itemx --braces-after-struct-decl-line Put braces on the line after @code{struct} declaration lines.@* @xref{Declarations}. @item -br @itemx --braces-on-if-line Put braces on line with @code{if}, etc.@* @xref{Statements}. @item -brf @itemx --braces-on-func-def-line Put braces on function definition line.@* @xref{Declarations}. @item -brs @itemx --braces-on-struct-decl-line Put braces on @code{struct} declaration line.@* @xref{Declarations}. @item -bs @itemx --Bill-Shannon @itemx --blank-before-sizeof Put a space between @code{sizeof} and its argument.@* @xref{Statements}. @item -c@var{n} @itemx --comment-indentation@var{n} Put comments to the right of code in column @var{n}.@* @xref{Comments}. @item -cbi@var{n} @itemx --case-brace-indentation@var{n} Indent braces after a case label N spaces.@* @xref{Statements}. @item -cd@var{n} @itemx --declaration-comment-column@var{n} Put comments to the right of the declarations in column @var{n}.@* @xref{Comments}. @item -cdb @itemx --comment-delimiters-on-blank-lines Put comment delimiters on blank lines.@* @xref{Comments}. @item -cdw @itemx --cuddle-do-while Cuddle while of @code{do @{@} while;} and preceding @samp{@}}.@* @xref{Comments}. @item -ce @itemx --cuddle-else Cuddle else and preceding @samp{@}}.@* @xref{Comments}. @item -ci@var{n} @itemx --continuation-indentation@var{n} Continuation indent of @var{n} spaces.@* @xref{Statements}. @item -cli@var{n} @itemx --case-indentation@var{n} Case label indent of @var{n} spaces.@* @xref{Statements}. @item -cp@var{n} @itemx --else-endif-column@var{n} Put comments to the right of @code{#else} and @code{#endif} statements in column @var{n}.@* @xref{Comments}. @item -cs @itemx --space-after-cast Put a space after a cast operator.@* @xref{Statements}. @item -d@var{n} @itemx --line-comments-indentation@var{n} Set indentation of comments not to the right of code to @var{n} spaces.@* @xref{Comments}. @item -bfda @itemx --break-function-decl-args Break the line before all arguments in a declaration.@* @xref{Declarations}. @item -bfde @itemx --break-function-decl-args-end Break the line after the last argument in a declaration.@* @xref{Declarations}. @item -dj@var{n} @itemx --left-justify-declarations If -cd 0 is used then comments after declarations are left justified behind the declaration.@* @xref{Declarations}. @item -di@var{n} @itemx --declaration-indentation@var{n} Put variables in column @var{n}.@* @xref{Declarations}. @item -fc1 @itemx --format-first-column-comments Format comments in the first column.@* @xref{Comments}. @item -fca @itemx --format-all-comments Do not disable all formatting of comments.@* @xref{Comments}. @item -gnu @itemx --gnu-style Use GNU coding style. This is the default.@* @xref{Common styles}. @item -hnl @itemx --honour-newlines Prefer to break long lines at the position of newlines in the input.@* @xref{Breaking long lines}. @item -i@var{n} @itemx --indent-level@var{n} Set indentation level to @var{n} spaces.@* @xref{Indentation}. @item -il@var{n} @itemx --indent-label@var{n} Set offset for labels to column @var{n}.@* @xref{Indentation}. @item -ip@var{n} @itemx --parameter-indentation@var{n} Indent parameter types in old-style function definitions by @var{n} spaces.@* @xref{Indentation}. @item -kr @itemx --k-and-r-style Use Kernighan & Ritchie coding style.@* @xref{Common styles}. @item -l@var{n} @itemx --line-length@var{n} Set maximum line length for non-comment lines to @var{n}.@* @xref{Breaking long lines}. @item -lc@var{n} @itemx --comment-line-length@var{n} Set maximum line length for comment formatting to @var{n}.@* @xref{Comments}. @item -linux @itemx --linux-style Use Linux coding style.@* @xref{Common styles}. @item -lp @itemx --continue-at-parentheses Line up continued lines at parentheses.@* @xref{Indentation}. @item -lps @itemx --leave-preprocessor-space Leave space between @samp{#} and preprocessor directive.@* @xref{Indentation}. @item -nbad @itemx --no-blank-lines-after-declarations Do not force blank lines after declarations.@* @xref{Blank lines}. @item -nbap @itemx --no-blank-lines-after-procedures Do not force blank lines after procedure bodies.@* @xref{Blank lines}. @ignore @comment Didn't do anything, so I removed it @item -nbbb @itemx --no-blank-lines-before-block-comments Do not force blank-lines before block comments.@* @xref{Blank lines}. @end ignore @item -nbbo @itemx --break-after-boolean-operator Do not prefer to break long lines before boolean operators.@* @xref{Breaking long lines}. @item -nbc @itemx --no-blank-lines-after-commas Do not force newlines after commas in declarations.@* @xref{Declarations}. @item -nbfda @itemx --dont-break-function-decl-args Don't put each argument in a function declaration on a separate line.@* @xref{Declarations}. @item -ncdb @itemx --no-comment-delimiters-on-blank-lines Do not put comment delimiters on blank lines.@* @xref{Comments}. @item -ncdw @itemx --dont-cuddle-do-while Do not cuddle @code{@}} and the @code{while} of a @code{do @{@} while;}.@* @xref{Statements}. @item -nce @itemx --dont-cuddle-else Do not cuddle @code{@}} and @code{else}.@* @xref{Statements}. @item -ncs @itemx --no-space-after-casts Do not put a space after cast operators.@* @xref{Statements}. @item -ndj@var{n} @itemx --dont-left-justify-declarations Comments after declarations are treated the same as comments after other statements.@* @xref{Declarations}. @item -nfc1 @itemx --dont-format-first-column-comments Do not format comments in the first column as normal.@* @xref{Comments}. @item -nfca @itemx --dont-format-comments Do not format any comments.@* @xref{Comments}. @item -nhnl @itemx --ignore-newlines Do not prefer to break long lines at the position of newlines in the input.@* @xref{Breaking long lines}. @item -nip @itemx --no-parameter-indentation Zero width indentation for parameters.@* @xref{Indentation}. @item -nlp @itemx --dont-line-up-parentheses Do not line up parentheses.@* @xref{Statements}. @item -npcs @itemx --no-space-after-function-call-names Do not put space after the function in function calls.@* @xref{Statements}. @item -nprs @itemx --no-space-after-parentheses Do not put a space after every '(' and before every ')'.@* @xref{Statements}. @item -npsl @itemx --dont-break-procedure-type Put the type of a procedure on the same line as its name.@* @xref{Declarations}. @item -nsaf @itemx --no-space-after-for Do not put a space after every @code{for}.@* @xref{Statements}. @item -nsai @itemx --no-space-after-if Do not put a space after every @code{if}.@* @xref{Statements}. @item -nsaw @itemx --no-space-after-while Do not put a space after every @code{while}.@* @xref{Statements}. @item -nsc @itemx --dont-star-comments Do not put the @samp{*} character at the left of comments.@* @xref{Comments}. @item -nsob @itemx --leave-optional-blank-lines Do not swallow optional blank lines.@* @xref{Blank lines}. @item -nss @itemx --dont-space-special-semicolon Do not force a space before the semicolon after certain statements. Disables @option{-ss}.@* @xref{Statements}. @item -nut @itemx --no-tabs Use spaces instead of tabs.@* @xref{Indentation}. @item -nv @itemx --no-verbosity Disable verbose mode.@* @xref{Miscellaneous options}. @item -orig @itemx --original Use the original Berkeley coding style.@* @xref{Common styles}. @item -npro @itemx --ignore-profile Do not read @file{.indent.pro} files.@* @xref{Invoking indent}. @item -pcs @itemx --space-after-procedure-calls Insert a space between the name of the procedure being called and the @samp{(}.@* @xref{Statements}. @item -pi@var{n} @itemx --paren-indentation@var{n} Specify the extra indentation per open parentheses '(' when a statement is broken. @xref{Statements}. @item -pmt @itemx --preserve-mtime Preserve access and modification times on output files. @xref{Miscellaneous options}. @item -ppi@var{n} @itemx --preprocessor-indentation@var{n} Specify the indentation for preprocessor conditional statements. @xref{Indentation}. @item -prs @itemx --space-after-parentheses Put a space after every '(' and before every ')'.@* @xref{Statements}. @item -psl @itemx --procnames-start-lines Put the type of a procedure on the line before its name.@* @xref{Declarations}. @item -saf @itemx --space-after-for Put a space after each @code{for}.@* @xref{Statements}. @item -sai @itemx --space-after-if Put a space after each @code{if}.@* @xref{Statements}. @item -saw @itemx --space-after-while Put a space after each @code{while}.@* @xref{Statements}. @item -sbi@var{n} @itemx --struct-brace-indentation@var{n} Indent braces of a struct, union or enum N spaces.@* @xref{Statements}. @item -sc @itemx --start-left-side-of-comments Put the @samp{*} character at the left of comments.@* @xref{Comments}. @item -sob @itemx --swallow-optional-blank-lines Swallow optional blank lines.@* @xref{Blank lines}. @item -ss @itemx --space-special-semicolon On one-line @code{for} and @code{while} statements, force a blank before the semicolon.@* @xref{Statements}. @item -st @itemx --standard-output Write to standard output.@* @xref{Invoking indent}. @item -T Tell @command{indent} the name of typenames.@* @xref{Declarations}. @item -ts@var{n} @itemx --tab-size@var{n} Set tab size to @var{n} spaces.@* @xref{Indentation}. @item -ut @itemx --use-tabs Use tabs. This is the default.@* @xref{Indentation}. @item -v @itemx --verbose Enable verbose mode.@* @xref{Miscellaneous options}. @item -version Output the version number of @command{indent}.@* @xref{Miscellaneous options}. @end table @c !END OPTIONS @c !BEGIN CROSSREF @subheading Options' Cross Key Here is a list of options alphabetized by long option, to help you find the corresponding short option. @iftex @sp 2 @end iftex @tex \def\leaderfill{\leaders\hbox to 1em{\hss.\hss}\hfill} {\tt \line{ --blank-lines-after-commas \leaderfill -bc\ \ } \line{ --blank-lines-after-declarations \leaderfill -bad\ } \line{ --blank-lines-after-procedures \leaderfill -bap\ } \line{ --blank-lines-before-block-comments \leaderfill -bbb\ } \line{ --braces-after-if-line \leaderfill -bl\ \ } \line{ --braces-after-func-def-line \leaderfill -blf\ \ } \line{ --brace-indent \leaderfill -bli@var{n}} \line{ --braces-after-struct-decl-line \leaderfill -bls\ \ } \line{ --break-after-boolean-operator \leaderfill -nbbo\ \ } \line{ --break-before-boolean-operator \leaderfill -bbo\ \ } \line{ --break-function-decl-args \leaderfill -bfda} \line{ --break-function-decl-args-end \leaderfill -bfde} \line{ --braces-on-if-line \leaderfill -br\ \ } \line{ --braces-on-func-def-line \leaderfill -brf\ \ } \line{ --braces-on-struct-decl-line \leaderfill -brs\ \ } \line{ --case-indentation \leaderfill -cli@var{n}} \line{ --case-brace-indentation \leaderfill -cbi@var{n}} \line{ --comment-delimiters-on-blank-lines \leaderfill -cdb\ } \line{ --comment-indentation \leaderfill -c@var{n}\ \ } \line{ --continuation-indentation \leaderfill -ci@var{n}\ } \line{ --continue-at-parentheses \leaderfill -lp\ \ } \line{ --cuddle-do-while \leaderfill -cdw\ \ } \line{ --cuddle-else \leaderfill -ce\ \ } \line{ --declaration-comment-column \leaderfill -cd@var{n}\ } \line{ --declaration-indentation \leaderfill -di@var{n}\ } \line{ --dont-break-function-decl-args \leaderfill -nbfda} \line{ --dont-break-function-decl-args-end \leaderfill -nbfde} \line{ --dont-break-procedure-type \leaderfill -npsl} \line{ --dont-cuddle-do-while \leaderfill -ncdw\ \ } \line{ --dont-cuddle-else \leaderfill -nce\ } \line{ --dont-format-comments \leaderfill -nfca} \line{ --dont-format-first-column-comments \leaderfill -nfc1} \line{ --dont-left-justify-declarations \leaderfill -ndj\ } \line{ --dont-line-up-parentheses \leaderfill -nlp\ } \line{ --dont-space-special-semicolon \leaderfill -nss\ } \line{ --dont-star-comments \leaderfill -nsc\ } \line{ --else-endif-column \leaderfill -cp@var{n}\ } \line{ --format-all-comments \leaderfill -fca\ } \line{ --format-first-column-comments \leaderfill -fc1\ } \line{ --gnu-style \leaderfill -gnu\ } \line{ --honour-newlines \leaderfill -hnl\ \ } \line{ --ignore-newlines \leaderfill -nhnl\ \ } \line{ --ignore-profile \leaderfill -npro} \line{ --indent-label \leaderfill -il@var{n}\ \ } \line{ --indent-level \leaderfill -i@var{n}\ \ } \line{ --k-and-r-style \leaderfill -kr\ \ } \line{ --leave-optional-blank-lines \leaderfill -nsob} \line{ --leave-preprocessor-space \leaderfill -lps\ } \line{ --left-justify-declarations \leaderfill -dj\ } \line{ --line-comments-indentation \leaderfill -d@var{n}\ \ } \line{ --line-length \leaderfill -l@var{n}\ \ } \line{ --linux-style \leaderfill -linux\ \ } \line{ --no-blank-lines-after-commas \leaderfill -nbc\ } \line{ --no-blank-lines-after-declarations \leaderfill -nbad} \line{ --no-blank-lines-after-procedures \leaderfill -nbap} \line{ --no-blank-lines-before-block-comments \leaderfill -nbbb} \line{ --no-comment-delimiters-on-blank-lines \leaderfill -ncdb} \line{ --no-space-after-casts \leaderfill -ncs\ } \line{ --no-parameter-indentation \leaderfill -nip\ } \line{ --no-space-after-for \leaderfill -nsaf} \line{ --no-space-after-function-call-names \leaderfill -npcs} \line{ --no-space-after-if \leaderfill -nsai} \line{ --no-space-after-parentheses \leaderfill -nprs} \line{ --no-space-after-while \leaderfill -nsaw} \line{ --no-tabs \leaderfill -nut\ \ } \line{ --no-verbosity \leaderfill -nv\ \ } \line{ --original \leaderfill -orig} \line{ --parameter-indentation \leaderfill -ip@var{n}\ } \line{ --paren-indentation \leaderfill -pi@var{n}\ } \line{ --preprocessor-indentation \leaderfill -ppi@var{n}\ } \line{ --preserve-mtime \leaderfill -pmt\ } \line{ --procnames-start-lines \leaderfill -psl\ } \line{ --space-after-cast \leaderfill -cs\ \ } \line{ --space-after-for \leaderfill -saf\ } \line{ --space-after-if \leaderfill -sai\ } \line{ --space-after-parentheses \leaderfill -prs\ } \line{ --space-after-procedure-calls \leaderfill -pcs\ } \line{ --space-after-while \leaderfill -saw\ } \line{ --space-special-semicolon \leaderfill -ss\ \ } \line{ --standard-output \leaderfill -st\ \ } \line{ --start-left-side-of-comments \leaderfill -sc\ \ } \line{ --struct-brace-indentation \leaderfill -sbi@var{n}} \line{ --swallow-optional-blank-lines \leaderfill -sob\ } \line{ --tab-size \leaderfill -ts@var{n}\ } \line{ --use-tabs \leaderfill -ut\ \ } \line{ --verbose \leaderfill -v\ \ \ } } @end tex @ifinfo @example --blank-lines-after-commas -bc --blank-lines-after-declarations -bad --blank-lines-after-procedures -bap --blank-lines-before-block-comments -bbb --braces-after-if-line -bl --braces-after-func-def-line -blf --brace-indent -bli --braces-after-struct-decl-line -bls --braces-on-if-line -br --braces-on-func-def-line -brf --braces-on-struct-decl-line -brs --break-after-boolean-operator -nbbo --break-before-boolean-operator -bbo --break-function-decl-args -bfda --break-function-decl-args-end -bfde --case-indentation -cli@var{n} --case-brace-indentation -cbi@var{n} --comment-delimiters-on-blank-lines -cdb --comment-indentation -c@var{n} --continuation-indentation -ci@var{n} --continue-at-parentheses -lp --cuddle-do-while -cdw --cuddle-else -ce --declaration-comment-column -cd@var{n} --declaration-indentation -di@var{n} --dont-break-function-decl-args -nbfda --dont-break-function-decl-args-end -nbfde --dont-break-procedure-type -npsl --dont-cuddle-do-while -ncdw --dont-cuddle-else -nce --dont-format-comments -nfca --dont-format-first-column-comments -nfc1 --dont-line-up-parentheses -nlp --dont-left-justify-declarations -ndj --dont-space-special-semicolon -nss --dont-star-comments -nsc --else-endif-column -cp@var{n} --format-all-comments -fca --format-first-column-comments -fc1 --gnu-style -gnu --honour-newlines -hnl --ignore-newlines -nhnl --ignore-profile -npro --indent-label -il@var{n} --indent-level -i@var{n} --k-and-r-style -kr --leave-optional-blank-lines -nsob --leave-preprocessor-space -lps --left-justify-declarations -dj --line-comments-indentation -d@var{n} --line-length -l@var{n} --linux-style -linux --no-blank-lines-after-commas -nbc --no-blank-lines-after-declarations -nbad --no-blank-lines-after-procedures -nbap --no-blank-lines-before-block-comments -nbbb --no-comment-delimiters-on-blank-lines -ncdb --no-space-after-casts -ncs --no-parameter-indentation -nip --no-space-after-for -nsaf --no-space-after-function-call-names -npcs --no-space-after-if -nsai --no-space-after-parentheses -nprs --no-space-after-while -nsaw --no-tabs -nut --no-verbosity -nv --original -orig --parameter-indentation -ip@var{n} --paren-indentation -pi@var{n} --preserve-mtime -pmt --preprocessor-indentation -ppi@var{n} --procnames-start-lines -psl --space-after-cast -cs --space-after-for -saf --space-after-if -sai --space-after-parentheses -prs --space-after-procedure-calls -pcs --space-after-while -saw --space-special-semicolon -ss --standard-output -st --start-left-side-of-comments -sc --struct-brace-indentation -sbi@var{n} --swallow-optional-blank-lines -sob --tab-size -ts@var{n} --use-tabs -ut --verbose -v @end example @end ifinfo @c !END CROSSREF @node Index, , Option Summary, Top @unnumbered Index @printindex ky @page @contents @bye indent-2.2.11/doc/version.texi0000644000177400010010000000013711331327407013121 00000000000000@set UPDATED 23 July 2008 @set UPDATED-MONTH July 2008 @set EDITION 2.2.11 @set VERSION 2.2.11 indent-2.2.11/doc/stamp-vti0000644000177400010010000000013711331327407012410 00000000000000@set UPDATED 23 July 2008 @set UPDATED-MONTH July 2008 @set EDITION 2.2.11 @set VERSION 2.2.11 indent-2.2.11/doc/Makefile.am0000644000177400010010000000461211000721367012573 00000000000000## Process this file with automake to produce Makefile.in. info_TEXINFOS = indent.texinfo docdir = $(prefix)/doc/@PACKAGE@ dvidir = $(docdir) psdir = $(docdir) pdfdir = $(docdir) htmldir = $(docdir) HTMLSTYLE = monolithic AUTOMAKE_OPTIONS = 1.2 gnits #EXTRA_DIST = @PACKAGE@.html SED = sed RM = rm -f MAKEINFO = env LANG= LANGUAGE= @MAKEINFO@ all-local: html install-data-local: install-html installdirs-local: installdirs-html uninstall-local: uninstall-html html: html-$(HTMLSTYLE) install-html: install-html-$(HTMLSTYLE) uninstall-html: uninstall-html-$(HTMLSTYLE) TEXI2HTML = @TEXI2HTML@ # BUILT_SOURCES = @PACKAGE@.1 @PACKAGE@.html @PACKAGE@_toc.html html-monolithic: @PACKAGE@.html html-split: @PACKAGE@_toc.html @PACKAGE@.html: version.texi $(@PACKAGE@_TEXINFOS) $(TEXI2HTML) -expandinfo -number -monolithic `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` @PACKAGE@_toc.html: version.texi $(@PACKAGE@_TEXINFOS) case "$(TEXI2HTML)" in \ *"/missing texi2html") \ $(TEXI2HTML) -expand info -number -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` || exit 0 ;; \ *) $(RM) @PACKAGE@_*.html ; \ $(TEXI2HTML) -expand info -number -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` ;; \ esac install-html-monolithic: @PACKAGE@.html $(mkinstalldirs) $(DESTDIR)$(htmldir) $(INSTALL_DATA) `if test -f @PACKAGE@.html; then echo .; else echo $(srcdir); fi`/@PACKAGE@.html $(DESTDIR)$(htmldir)/@PACKAGE@.html install-html-split: @PACKAGE@_toc.html $(mkinstalldirs) $(DESTDIR)$(htmldir) for file in `if test -f @PACKAGE@_toc.html; then echo .; else echo $(srcdir); fi`/@PACKAGE@*.html; do \ $(INSTALL_DATA) $$file $(DESTDIR)$(htmldir)/`basename $$file`; \ done installdirs-html: $(mkinstalldirs) $(DESTDIR)$(htmldir) uninstall-html-monolithic: $(RM) $(DESTDIR)$(htmldir)/@PACKAGE@.html uninstall-html-split: $(RM) $(DESTDIR)$(htmldir)/@PACKAGE@_*.html # Documentation in Portable Document Format. TEXI2PDF = @TEXI2PDF@ SUFFIXES = .pdf .texinfo.pdf: TEXINPUTS=.:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2PDF) $< pdf: @PACKAGE@.pdf CLEANFILES = @PACKAGE@.pdf # --------------- Maintainer's Section MAINTAINERCLEANFILES = Makefile.in version.texi stamp.vti @PACKAGE@*.html indent-2.2.11/doc/indent.info0000644000177400010010000020403111331327560012676 00000000000000This is indent.info, produced by makeinfo version 4.13 from indent.texinfo. INFO-DIR-SECTION Indent Code Formatter START-INFO-DIR-ENTRY * Indent: (indent). C code formatter. END-INFO-DIR-ENTRY This is Edition 2.2.11 of `The `indent' Manual', for Indent Version 2.2.11, last updated 23 July 2008. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Copyright (C) 1995, 1996 Joseph Arceneaux. Copyright (C) 1999 Carlo Wood. Copyright (C) 2001 David Ingamells. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.  File: indent.info, Node: Top, Next: Indent Program, Prev: (dir), Up: (dir) `indent': Indent and Format C Program Source ********************************************* The `indent' program changes the appearance of a C program by inserting or deleting whitespace. This is Edition 2.2.11, 23 July 2008, of `The `indent' Manual', for Indent Version 2.2.11. * Menu: * Indent Program:: The `indent' Program * Option Summary:: Option Summary * Index:: Index  File: indent.info, Node: Indent Program, Next: Option Summary, Prev: Top, Up: Top 1 The `indent' Program ********************** The `indent' program can be used to make code easier to read. It can also convert from one style of writing C to another. `indent' understands a substantial amount about the syntax of C, but it also attempts to cope with incomplete and misformed syntax. In version 1.2 and more recent versions, the GNU style of indenting is the default. * Menu: * Invoking indent:: Invoking `indent' * Backup files:: Backup Files * Common styles:: Common styles * Blank lines:: Blank lines * Comments:: Comments * Statements:: Statements * Declarations:: Declarations * Indentation:: Indentation * Breaking long lines:: Breaking long lines * Disabling Formatting:: Disabling Formatting * Miscellaneous options:: Miscellaneous options * Bugs:: Bugs * Copyright:: Copyright  File: indent.info, Node: Invoking indent, Next: Backup files, Up: Indent Program 1.1 Invoking `indent' ===================== As of version 1.3, the format of the `indent' command is: indent [OPTIONS] [INPUT-FILES] indent [OPTIONS] [SINGLE-INPUT-FILE] [-o OUTPUT-FILE] This format is different from earlier versions and other versions of `indent'. In the first form, one or more input files are specified. `indent' makes a backup copy of each file, and the original file is replaced with its indented version. *Note Backup files::, for an explanation of how backups are made. In the second form, only one input file is specified. In this case, or when the standard input is used, you may specify an output file after the `-o' option. To cause `indent' to write to standard output, use the `-st' option. This is only allowed when there is only one input file, or when the standard input is used. If no input files are named, the standard input is read for input. Also, if a filename named `-' is specified, then the standard input is read. As an example, each of the following commands will input the program `slithy_toves.c' and write its indented text to `slithy_toves.out': indent slithy_toves.c -o slithy_toves.out indent -st slithy_toves.c > slithy_toves.out cat slithy_toves.c | indent -o slithy_toves.out Most other options to `indent' control how programs are formatted. As of version 1.2, `indent' also recognizes a long name for each option name. Long options are prefixed by either `--' or `+'. (1) In most of this document, the traditional, short names are used for the sake of brevity. *Note Option Summary::, for a list of options, including both long and short names. Here is another example: indent -br test/metabolism.c -l85 This will indent the program `test/metabolism.c' using the `-br' and `-l85' options, write the output back to `test/metabolism.c', and write the original contents of `test/metabolism.c' to a backup file in the directory `test'. Equivalent invocations using long option names for this example would be: indent --braces-on-if-line --line-length185 test/metabolism.c indent +braces-on-if-line +line-length185 test/metabolism.c If you find that you often use `indent' with the same options, you may put those options into a file named `.indent.pro'. `indent' will look for a profile file in three places. First it will check the environment variable `INDENT_PROFILE'. If that exists its value is expected to name the file that is to be used. If the environment variable does not exist, indent looks for `.indent.pro' in the current directory and use that if found. Finally `indent' will search your home directory for `.indent.pro' and use that file if it is found. This behaviour is different from that of other versions of `indent', which load both files if they both exist. The format of `.indent.pro' is simply a list of options, just as they would appear on the command line, separated by white space (tabs, spaces, and newlines). Options in `.indent.pro' may be surrounded by C or C++ comments, in which case they are ignored. Command line switches are handled _after_ processing `.indent.pro'. Options specified later override arguments specified earlier, with one exception: Explicitly specified options always override background options (*note Common styles::). You can prevent `indent' from reading an `.indent.pro' file by specifying the `-npro' option. ---------- Footnotes ---------- (1) `+' is being superseded by `--' to maintain consistency with the POSIX standard.  File: indent.info, Node: Backup files, Next: Common styles, Prev: Invoking indent, Up: Indent Program 1.2 Backup Files ================ As of version 1.3, GNU `indent' makes GNU-style backup files, the same way GNU Emacs does. This means that either "simple" or "numbered" backup filenames may be made. Simple backup file names are generated by appending a suffix to the original file name. The default for this suffix is the one-character string `~' (tilde). Thus, the backup file for `python.c' would be `python.c~'. Instead of the default, you may specify any string as a suffix by setting the environment variable `SIMPLE_BACKUP_SUFFIX' to your preferred suffix. Numbered backup versions of a file `momeraths.c' look like `momeraths.c.~23~', where 23 is the version of this particular backup. When making a numbered backup of the file `src/momeraths.c', the backup file will be named `src/momeraths.c.~V~', where V is one greater than the highest version currently existing in the directory `src'. The environment variable `VERSION_WIDTH' controls the number of digits, using left zero padding when necessary. For instance, setting this variable to "2" will lead to the backup file being named `momeraths.c.~04~'. The type of backup file made is controlled by the value of the environment variable `VERSION_CONTROL'. If it is the string `simple', then only simple backups will be made. If its value is the string `numbered', then numbered backups will be made. If its value is `numbered-existing', then numbered backups will be made if there _already exist_ numbered backups for the file being indented; otherwise, a simple backup is made. If `VERSION_CONTROL' is not set, then `indent' assumes the behaviour of `numbered-existing'. Other versions of `indent' use the suffix `.BAK' in naming backup files. This behaviour can be emulated by setting `SIMPLE_BACKUP_SUFFIX' to `.BAK'. Note also that other versions of `indent' make backups in the current directory, rather than in the directory of the source file as GNU `indent' now does.  File: indent.info, Node: Common styles, Next: Blank lines, Prev: Backup files, Up: Indent Program 1.3 Common styles ================= There are several common styles of C code, including the GNU style, the Kernighan & Ritchie style, and the original Berkeley style. A style may be selected with a single "background" option, which specifies a set of values for all other options. However, explicitly specified options always override options implied by a background option. As of version 1.2, the default style of GNU `indent' is the GNU style. Thus, it is no longer necessary to specify the option `-gnu' to obtain this format, although doing so will not cause an error. Option settings which correspond to the GNU style are: -nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2 -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob The GNU coding style is that preferred by the GNU project. It is the style that the GNU Emacs C mode encourages and which is used in the C portions of GNU Emacs. (People interested in writing programs for Project GNU should get a copy of `The GNU Coding Standards', which also covers semantic and portability issues such as memory usage, the size of integers, etc.) The Kernighan & Ritchie style is used throughout their well-known book `The C Programming Language'. It is enabled with the `-kr' option. The Kernighan & Ritchie style corresponds to the following set of options: -nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf -sai -saw -nsc -nsob -nss Kernighan & Ritchie style does not put comments to the right of code in the same column at all times (nor does it use only one space to the right of the code), so for this style `indent' has arbitrarily chosen column 33. The style of the original Berkeley `indent' may be obtained by specifying `-orig' (or by specifying `--original', using the long option name). This style is equivalent to the following settings: -nbad -nbap -bbo -bc -br -brs -c33 -cd33 -cdb -ce -ci4 -cli0 -cp33 -di16 -fc1 -fca -hnl -i4 -ip4 -l75 -lp -npcs -nprs -psl -saf -sai -saw -sc -nsob -nss -ts8 The Linux style is used in the linux kernel code and drivers. Code generally has to follow the Linux coding style to be accepted. This style is equivalent to the following settings: -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1  File: indent.info, Node: Blank lines, Next: Comments, Prev: Common styles, Up: Indent Program 1.4 Blank lines =============== Various programming styles use blank lines in different places. `indent' has a number of options to insert or delete blank lines in specific places. The `-bad' option causes `indent' to force a blank line after every block of declarations. The `-nbad' option causes `indent' not to force such blank lines. The `-bap' option forces a blank line after every procedure body. The `-nbap' option forces no such blank line. The `-bbb' option forces a blank line before every boxed comment (*Note Comments::.) The `-nbbb' option does not force such blank lines. The `-sob' option causes `indent' to swallow optional blank lines (that is, any optional blank lines present in the input will be removed from the output). If the `-nsob' is specified, any blank lines present in the input file will be copied to the output file. * Menu: * -bad:: More on the `-bad' option. * -bap:: More on the `-bap' option.  File: indent.info, Node: -bad, Next: -bap, Up: Blank lines 1.4.1 -blank-lines-after-declarations ------------------------------------- The `-bad' option forces a blank line after every block of declarations. The `-nbad' option does not add any such blank lines. For example, given the input char *foo; char *bar; /* This separates blocks of declarations. */ int baz; `indent -bad' produces char *foo; char *bar; /* This separates blocks of declarations. */ int baz; and `indent -nbad' produces char *foo; char *bar; /* This separates blocks of declarations. */ int baz;  File: indent.info, Node: -bap, Prev: -bad, Up: Blank lines 1.4.2 -blank-lines-after-procedures ----------------------------------- The `-bap' option forces a blank line after every procedure body. For example, given the input int foo () { puts("Hi"); } /* The procedure bar is even less interesting. */ char * bar () { puts("Hello"); } `indent -bap' produces int foo () { puts ("Hi"); } /* The procedure bar is even less interesting. */ char * bar () { puts ("Hello"); } and `indent -nbap' produces int foo () { puts ("Hi"); } /* The procedure bar is even less interesting. */ char * bar () { puts ("Hello"); } No blank line will be added after the procedure `foo'.  File: indent.info, Node: Comments, Next: Statements, Prev: Blank lines, Up: Indent Program 1.5 Comments ============ `indent' formats both C and C++ comments. C comments are begun with `/*', terminated with `*/' and may contain newline characters. C++ comments begin with the delimiter `//' and end at the newline. `indent' handles comments differently depending upon their context. `indent' attempts to distinguish between comments which follow statements, comments which follow declarations, comments following preprocessor directives, and comments which are not preceded by code of any sort, i.e., they begin the text of the line (although not necessarily in column 1). `indent' further distinguishes between comments found outside of procedures and aggregates, and those found within them. In particular, comments beginning a line found within a procedure will be indented to the column at which code is currently indented. The exception to this is a comment beginning in the leftmost column; such a comment is output at that column. `indent' attempts to leave "boxed comments" unmodified. The general idea of such a comment is that it is enclosed in a rectangle or "box" of stars or dashes to visually set it apart. More precisely, boxed comments are defined as those in which the initial `/*' is followed immediately by the character `*', `=', `_', or `-', or those in which the beginning comment delimiter (`/*') is on a line by itself, and the following line begins with a `*' in the same column as the star of the opening delimiter. Examples of boxed comments are: /********************** * Comment in a box!! * **********************/ /* * A different kind of scent, * for a different kind of comment. */ `indent' attempts to leave boxed comments exactly as they are found in the source file. Thus the indentation of the comment is unchanged, and its length is not checked in any way. The only alteration made is that an embedded tab character may be converted into the appropriate number of spaces. If the `-bbb' option is specified, all such boxed comments will be preceded by a blank line, unless such a comment is preceded by code. Comments which are not boxed comments may be formatted, which means that the line is broken to fit within a right margin and left-filled with whitespace. Single newlines are equivalent to a space, but blank lines (two or more newlines in a row) are taken to mean a paragraph break. Formatting of comments which begin after the first column is enabled with the `-fca' option. To format those beginning in column one, specify `-fc1'. Such formatting is disabled by default. The right margin for formatting defaults to 78, but may be changed with the `-lc' option. If the margin specified does not allow the comment to be printed, the margin will be automatically extended for the duration of that comment. The margin is not respected if the comment is not being formatted. If the comment begins a line (i.e., there is no program text to its left), it will be indented to the column it was found in unless the comment is within a block of code. In that case, such a comment will be aligned with the indented code of that block (unless the comment began in the first column). This alignment may be affected by the `-d' option, which specifies an amount by which such comments are moved to the _left_, or unindented. For example, `-d2' places comments two spaces to the left of code. By default, comments are aligned with code, unless they begin in the first column, in which case they are left there by default -- to get them aligned with the code, specify `-fc1'. Comments to the right of code will appear by default in column 33. This may be changed with one of three options. `-c' will specify the column for comments following code, `-cd' specifies the column for comments following declarations, and `-cp' specifies the column for comments following preprocessor directives `#else' and `#endif'. `-dj' together with `-cd0' can be used to suppress alignment of comments to the right of declarations, causing the comment to follow one tabstop from the end of the declaration. Normally `-cd0' causes `-c' to become effective. If the code to the left of the comment exceeds the beginning column, the comment column will be extended to the next tabstop column past the end of the code, or in the case of preprocessor directives, to one space past the end of the directive. This extension lasts only for the output of that particular comment. The `-cdb' option places the comment delimiters on blank lines. Thus, a single line comment like `/* Loving hug */' can be transformed into: /* Loving hug */ Stars can be placed at the beginning of multi-line comments with the `-sc' option. Thus, the single-line comment above can be transformed (with `-cdb -sc') into: /* * Loving hug */  File: indent.info, Node: Statements, Next: Declarations, Prev: Comments, Up: Indent Program 1.6 Statements ============== The `-br' or `-bl' option specifies how to format braces. The `-br' option formats statement braces like this: if (x > 0) { x--; } The `-bl' option formats them like this: if (x > 0) { x--; } If you use the `-bl' option, you may also want to specify the `-bli' option. This option specifies the number of spaces by which braces are indented. `-bli2', the default, gives the result shown above. `-bli0' results in the following: if (x > 0) { x--; } If you are using the `-br' option, you probably want to also use the `-ce' option. This causes the `else' in an if-then-else construct to cuddle up to the immediately preceding `}'. For example, with `-br -ce' you get the following: if (x > 0) { x--; } else { fprintf (stderr, "...something wrong?\n"); } With `-br -nce' that code would appear as if (x > 0) { x--; } else { fprintf (stderr, "...something wrong?\n"); } This causes the `while' in a do-while loop to cuddle up to the immediately preceding `}'. For example, with `-cdw' you get the following: do { x--; } while (x); With `-ncdw' that code would appear as do { x--; } while (x); The `-cli' option specifies the number of spaces that case labels should be indented to the right of the containing `switch' statement. The default gives code like: switch (i) { case 0: break; case 1: { ++i; } default: break; } Using the `-cli2' that would become: switch (i) { case 0: break; case 1: { ++i; } default: break; } The indentation of the braces below a case statement can be controlled with the `-cbiN' option. For example, using `-cli2 -cbi0' results in: switch (i) { case 0: break; case 1: { ++i; } default: break; } If a semicolon is on the same line as a `for' or `while' statement, the `-ss' option will cause a space to be placed before the semicolon. This emphasizes the semicolon, making it clear that the body of the `for' or `while' statement is an empty statement. `-nss' disables this feature. The `-pcs' option causes a space to be placed between the name of the procedure being called and the `(' (for example, `puts ("Hi");'. The `-npcs' option would give `puts("Hi");'). If the `-cs' option is specified, `indent' puts a space between a cast operator and the object to be cast. The `-ncs' ensures that there is no space between the cast operator and the object. Remember that `indent' only knows about the standard C data types and so cannot recognise user-defined types in casts. Thus `(mytype)thing' is not treated as a cast. The `-bs' option ensures that there is a space between the keyword `sizeof' and its argument. In some versions, this is known as the `Bill_Shannon' option. The `-saf' option forces a space between a `for' and the following parenthesis. This is the default. The `-sai' option forces a space between a `if' and the following parenthesis. This is the default. The `-saw' option forces a space between a `while' and the following parenthesis. This is the default. The `-prs' option causes all parentheses to be separated with a space from whatever is between them. For example, using `-prs' results in code like: while ( ( e_code - s_code ) < ( dec_ind - 1 ) ) { set_buf_break ( bb_dec_ind ); *e_code++ = ' '; }  File: indent.info, Node: Declarations, Next: Indentation, Prev: Statements, Up: Indent Program 1.7 Declarations ================ By default `indent' will line up identifiers, in the column specified by the `-di' option. For example, `-di16' makes things look like: int foo; char *bar; Using a small value (such as one or two) for the `-di' option can be used to cause the identifiers to be placed in the first available position; for example: int foo; char *bar; The value given to the `-di' option will still affect variables which are put on separate lines from their types, for example `-di2' will lead to: int foo; If the `-bc' option is specified, a newline is forced after each comma in a declaration. For example, int a, b, c; With the `-nbc' option this would look like int a, b, c; The `-bfda' option causes a newline to be forced after the comma separating the arguments of a function declaration. The arguments will appear at one indention level deeper than the function declaration. This is particularly helpful for functions with long argument lists. The option `-bfde' causes a newline to be forced before the closing bracket of the function declaration. For both options the 'n' setting is the default: -nbdfa and -nbdfe. For example, void foo (int arg1, char arg2, int *arg3, long arg4, char arg5); With the `-bfda' option this would look like void foo ( int arg1, char arg2, int *arg3, long arg4, char arg5); With, in addition, the `-bfde' option this would look like void foo ( int arg1, char arg2, int *arg3, long arg4, char arg5 ); The `-psl' option causes the type of a procedure being defined to be placed on the line before the name of the procedure. This style is required for the `etags' program to work correctly, as well as some of the `c-mode' functions of Emacs. You must use the `-T' option to tell `indent' the name of all the typenames in your program that are defined by `typedef'. `-T' can be specified more than once, and all names specified are used. For example, if your program contains typedef unsigned long CODE_ADDR; typedef enum {red, blue, green} COLOR; you would use the options `-T CODE_ADDR -T COLOR'. The `-brs' or `-bls' option specifies how to format braces in struct declarations. The `-brs' option formats braces like this: struct foo { int x; }; The `-bls' option formats them like this: struct foo { int x; }; Similarly to the structure brace `-brs' and `-bls' options, the function brace options `-brf' or `-blf' specify how to format the braces in function definitions. The `-brf' option formats braces like this: int one(void) { return 1; }; The `-blf' option formats them like this: int one(void) { return 1; };  File: indent.info, Node: Indentation, Next: Breaking long lines, Prev: Declarations, Up: Indent Program 1.8 Indentation =============== One issue in the formatting of code is how far each line should be indented from the left margin. When the beginning of a statement such as `if' or `for' is encountered, the indentation level is increased by the value specified by the `-i' option. For example, use `-i8' to specify an eight character indentation for each level. When a statement is broken across two lines, the second line is indented by a number of additional spaces specified by the `-ci' option. `-ci' defaults to 0. However, if the `-lp' option is specified, and a line has a left parenthesis which is not closed on that line, then continuation lines will be lined up to start at the character position just after the left parenthesis. This processing also applies to `[' and applies to `{' when it occurs in initialization lists. For example, a piece of continued code might look like this with `-nlp -ci3' in effect: p1 = first_procedure (second_procedure (p2, p3), third_procedure (p4, p5)); With `-lp' in effect the code looks somewhat clearer: p1 = first_procedure (second_procedure (p2, p3), third_procedure (p4, p5)); When a statement is broken in between two or more paren pairs (...), each extra pair causes the indentation level extra indentation: if ((((i < 2 && k > 0) || p == 0) && q == 1) || n = 0) The option `-ipN' can be used to set the extra offset per paren. For instance, `-ip0' would format the above as: if ((((i < 2 && k > 0) || p == 0) && q == 1) || n = 0) `indent' assumes that tabs are placed at regular intervals of both input and output character streams. These intervals are by default 8 columns wide, but (as of version 1.2) may be changed by the `-ts' option. Tabs are treated as the equivalent number of spaces. The indentation of type declarations in old-style function definitions is controlled by the `-ip' parameter. This is a numeric parameter specifying how many spaces to indent type declarations. For example, the default `-ip5' makes definitions look like this: char * create_world (x, y, scale) int x; int y; float scale; { . . . } For compatibility with other versions of indent, the option `-nip' is provided, which is equivalent to `-ip0'. ANSI C allows white space to be placed on preprocessor command lines between the character `#' and the command name. By default, `indent' removes this space, but specifying the `-lps' option directs `indent' to leave this space unmodified. The option `-ppi' overrides `-nlps' and `-lps'. This option can be used to request that preprocessor conditional statements can be indented by to given number of spaces, for example with the option `-ppi 3' #if X #if Y #define Z 1 #else #define Z 0 #endif #endif becomes #if X # if Y # define Z 1 # else # define Z 0 # endif #endif This option sets the offset at which a label (except case labels) will be positioned. If it is set to zero or a positive number, this indicates how far from the left margin to indent a label. If it is set to a negative number, this indicates how far back from the current indent level to place the label. The default setting is -2 which matches the behaviour of earlier versions of indent. Note that this parameter does not affect the placing of case labels; see the `-cli' parameter for that. For example with the option `-il 1' function() { if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; } becomes function() { if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; }  File: indent.info, Node: Breaking long lines, Next: Disabling Formatting, Prev: Indentation, Up: Indent Program 1.9 Breaking long lines ======================= With the option `-lN', or `--line-lengthN', it is possible to specify the maximum length of a line of C code, not including possible comments that follow it. When lines become longer than the specified line length, GNU `indent' tries to break the line at a logical place. This is new as of version 2.1 however and not very intelligent or flexible yet. Currently there are two options that allow one to interfere with the algorithm that determines where to break a line. The `-bbo' option causes GNU `indent' to prefer to break long lines before the boolean operators `&&' and `||'. The `-nbbo' option causes GNU `indent' not have that preference. For example, the default option `-bbo' (together with `--line-length60' and `--ignore-newlines') makes code look like this: if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) Using the option `-nbbo' will make it look like this: if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) The default `-hnl', however, honours newlines in the input file by giving them the highest possible priority to break lines at. For example, when the input file looks like this: if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) then using the option `-hnl', or `--honour-newlines', together with the previously mentioned `-nbbo' and `--line-length60', will cause the output not to be what is given in the last example but instead will prefer to break at the positions where the code was broken in the input file: if (mask && ((mask[0] == '\0') || (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*'))))) The idea behind this option is that lines which are too long, but are already broken up, will not be touched by GNU `indent'. Really messy code should be run through `indent' at least once using the `--ignore-newlines' option though.  File: indent.info, Node: Disabling Formatting, Next: Miscellaneous options, Prev: Breaking long lines, Up: Indent Program 1.10 Disabling Formatting ========================= Formatting of C code may be disabled for portions of a program by embedding special "control comments" in the program. To turn off formatting for a section of a program, place the disabling control comment `/* *INDENT-OFF* */' on a line by itself just before that section. Program text scanned after this control comment is output precisely as input with no modifications until the corresponding enabling comment is scanned on a line by itself. The disabling control comment is `/* *INDENT-ON* */', and any text following the comment on the line is also output unformatted. Formatting begins again with the input line following the enabling control comment. More precisely, `indent' does not attempt to verify the closing delimiter (`*/') for these C comments, and any whitespace on the line is totally transparent. These control comments also function in their C++ formats, namely `// *INDENT-OFF*' and `// *INDENT-ON*'. It should be noted that the internal state of `indent' remains unchanged over the course of the unformatted section. Thus, for example, turning off formatting in the middle of a function and continuing it after the end of the function may lead to bizarre results. It is therefore wise to be somewhat modular in selecting code to be left unformatted. As a historical note, some earlier versions of `indent' produced error messages beginning with `*INDENT**'. These versions of `indent' were written to ignore any input text lines which began with such error messages. I have removed this incestuous feature from GNU `indent'.  File: indent.info, Node: Miscellaneous options, Next: Bugs, Prev: Disabling Formatting, Up: Indent Program 1.11 Miscellaneous options ========================== To find out what version of `indent' you have, use the command `indent -version'. This will report the version number of `indent', without doing any of the normal processing. The `-v' option can be used to turn on verbose mode. When in verbose mode, `indent' reports when it splits one line of input into two more more lines of output, and gives some size statistics at completion. The `-pmt' option causes `indent' to preserve the access and modification times on the output files. Using this option has the advantage that running indent on all source and header files in a project won't cause `make' to rebuild all targets. This option is only available on Operating Systems that have the POSIX `utime(2)' function.  File: indent.info, Node: Bugs, Next: Copyright, Prev: Miscellaneous options, Up: Indent Program 1.12 Bugs ========= Please report any bugs to . When `indent' is run twice on a file, with the same profile, it should _never_ change that file the second time. With the current design of `indent', this can not be guaranteed, and it has not been extensively tested. `indent' does not understand C. In some cases this leads to the inability to join lines. The result is that running a file through `indent' is _irreversible_, even if the used input file was the result of running `indent' with a given profile (`.indent.pro'). While an attempt was made to get `indent' working for C++, it will not do a good job on any C++ source except the very simplest. `indent' does not look at the given `--line-length' option when writing comments to the output file. This results often in comments being put far to the right. In order to prohibit `indent' from joining a broken line that has a comment at the end, make sure that the comments start on the first line of the break. `indent' does not count lines and comments (see the `-v' option) when `indent' is turned off with `/* *INDENT-OFF* */'. Comments of the form `/*UPPERCASE*/' are not treated as comment but as an identifier, causing them to be joined with the next line. This renders comments of this type useless, unless they are embedded in the code to begin with.  File: indent.info, Node: Copyright, Prev: Bugs, Up: Indent Program 1.13 Copyright ============== The following copyright notice applies to the `indent' program. The copyright and copying permissions for this manual appear near the beginning of `indent.texinfo' and `indent.info', and near the end of `indent.1'. Copyright (C) 2001 David Ingamells. Copyright (C) 1999 Carlo Wood. Copyright (C) 1995, 1996 Joseph Arceneaux. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation Copyright (C) 1985 Sun Microsystems, Inc. Copyright (C) 1980 The Regents of the University of California. Copyright (C) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.  File: indent.info, Node: Option Summary, Next: Index, Prev: Indent Program, Up: Top Appendix A Option Summary ************************* Here is a list of all the options for `indent', alphabetized by short option. It is followed by a cross key alphabetized by long option. `-bad' `--blank-lines-after-declarations' Force blank lines after the declarations. *Note Blank lines::. `-bap' `--blank-lines-after-procedures' Force blank lines after procedure bodies. *Note Blank lines::. `-bbb' `--blank-lines-before-block-comments' Force blank lines before block comments. *Note Blank lines::. `-bbo' `--break-before-boolean-operator' Prefer to break long lines before boolean operators. *Note Breaking long lines::. `-bc' `--blank-lines-after-commas' Force newline after comma in declaration. *Note Declarations::. `-bl' `--braces-after-if-line' Put braces on line after `if', etc. *Note Statements::. `-blf' `--braces-after-func-def-line' Put braces on line following function definition line. *Note Declarations::. `-bliN' `--brace-indentN' Indent braces N spaces. *Note Statements::. `-bls' `--braces-after-struct-decl-line' Put braces on the line after `struct' declaration lines. *Note Declarations::. `-br' `--braces-on-if-line' Put braces on line with `if', etc. *Note Statements::. `-brf' `--braces-on-func-def-line' Put braces on function definition line. *Note Declarations::. `-brs' `--braces-on-struct-decl-line' Put braces on `struct' declaration line. *Note Declarations::. `-bs' `--Bill-Shannon' `--blank-before-sizeof' Put a space between `sizeof' and its argument. *Note Statements::. `-cN' `--comment-indentationN' Put comments to the right of code in column N. *Note Comments::. `-cbiN' `--case-brace-indentationN' Indent braces after a case label N spaces. *Note Statements::. `-cdN' `--declaration-comment-columnN' Put comments to the right of the declarations in column N. *Note Comments::. `-cdb' `--comment-delimiters-on-blank-lines' Put comment delimiters on blank lines. *Note Comments::. `-cdw' `--cuddle-do-while' Cuddle while of `do {} while;' and preceding `}'. *Note Comments::. `-ce' `--cuddle-else' Cuddle else and preceding `}'. *Note Comments::. `-ciN' `--continuation-indentationN' Continuation indent of N spaces. *Note Statements::. `-cliN' `--case-indentationN' Case label indent of N spaces. *Note Statements::. `-cpN' `--else-endif-columnN' Put comments to the right of `#else' and `#endif' statements in column N. *Note Comments::. `-cs' `--space-after-cast' Put a space after a cast operator. *Note Statements::. `-dN' `--line-comments-indentationN' Set indentation of comments not to the right of code to N spaces. *Note Comments::. `-bfda' `--break-function-decl-args' Break the line before all arguments in a declaration. *Note Declarations::. `-bfde' `--break-function-decl-args-end' Break the line after the last argument in a declaration. *Note Declarations::. `-djN' `--left-justify-declarations' If -cd 0 is used then comments after declarations are left justified behind the declaration. *Note Declarations::. `-diN' `--declaration-indentationN' Put variables in column N. *Note Declarations::. `-fc1' `--format-first-column-comments' Format comments in the first column. *Note Comments::. `-fca' `--format-all-comments' Do not disable all formatting of comments. *Note Comments::. `-gnu' `--gnu-style' Use GNU coding style. This is the default. *Note Common styles::. `-hnl' `--honour-newlines' Prefer to break long lines at the position of newlines in the input. *Note Breaking long lines::. `-iN' `--indent-levelN' Set indentation level to N spaces. *Note Indentation::. `-ilN' `--indent-labelN' Set offset for labels to column N. *Note Indentation::. `-ipN' `--parameter-indentationN' Indent parameter types in old-style function definitions by N spaces. *Note Indentation::. `-kr' `--k-and-r-style' Use Kernighan & Ritchie coding style. *Note Common styles::. `-lN' `--line-lengthN' Set maximum line length for non-comment lines to N. *Note Breaking long lines::. `-lcN' `--comment-line-lengthN' Set maximum line length for comment formatting to N. *Note Comments::. `-linux' `--linux-style' Use Linux coding style. *Note Common styles::. `-lp' `--continue-at-parentheses' Line up continued lines at parentheses. *Note Indentation::. `-lps' `--leave-preprocessor-space' Leave space between `#' and preprocessor directive. *Note Indentation::. `-nbad' `--no-blank-lines-after-declarations' Do not force blank lines after declarations. *Note Blank lines::. `-nbap' `--no-blank-lines-after-procedures' Do not force blank lines after procedure bodies. *Note Blank lines::. `-nbbo' `--break-after-boolean-operator' Do not prefer to break long lines before boolean operators. *Note Breaking long lines::. `-nbc' `--no-blank-lines-after-commas' Do not force newlines after commas in declarations. *Note Declarations::. `-nbfda' `--dont-break-function-decl-args' Don't put each argument in a function declaration on a separate line. *Note Declarations::. `-ncdb' `--no-comment-delimiters-on-blank-lines' Do not put comment delimiters on blank lines. *Note Comments::. `-ncdw' `--dont-cuddle-do-while' Do not cuddle `}' and the `while' of a `do {} while;'. *Note Statements::. `-nce' `--dont-cuddle-else' Do not cuddle `}' and `else'. *Note Statements::. `-ncs' `--no-space-after-casts' Do not put a space after cast operators. *Note Statements::. `-ndjN' `--dont-left-justify-declarations' Comments after declarations are treated the same as comments after other statements. *Note Declarations::. `-nfc1' `--dont-format-first-column-comments' Do not format comments in the first column as normal. *Note Comments::. `-nfca' `--dont-format-comments' Do not format any comments. *Note Comments::. `-nhnl' `--ignore-newlines' Do not prefer to break long lines at the position of newlines in the input. *Note Breaking long lines::. `-nip' `--no-parameter-indentation' Zero width indentation for parameters. *Note Indentation::. `-nlp' `--dont-line-up-parentheses' Do not line up parentheses. *Note Statements::. `-npcs' `--no-space-after-function-call-names' Do not put space after the function in function calls. *Note Statements::. `-nprs' `--no-space-after-parentheses' Do not put a space after every '(' and before every ')'. *Note Statements::. `-npsl' `--dont-break-procedure-type' Put the type of a procedure on the same line as its name. *Note Declarations::. `-nsaf' `--no-space-after-for' Do not put a space after every `for'. *Note Statements::. `-nsai' `--no-space-after-if' Do not put a space after every `if'. *Note Statements::. `-nsaw' `--no-space-after-while' Do not put a space after every `while'. *Note Statements::. `-nsc' `--dont-star-comments' Do not put the `*' character at the left of comments. *Note Comments::. `-nsob' `--leave-optional-blank-lines' Do not swallow optional blank lines. *Note Blank lines::. `-nss' `--dont-space-special-semicolon' Do not force a space before the semicolon after certain statements. Disables `-ss'. *Note Statements::. `-nut' `--no-tabs' Use spaces instead of tabs. *Note Indentation::. `-nv' `--no-verbosity' Disable verbose mode. *Note Miscellaneous options::. `-orig' `--original' Use the original Berkeley coding style. *Note Common styles::. `-npro' `--ignore-profile' Do not read `.indent.pro' files. *Note Invoking indent::. `-pcs' `--space-after-procedure-calls' Insert a space between the name of the procedure being called and the `('. *Note Statements::. `-piN' `--paren-indentationN' Specify the extra indentation per open parentheses '(' when a statement is broken. *Note Statements::. `-pmt' `--preserve-mtime' Preserve access and modification times on output files. *Note Miscellaneous options::. `-ppiN' `--preprocessor-indentationN' Specify the indentation for preprocessor conditional statements. *Note Indentation::. `-prs' `--space-after-parentheses' Put a space after every '(' and before every ')'. *Note Statements::. `-psl' `--procnames-start-lines' Put the type of a procedure on the line before its name. *Note Declarations::. `-saf' `--space-after-for' Put a space after each `for'. *Note Statements::. `-sai' `--space-after-if' Put a space after each `if'. *Note Statements::. `-saw' `--space-after-while' Put a space after each `while'. *Note Statements::. `-sbiN' `--struct-brace-indentationN' Indent braces of a struct, union or enum N spaces. *Note Statements::. `-sc' `--start-left-side-of-comments' Put the `*' character at the left of comments. *Note Comments::. `-sob' `--swallow-optional-blank-lines' Swallow optional blank lines. *Note Blank lines::. `-ss' `--space-special-semicolon' On one-line `for' and `while' statements, force a blank before the semicolon. *Note Statements::. `-st' `--standard-output' Write to standard output. *Note Invoking indent::. `-T' Tell `indent' the name of typenames. *Note Declarations::. `-tsN' `--tab-sizeN' Set tab size to N spaces. *Note Indentation::. `-ut' `--use-tabs' Use tabs. This is the default. *Note Indentation::. `-v' `--verbose' Enable verbose mode. *Note Miscellaneous options::. `-version' Output the version number of `indent'. *Note Miscellaneous options::. Options' Cross Key ------------------ Here is a list of options alphabetized by long option, to help you find the corresponding short option. --blank-lines-after-commas -bc --blank-lines-after-declarations -bad --blank-lines-after-procedures -bap --blank-lines-before-block-comments -bbb --braces-after-if-line -bl --braces-after-func-def-line -blf --brace-indent -bli --braces-after-struct-decl-line -bls --braces-on-if-line -br --braces-on-func-def-line -brf --braces-on-struct-decl-line -brs --break-after-boolean-operator -nbbo --break-before-boolean-operator -bbo --break-function-decl-args -bfda --break-function-decl-args-end -bfde --case-indentation -cliN --case-brace-indentation -cbiN --comment-delimiters-on-blank-lines -cdb --comment-indentation -cN --continuation-indentation -ciN --continue-at-parentheses -lp --cuddle-do-while -cdw --cuddle-else -ce --declaration-comment-column -cdN --declaration-indentation -diN --dont-break-function-decl-args -nbfda --dont-break-function-decl-args-end -nbfde --dont-break-procedure-type -npsl --dont-cuddle-do-while -ncdw --dont-cuddle-else -nce --dont-format-comments -nfca --dont-format-first-column-comments -nfc1 --dont-line-up-parentheses -nlp --dont-left-justify-declarations -ndj --dont-space-special-semicolon -nss --dont-star-comments -nsc --else-endif-column -cpN --format-all-comments -fca --format-first-column-comments -fc1 --gnu-style -gnu --honour-newlines -hnl --ignore-newlines -nhnl --ignore-profile -npro --indent-label -ilN --indent-level -iN --k-and-r-style -kr --leave-optional-blank-lines -nsob --leave-preprocessor-space -lps --left-justify-declarations -dj --line-comments-indentation -dN --line-length -lN --linux-style -linux --no-blank-lines-after-commas -nbc --no-blank-lines-after-declarations -nbad --no-blank-lines-after-procedures -nbap --no-blank-lines-before-block-comments -nbbb --no-comment-delimiters-on-blank-lines -ncdb --no-space-after-casts -ncs --no-parameter-indentation -nip --no-space-after-for -nsaf --no-space-after-function-call-names -npcs --no-space-after-if -nsai --no-space-after-parentheses -nprs --no-space-after-while -nsaw --no-tabs -nut --no-verbosity -nv --original -orig --parameter-indentation -ipN --paren-indentation -piN --preserve-mtime -pmt --preprocessor-indentation -ppiN --procnames-start-lines -psl --space-after-cast -cs --space-after-for -saf --space-after-if -sai --space-after-parentheses -prs --space-after-procedure-calls -pcs --space-after-while -saw --space-special-semicolon -ss --standard-output -st --start-left-side-of-comments -sc --struct-brace-indentation -sbiN --swallow-optional-blank-lines -sob --tab-size -tsN --use-tabs -ut --verbose -v  File: indent.info, Node: Index, Prev: Option Summary, Up: Top Index ***** [index] * Menu: * --blank-after-sizeof: Statements. (line 130) * --blank-lines-after-commas: Declarations. (line 26) * --blank-lines-after-declarations: -bad. (line 15) * --blank-lines-after-procedures: -bap. (line 6) * --blank-lines-before-block-comments: Blank lines. (line 17) * --brace-indentN: Statements. (line 21) * --braces-after-func-def-line: Declarations. (line 96) * --braces-after-if-line: Statements. (line 6) * --braces-after-struct-decl-line: Declarations. (line 82) * --braces-on-func-def-line: Declarations. (line 96) * --braces-on-if-line: Statements. (line 6) * --braces-on-struct-decl-line: Declarations. (line 82) * --break-after-boolean-operator: Breaking long lines. (line 14) * --break-before-boolean-operator: Breaking long lines. (line 14) * --break-function-decl-args: Declarations. (line 37) * --break-function-decl-args-end: Declarations. (line 37) * --case-brace-indentationN: Statements. (line 97) * --case-indentationN: Statements. (line 66) * --comment-delimiters-on-blank-lines: Comments. (line 94) * --comment-indentationN: Comments. (line 78) * --continuation-indentationN: Indentation. (line 6) * --continue-at-parentheses: Indentation. (line 6) * --cuddle-do-while: Statements. (line 51) * --cuddle-else: Statements. (line 31) * --declaration-comment-columnN: Comments. (line 78) * --declaration-indentationN: Declarations. (line 6) * --dont-break-function-decl-args: Declarations. (line 37) * --dont-break-function-decl-args-end: Declarations. (line 37) * --dont-break-procedure-type: Declarations. (line 67) * --dont-cuddle-do-while: Statements. (line 51) * --dont-cuddle-else: Statements. (line 31) * --dont-format-comments: Comments. (line 53) * --dont-format-first-column-comments: Comments. (line 53) * --dont-left-justify-declarations: Comments. (line 78) * --dont-line-up-parentheses: Indentation. (line 6) * --dont-space-special-semicolon: Statements. (line 113) * --dont-star-comments: Comments. (line 102) * --else-endif-columnN: Comments. (line 78) * --format-all-comments: Comments. (line 53) * --format-first-column-comments: Comments. (line 53) * --gnu-style: Common styles. (line 12) * --honour-newlines: Breaking long lines. (line 14) * --ignore-newlines: Breaking long lines. (line 14) * --ignore-profile: Invoking indent. (line 67) * --indent-labelN: Indentation. (line 93) * --indent-levelN: Indentation. (line 6) * --k-and-r-style: Common styles. (line 28) * --leave-optional-blank-lines: Blank lines. (line 20) * --leave-preprocessor-space: Indentation. (line 67) * --left-justify-declarations: Comments. (line 78) * --line-comments-indentationN: Comments. (line 67) * --line-lengthN: Breaking long lines. (line 6) * --linux-style: Common styles. (line 50) * --no-blank-lines-after-commas: Declarations. (line 26) * --no-blank-lines-after-declarations: -bad. (line 15) * --no-blank-lines-after-procedures: -bap. (line 6) * --no-blank-lines-before-block-comments: Blank lines. (line 17) * --no-comment-delimiters-on-blank-lines: Comments. (line 94) * --no-parameter-indentation: Indentation. (line 50) * --no-space-after-cast: Statements. (line 123) * --no-space-after-for: Statements. (line 134) * --no-space-after-function-call-names: Statements. (line 119) * --no-space-after-if: Statements. (line 137) * --no-space-after-while: Statements. (line 140) * --no-verbosity: Miscellaneous options. (line 10) * --original: Common styles. (line 42) * --output-file: Invoking indent. (line 21) * --parameter-indentationN: Indentation. (line 50) * --preprocessor-indentationN: Indentation. (line 73) * --preserve-mtime: Miscellaneous options. (line 15) * --procnames-start-lines: Declarations. (line 67) * --remove-preprocessor-space: Indentation. (line 67) * --space-after-cast: Statements. (line 123) * --space-after-for: Statements. (line 134) * --space-after-if: Statements. (line 137) * --space-after-parentheses: Statements. (line 143) * --space-after-procedure-calls: Statements. (line 119) * --space-after-while: Statements. (line 140) * --space-special-semicolon: Statements. (line 113) * --standard-output: Invoking indent. (line 25) * --star-left-side-of-comments: Comments. (line 102) * --swallow-optional-blank-lines: Blank lines. (line 20) * --tab-sizeN: Indentation. (line 29) * --verbose: Miscellaneous options. (line 10) * -bad: -bad. (line 15) * -bap: -bap. (line 6) * -bbb: Blank lines. (line 17) * -bbo: Breaking long lines. (line 14) * -bc: Declarations. (line 26) * -bfda: Declarations. (line 37) * -bfde: Declarations. (line 37) * -bl: Statements. (line 6) * -blf: Declarations. (line 96) * -bliN: Statements. (line 21) * -bls: Declarations. (line 82) * -br: Statements. (line 6) * -brs: Declarations. (line 82) * -bs: Statements. (line 130) * -cbiN: Statements. (line 97) * -cdb: Comments. (line 94) * -cdN: Comments. (line 78) * -cdw: Statements. (line 51) * -ce: Statements. (line 31) * -ciN: Indentation. (line 6) * -cliN: Statements. (line 66) * -cN: Comments. (line 78) * -cpN: Comments. (line 78) * -cs: Statements. (line 123) * -dce: Statements. (line 31) * -diN: Declarations. (line 6) * -dj: Comments. (line 78) * -dN: Comments. (line 67) * -fc1: Comments. (line 53) * -fca: Comments. (line 53) * -gnu: Common styles. (line 12) * -hnl: Breaking long lines. (line 14) * -ilN: Indentation. (line 93) * -iN: Indentation. (line 6) * -ipN: Indentation. (line 50) * -kr: Common styles. (line 28) * -linux: Common styles. (line 50) * -lN: Breaking long lines. (line 6) * -lp: Indentation. (line 6) * -lps: Indentation. (line 67) * -nbad: -bad. (line 15) * -nbap: -bap. (line 6) * -nbbb: Blank lines. (line 17) * -nbbo: Breaking long lines. (line 14) * -nbc: Declarations. (line 26) * -nbfda: Declarations. (line 37) * -nbfde: Declarations. (line 37) * -ncdb: Comments. (line 94) * -ncdw: Statements. (line 51) * -ncs: Statements. (line 123) * -ndj: Comments. (line 78) * -nfc1: Comments. (line 53) * -nfca: Comments. (line 53) * -nhnl: Breaking long lines. (line 14) * -nip: Indentation. (line 50) * -nlp: Indentation. (line 6) * -nlps: Indentation. (line 67) * -npcs: Statements. (line 119) * -npmt: Miscellaneous options. (line 15) * -npro: Invoking indent. (line 67) * -npsl: Declarations. (line 67) * -nsaf: Statements. (line 134) * -nsai: Statements. (line 137) * -nsaw: Statements. (line 140) * -nsc: Comments. (line 102) * -nsob: Blank lines. (line 20) * -nss: Statements. (line 113) * -nv: Miscellaneous options. (line 10) * -o: Invoking indent. (line 21) * -orig: Common styles. (line 42) * -pcs: Statements. (line 119) * -pmt: Miscellaneous options. (line 15) * -ppiN: Indentation. (line 73) * -prs: Statements. (line 143) * -psl: Declarations. (line 67) * -saf: Statements. (line 134) * -sai: Statements. (line 137) * -saw: Statements. (line 140) * -sc: Comments. (line 102) * -sob: Blank lines. (line 20) * -ss: Statements. (line 113) * -st: Invoking indent. (line 25) * -T: Declarations. (line 72) * -tsN: Indentation. (line 29) * -v: Miscellaneous options. (line 10) * -version: Miscellaneous options. (line 6) * .indent.pro file: Invoking indent. (line 67) * backup files: Backup files. (line 6) * Beginning indent: Invoking indent. (line 6) * Berkeley style: Common styles. (line 42) * Blank lines: Blank lines. (line 6) * Comments: Comments. (line 6) * etags requires -psl: Declarations. (line 67) * GNU style: Common styles. (line 12) * Initialization file: Invoking indent. (line 67) * Invoking indent: Invoking indent. (line 6) * Kernighan & Ritchie style: Common styles. (line 28) * Linux style: Common styles. (line 50) * Long options, use of: Invoking indent. (line 43) * Original Berkeley style: Common styles. (line 42) * Output File Specification: Invoking indent. (line 21) * Standard Output: Invoking indent. (line 25) * Starting indent: Invoking indent. (line 6) * typedef: Declarations. (line 72) * Typenames: Declarations. (line 72) * Using Standard Input: Invoking indent. (line 29)  Tag Table: Node: Top666 Node: Indent Program1181 Node: Invoking indent2262 Ref: Invoking indent-Footnote-15823 Node: Backup files5913 Node: Common styles7997 Node: Blank lines10640 Node: -bad11739 Node: -bap12390 Node: Comments13255 Node: Statements18268 Node: Declarations22145 Node: Indentation25169 Node: Breaking long lines29468 Node: Disabling Formatting31753 Node: Miscellaneous options33507 Node: Bugs34407 Node: Copyright35878 Node: Option Summary37460 Node: Index52607  End Tag Table indent-2.2.11/doc/Makefile.in0000644000177400010010000005606111331327361012614 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/stamp-vti $(srcdir)/version.texi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/aclocal/UTIMBUF.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intdiv0.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/indent.info TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/config DVIS = indent.dvi PDFS = indent.pdf PSS = indent.ps HTMLS = indent.html TEXINFOS = indent.texinfo TEXI2DVI = texi2dvi MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) am__installdirs = "$(DESTDIR)$(infodir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = env LANG= LANGUAGE= @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEXI2HTML = @TEXI2HTML@ # Documentation in Portable Document Format. TEXI2PDF = @TEXI2PDF@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = $(prefix)/doc/@PACKAGE@ dvidir = $(docdir) exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = $(docdir) includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = $(docdir) prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = $(docdir) sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ info_TEXINFOS = indent.texinfo HTMLSTYLE = monolithic AUTOMAKE_OPTIONS = 1.2 gnits #EXTRA_DIST = @PACKAGE@.html SED = sed RM = rm -f SUFFIXES = .pdf CLEANFILES = @PACKAGE@.pdf # --------------- Maintainer's Section MAINTAINERCLEANFILES = Makefile.in version.texi stamp.vti @PACKAGE@*.html all: all-am .SUFFIXES: .SUFFIXES: .pdf .dvi .html .info .ps .texinfo $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnits doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): .texinfo.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texinfo.dvi: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $< .texinfo.html: rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ else \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi $(srcdir)/indent.info: indent.texinfo $(srcdir)/version.texi indent.dvi: indent.texinfo $(srcdir)/version.texi indent.pdf: indent.texinfo $(srcdir)/version.texi indent.html: indent.texinfo $(srcdir)/version.texi $(srcdir)/version.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/stamp-vti $(srcdir)/stamp-vti: indent.texinfo $(top_srcdir)/configure @(dir=.; test -f ./indent.texinfo || dir=$(srcdir); \ set `$(SHELL) $(top_srcdir)/config/mdate-sh $$dir/indent.texinfo`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp @cmp -s vti.tmp $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi"; \ cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: @MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && \ (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf indent.aux indent.cp indent.fn indent.fns indent.ky indent.kys \ indent.log indent.pg indent.pgs indent.tmp indent.toc \ indent.tp indent.tps indent.vr indent.vrs clean-aminfo: -test -z "indent.dvi indent.pdf indent.ps indent.html" \ || rm -rf indent.dvi indent.pdf indent.ps indent.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) all-local installdirs: installdirs-local for dir in "$(DESTDIR)$(infodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-aminfo clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-data-local install-info-am install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-html-am: $(HTMLS) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ if test -d "$$d$$p"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d$$p"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-local uninstall-pdf-am uninstall-ps-am .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-aminfo \ clean-generic dist-info distclean distclean-generic distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-local maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-dvi-am \ uninstall-html-am uninstall-info-am uninstall-local \ uninstall-pdf-am uninstall-ps-am all-local: html install-data-local: install-html installdirs-local: installdirs-html uninstall-local: uninstall-html html: html-$(HTMLSTYLE) install-html: install-html-$(HTMLSTYLE) uninstall-html: uninstall-html-$(HTMLSTYLE) # BUILT_SOURCES = @PACKAGE@.1 @PACKAGE@.html @PACKAGE@_toc.html html-monolithic: @PACKAGE@.html html-split: @PACKAGE@_toc.html @PACKAGE@.html: version.texi $(@PACKAGE@_TEXINFOS) $(TEXI2HTML) -expandinfo -number -monolithic `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` @PACKAGE@_toc.html: version.texi $(@PACKAGE@_TEXINFOS) case "$(TEXI2HTML)" in \ *"/missing texi2html") \ $(TEXI2HTML) -expand info -number -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` || exit 0 ;; \ *) $(RM) @PACKAGE@_*.html ; \ $(TEXI2HTML) -expand info -number -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` ;; \ esac install-html-monolithic: @PACKAGE@.html $(mkinstalldirs) $(DESTDIR)$(htmldir) $(INSTALL_DATA) `if test -f @PACKAGE@.html; then echo .; else echo $(srcdir); fi`/@PACKAGE@.html $(DESTDIR)$(htmldir)/@PACKAGE@.html install-html-split: @PACKAGE@_toc.html $(mkinstalldirs) $(DESTDIR)$(htmldir) for file in `if test -f @PACKAGE@_toc.html; then echo .; else echo $(srcdir); fi`/@PACKAGE@*.html; do \ $(INSTALL_DATA) $$file $(DESTDIR)$(htmldir)/`basename $$file`; \ done installdirs-html: $(mkinstalldirs) $(DESTDIR)$(htmldir) uninstall-html-monolithic: $(RM) $(DESTDIR)$(htmldir)/@PACKAGE@.html uninstall-html-split: $(RM) $(DESTDIR)$(htmldir)/@PACKAGE@_*.html .texinfo.pdf: TEXINPUTS=.:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2PDF) $< pdf: @PACKAGE@.pdf # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: indent-2.2.11/README0000644000177400010010000000641211331327557010664 00000000000000README for GNU `indent' 2.2.11. GNU indent changes the appearance of a C program by inserting or deleting whitespace according to a plethora of options. Some canned styles of formatting are supported as well. GNU indent is a descendant of BSD indent. This file is part of the GNU indent distribution. GNU indent does NOT work for C++, if it does for you then you're just lucky. Don't ask for support for C++. Read the file NEWS for more information, especially to see what's different from the last version, and what future versions may do. To install indent, please read the file INSTALL included with the distribution. If you are installing indent on VMS, see the file miscel/README.VMS. For VMS and other platforms there is a variety of files in the directory miscel that may be of use. Move the files that may be of use to the src directory before use. For license and copying information, see the file COPYING. DOCUMENTATION For complete documentation on the Web, please visit: http://indent.isidore-it.eu/beautify.html GNU uses a language called "texinfo" for its documentation source which produces both an on-line, interactive version and a hardcopy version for printing. An HTML version is now produced as well. The on-line versions, `indent.info' and `indent.1', are installed along with the executable by typing "make install". Refer to the Texinfo manual for more information on the `info' system. The hardcopy version is produced from the source file `indent.texinfo' in a pdf or Postscript format file. To produce the pdf version type: make pdf To produce the Postscript version, type: make ps Note that you must have the TeX typographical system installed for this to work. The HTML version is included along with the distribution, and consists of the file: doc/indent.html This file can also be accessed at the URL http://indent.isidore-it.eu/indent.html To create the HTML version from the texinfo version, type: make html Obviously you will need the texi2html tool. BUG REPORTS Please address bug-reports and suggestions or comments to: bug-indent@gnu.org How to report bugs: Please begin your bug report with a concise and factual description of the behaviour you consider to be abberant. If you have narrowed the problem down to the use of a particular option, please mention that. In general, also be sure to mention the command line options used to invoke indent, as well as the contents of your .indent.pro if you are using one. Then include the *smallest possible* piece of code which generates the described symptom. It is very helpful if you can manage to reduce the size of the sample code. Finally, if you have investigated the problem further, include debugger stack traces, modifications, or speculation you have. SENDING CODE If you send a patch as part of your bug fix, or send me code for new features, please send them as diffs. In particular, send me the result of "diff -c ". Because of the regression testing I require of indent, it is extremely unlikely that your code will be installed into indent "as-is"; however it may still be helpful, and will likely have solved your particular problem. indent-2.2.11/config/0000777000177400010010000000000011331331065011317 500000000000000indent-2.2.11/config/mdate-sh0000755000177400010010000001275111270443577012707 00000000000000#!/bin/sh # Get modification time of a file or directory and pretty-print it. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009 Free # Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No file. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: mdate-sh [--help] [--version] FILE Pretty-print the modification time of FILE. Report bugs to . EOF exit $? ;; -v | --v*) echo "mdate-sh $scriptversion" exit $? ;; esac # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # GNU ls changes its time format in response to the TIME_STYLE # variable. Since we cannot assume `unset' works, revert this # variable to its documented default. if test "${TIME_STYLE+set}" = set; then TIME_STYLE=posix-long-iso export TIME_STYLE fi save_arg1=$1 # Find out how to get the extended ls output of a file or directory. if ls -L /dev/null 1>/dev/null 2>&1; then ls_command='ls -L -l -d' else ls_command='ls -l -d' fi # Avoid user/group names that might have spaces, when possible. if ls -n /dev/null 1>/dev/null 2>&1; then ls_command="$ls_command -n" fi # A `ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo # This differs from Unix, which adds ownership information. # drwxrwx--- 2 root root 4096 Aug 11 2001 foo # # To find the date, we split the line on spaces and iterate on words # until we find a month. This cannot work with files whose owner is a # user named `Jan', or `Feb', etc. However, it's unlikely that `/' # will be owned by a user whose name is a month. So we first look at # the extended ls output of the root directory to decide how many # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. set x`$ls_command /` # Find which argument is the month. month= command= until test $month do shift # Add another shift to the command. command="$command shift;" case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done # Get the extended ls output of the file or directory. set dummy x`eval "$ls_command \"\$save_arg1\""` # Remove all preceding arguments eval $command # Because of the dummy argument above, month is in $2. # # On a POSIX system, we should have # # $# = 5 # $1 = file size # $2 = month # $3 = day # $4 = year or time # $5 = filename # # On Darwin 7.7.0 and 7.6.0, we have # # $# = 4 # $1 = day # $2 = month # $3 = year or time # $4 = filename # Get the month. case $2 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac case $3 in ???*) day=$1;; *) day=$3; shift;; esac # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: indent-2.2.11/config/config.sub0000644000177400010010000010115311041664114013216 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: indent-2.2.11/config/depcomp0000755000177400010010000004426711270443577012643 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: indent-2.2.11/config/config.guess0000644000177400010010000012753411041664113013565 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: indent-2.2.11/config/config.rpath0000755000177400010010000003343411041664102013551 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2002 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shlibext= host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix3* | aix4* | aix5*) wl='-Wl,' ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6*) wl='-Wl,' ;; linux*) echo '__INTEL_COMPILER' > conftest.$ac_ext if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null then : else # Intel icc wl='-Qoption,ld,' fi ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) if test "x$host_vendor" = xsni; then wl='-LD' else wl='-Wl,' fi ;; esac fi hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken ld_shlibs=no ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=yes ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9* | hpux10* | hpux11*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. ;; irix5* | irix6*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) if test "x$host_vendor" = xsno; then hardcode_direct=yes # is this really true??? else hardcode_direct=no # Motorola manual says yes, but my tests say they lie fi ;; sysv4.3*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5uw7* | unixware7*) ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics libname_spec='lib$name' sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case "$host_os" in aix3*) shlibext=so ;; aix4* | aix5*) shlibext=so ;; amigaos*) shlibext=ixlibrary ;; beos*) shlibext=so ;; bsdi4*) shlibext=so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" ;; cygwin* | mingw* | pw32*) case $GCC,$host_os in yes,cygwin*) shlibext=dll.a ;; yes,mingw*) shlibext=dll sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) shlibext=dll ;; *) shlibext=dll ;; esac ;; darwin* | rhapsody*) shlibext=dylib ;; freebsd1*) ;; freebsd*) shlibext=so ;; gnu*) shlibext=so ;; hpux9* | hpux10* | hpux11*) shlibext=sl ;; irix5* | irix6*) shlibext=so case "$host_os" in irix5*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 ") libsuff= shlibsuff= ;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) ;; linux-gnu*) shlibext=so ;; netbsd*) shlibext=so ;; newsos6) shlibext=so ;; openbsd*) shlibext=so ;; os2*) libname_spec='$name' shlibext=dll ;; osf3* | osf4* | osf5*) shlibext=so sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) shlibext=so ;; solaris*) shlibext=so ;; sunos4*) shlibext=so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) shlibext=so case "$host_vendor" in motorola) sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) shlibext=so ;; dgux*) shlibext=so ;; sysv4*MP*) if test -d /usr/nec; then shlibext=so fi ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: indent-2.2.11/config/mkinstalldirs0000755000177400010010000000132211041664103014037 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here indent-2.2.11/config/texinfo.tex0000644000177400010010000110032011270443577013444 00000000000000% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2009-05-16.16} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007, 2008, 2009 Free Software Foundation, Inc. % % This texinfo.tex file 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 3 of the % License, or (at your option) any later version. % % This texinfo.tex file 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, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. (This has been our intent since Texinfo was invented.) % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % http://www.gnu.org/software/texinfo/ (the Texinfo home page), or % ftp://tug.org/tex/texinfo.tex % (and all CTAN mirrors, see http://www.ctan.org). % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% Math-mode def from plain.tex. \let\ptexraggedright=\raggedright % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Since the category of space is not known, we have to be careful. \chardef\spacecat = 10 \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! \chardef\lquoteChar= `\` \chardef\questChar = `\? \chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt} % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\undefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % For @cropmarks command. % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. The solution is % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 \noexpand\or \the\toks4 \the\toks6 \noexpand\else \the\toks8 }% } % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} % % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my % favourite TeX trick. --kasal, 16nov03 \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as environments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At run-time, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Environment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty out of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} %% Simple single-character @ commands % @@ prints an @ % Kludge this until the fonts are right (grr). \def\@{{\tt\char64}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. %% Define @` and @' to be the same as ` and ' %% but suppressing ligatures. %\def\`{{`}} %\def\'{{'}} % Used to generate quoted braces. \def\mylbrace {{\tt\char123}} \def\myrbrace {{\tt\char125}} \let\{=\mylbrace \let\}=\myrbrace \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other !gdef!lbracecmd[\{]% !gdef!rbracecmd[\}]% !gdef!lbraceatcmd[@{]% !gdef!rbraceatcmd[@}]% !endgroup % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \c \let\dotaccent = \. \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \t \let\ubaraccent = \b \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% \kern-.15em \TeX } % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox \prevdepth = \dimen1 \checkinserts } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in % Old definition--didn't work. %\parseargdef\need{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak %\prevdepth=-1000pt %}} \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion \indexnofonts % Allow `@@' and other weird things in file names. \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes % definitions, etc. \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other \catcode`\`=\other \catcode`\'=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\next\centerH \else \let\next\centerV \fi \next{\hfil \ignorespaces#1\unskip \hfil}% } \def\centerH#1{% {% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }% } \def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} % @sp n outputs n lines of vertical space \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }% } \gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}% } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a \ character. % FYI, plain.tex uses \\ as a temporary control sequence (why?), but % this is not advertised and we don't care. Texinfo does not % otherwise define @\. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathunderscore \let\\ = \mathbackslash \mathactive % make the texinfo accent commands work in math mode \let\"=\ddot \let\'=\acute \let\==\bar \let\^=\hat \let\`=\grave \let\u=\breve \let\v=\check \let\~=\tilde \let\dotaccent=\dot $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus \let' = \ptexquoteright } } % Some math mode symbols. \def\bullet{$\ptexbullet$} \def\geq{\ifmmode \ge\else $\ge$\fi} \def\leq{\ifmmode \le\else $\le$\fi} \def\minus{\ifmmode -\else $-$\fi} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @comma{} is so commas can be inserted into text without messing up % Texinfo's parsing. % \let\comma = , % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. \openin 1 texinfo.cnf \ifeof 1 \else \input texinfo.cnf \fi \closein 1 % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as \undefined, % borrowed from ifpdf.sty. \ifx\pdfoutput\undefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html % (and related messages, the final outcome is that it is up to the TeX % user to double the backslashes and otherwise make the string valid, so % that's what we do). % double active backslashes. % {\catcode`\@=0 \catcode`\\=\active @gdef@activebackslashdouble{% @catcode`@\=@active @let\=@doublebackslash} } % To handle parens, we must adopt a different approach, since parens are % not active characters. hyperref.dtx (which has the same problem as % us) handles it with this amazing macro to replace tokens, with minor % changes for Texinfo. It is included here under the GPL by permission % from the author, Heiko Oberdiek. % % #1 is the tokens to replace. % #2 is the replacement. % #3 is the control sequence with the string. % \def\HyPsdSubst#1#2#3{% \def\HyPsdReplace##1#1##2\END{% ##1% \ifx\\##2\\% \else #2% \HyReturnAfterFi{% \HyPsdReplace##2\END }% \fi }% \xdef#3{\expandafter\HyPsdReplace#3#1\END}% } \long\def\HyReturnAfterFi#1\fi{\fi#1} % #1 is a control sequence in which to do the replacements. \def\backslashparens#1{% \xdef#1{#1}% redefine it as its expansion; the definition is simply % \lastnode when called from \setref -> \pdfmkdest. \HyPsdSubst{(}{\realbackslash(}{#1}% \HyPsdSubst{)}{\realbackslash)}{#1}% } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros based on pdfcolor.tex. \def\cmykDarkRed{0.28 1 1 0.35} \def\cmykBlack{0 0 0 1} % % k sets the color for filling (usual text, etc.); % K sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 k #1 K}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\cmykBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .png, .jpg, .pdf (among % others). Let's try in that order. \let\pdfimgext=\empty \begingroup \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{PDF}% \fi \else \gdef\pdfimgext{pdf}% \fi \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \closein 1 \endgroup % % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \imagewidth \fi \ifdim \wd2 >0pt height \imageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive \activebackslashdouble \makevalueexpandable \def\pdfdestname{#1}% \backslashparens\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use a color that is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. \def\urlcolor{\cmykDarkRed} \def\linkcolor{\cmykDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \def\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else % Doubled backslashes in the name. {\activebackslashdouble \xdef\pdfoutlinedest{#3}% \backslashparens\pdfoutlinedest}% \fi % % Also double the backslashes in the display string. {\activebackslashdouble \xdef\pdfoutlinetext{#1}% \backslashparens\pdfoutlinetext}% % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % % Read toc silently, to get counts of subentries for \pdfoutline. \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % xx to do this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Right % now, I guess we'll just let the pdf reader have its way. \indexnofonts \setupdatafile \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \ifx\p\space\else\addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \fi \nextsp} \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput \message{fonts,} % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font } % Select #1 fonts with the current style. % \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Unfortunately, we have to override this for titles and the like, since % in those cases "rm" is bold. Sigh. \def\rmisbold{\rm\def\curfontstyle{bf}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % Default leading. \newdimen\textleading \textleading = 13.2pt % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % PDF CMaps. See also LaTeX's t1.cmap. % % do nothing with this by default. \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) \ifpdf \ifx\pdffontattr\undefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass % empty to omit). \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % emacs-page end of cmaps % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\undefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} %where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. This is the default in % Texinfo. % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} % reset the current fonts \textfonts \rm } % end of 11pt text font size definitions % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} % reduce space between paragraphs \divide\parskip by 2 % reset the current fonts \textfonts \rm } % end of 10pt text font size definitions % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xword{10} \def\xiword{11} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% \wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this because \STYLE needs to also set the % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used in % the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \def\curfontsize{text}% \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \def\curfontsize{chap}% \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \def\curfontsize{ssec}% \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts \def\reducedfonts{% \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\tenttsl=\reducedttsl \def\curfontsize{reduced}% \def\lsize{small}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \def\curfontsize{small}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \def\curfontsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi \message{markup,} % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost % style and the set of \ifmarkupSTYLE switches for all styles % currently in effect. \newif\ifmarkupvar \newif\ifmarkupsamp \newif\ifmarkupkey %\newif\ifmarkupfile % @file == @samp. %\newif\ifmarkupoption % @option == @samp. \newif\ifmarkupcode \newif\ifmarkupkbd %\newif\ifmarkupenv % @env == @code. %\newif\ifmarkupcommand % @command == @code. \newif\ifmarkuptex % @tex (and part of @math, for now). \newif\ifmarkupexample \newif\ifmarkupverb \newif\ifmarkupverbatim \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } \let\markupstylesetup\empty \def\defmarkupstylesetup#1{% \expandafter\def\expandafter\markupstylesetup \expandafter{\markupstylesetup #1}% \def#1% } % Markup style setup for left and right quotes. \defmarkupstylesetup\markupsetuplq{% \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuplqdefault \else \temp \fi } \defmarkupstylesetup\markupsetuprq{% \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuprqdefault \else \temp \fi } { \catcode`\'=\active \catcode`\`=\active \gdef\markupsetuplqdefault{\let`\lq} \gdef\markupsetuprqdefault{\let'\rq} \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} \gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} } \let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuprqcode \markupsetcodequoteright \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright \let\markupsetuplqverb \markupsetcodequoteleft \let\markupsetuprqverb \markupsetcodequoteright \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright \let\markupsetuplqsamp \markupsetnoligaturesquoteleft \let\markupsetuplqkbd \markupsetnoligaturesquoteleft % Allow an option to not replace quotes with a regular directed right % quote/apostrophe (char 0x27), but instead use the undirected quote % from cmtt (char 0x0d). The undirected quote is ugly, so don't make it % the default, but it works for pasting with more pdf viewers (at least % evince), the lilypond developers report. xpdf does work with the % regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax % [Knuth] pp. 380,381,391 % \relax disables Spanish ligatures ?` and !` of \tt font. \relax`% \else \char'22 \fi \else \char'22 \fi } % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else \ptexslash\fi\fi\fi} \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} % like \smartslanted except unconditionally uses \ttsl. % @var is set to this for defun arguments. \def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitalicx} \let\i=\smartitalic \let\slanted=\smartslanted \def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}} \let\dfn=\smartslanted \let\emph=\smartitalic % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default % @t, explicit typewriter. \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} %\font\keysy=cmsy9 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% % \vbox{\hrule\kern-0.4pt % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% % \kern-0.4pt\hrule}% % \kern-.06em\raise0.4pt\hbox{\angleright}}}} % definition of @key with no lozenge. If the current font is already % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % \def\key#1{{\setupmarkupstyle{key}% \nohyphenation \ifmonospace\else\tt\fi #1}\null} % ctrl is no longer a Texinfo command. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. \let\file=\samp \let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup \setupmarkupstyle{code}% % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\realdash \let_\realunder \fi \codex } } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } \def\codex #1{\tclose{#1}\endgroup} % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is undesirable in % some manuals, especially if they don't have long identifiers in % general. @allowcodebreaks provides a way to control this. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg'}% \fi\fi } % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle option `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct'. \kbdinputstyle distinct \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} % For @indicateurl, @env, @command quotes seem unnecessary, so use \code. \let\indicateurl=\code \let\env=\code \let\command=\code % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} % @clickstyle @arrow (by default) \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. Perhaps eventually put in % a hypertex \special here. % \def\uref#1{\douref #1,,,\finish} \def\douref#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi } \message{glyphs,} % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Glyphs from the EC fonts. We don't use \let for the aliases, because % sometimes we redefine the original macro, and the alias should reflect % the redefinition. % % Use LaTeX names for the Icelandic letters. \def\DH{{\ecfont \char"D0}} % Eth \def\dh{{\ecfont \char"F0}} % eth \def\TH{{\ecfont \char"DE}} % Thorn \def\th{{\ecfont \char"FE}} % thorn % \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % % This positioning is not perfect (see the ogonek LaTeX package), but % we have the precomposed glyphs for the most common cases. We put the % tests to use those glyphs in the single \ogonek macro so we have fewer % dummy definitions to worry about for index entries, etc. % % ogonek is also used with other letters in Lithuanian (IOU), but using % the precomposed glyphs for those is not so easy since they aren't in % the same EC font. \def\ogonek#1{{% \def\temp{#1}% \ifx\temp\macrocharA\Aogonek \else\ifx\temp\macrochara\aogonek \else\ifx\temp\macrocharE\Eogonek \else\ifx\temp\macrochare\eogonek \else \ecfont \setbox0=\hbox{#1}% \ifdim\ht0=1ex\accent"0C #1% \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% \fi \fi\fi\fi\fi }% } \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % % Use the ec* fonts (cm-super in outline format) for non-CM glyphs. \def\ecfont{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\undefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } %%% Macros to be used within @titlepage: \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% \checkenv\titlepage \leftline{\titlefonts\rmisbold #1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\secfonts\rmisbold \leftline{#1}}% \fi } %%% Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\HEADINGSoff{% \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\undefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % % Try typesetting the item mark that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% \setbox0 = \hbox{\itemcontents}% % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi % \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. % Assignments have to be global since we are inside the implicit group % of an alignment entry. \everycr resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% \global\colcount=0 % Reset the column counter. % Check for saved footnotes, etc. \checkinserts % Keeps underfull box messages off when table breaks over pages. %\filbreak % Maybe so, but it also creates really weird page breaks when the % table breaks over pages. Wouldn't \vfil be better? Wait until the % problem manifests itself, so it can be fixed for real --karl. }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\realdash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \relax % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% % % Need these in case \tex is in effect and \{ is a \delimiter again. % But can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. \let\{ = \mylbrace \let\} = \myrbrace % % I don't entirely understand this, but when an index entry is % generated from a macro call, the \endinput which \scanmacro inserts % causes processing to be prematurely terminated. This is, % apparently, because \indexsorttmp is fully expanded, and \endinput % is an expandable command. The redefinition below makes \endinput % disappear altogether for that purpose -- although logging shows that % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} % @findex xyz % @end macro % ... % @funindex commtest % % The above is not enough to reproduce the bug, but it gives the flavor. % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} % % So: \let\endinput = \empty % % Do the redefinitions. \commondummies } % For the aux and toc files, @ is the escape character. So we want to % redefine everything using @ as the escape character (instead of % \realbackslash, still used for index files). When everything uses @, % this will be simpler. % \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % % Do the redefinitions. \commondummies \otherbackslash } % Called from \indexdummies and \atdummies. % \def\commondummies{% % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control% words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % For control letters, we have \definedummyletter, which omits the % space. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % \def\definedummyword ##1{\def##1{\string##1\space}}% \def\definedummyletter##1{\def##1{\string##1}}% \let\definedummyaccent\definedummyletter % \commondummiesnofonts % \definedummyletter\_% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\DH \definedummyword\L \definedummyword\O \definedummyword\OE \definedummyword\TH \definedummyword\aa \definedummyword\ae \definedummyword\dh \definedummyword\exclamdown \definedummyword\l \definedummyword\o \definedummyword\oe \definedummyword\ordf \definedummyword\ordm \definedummyword\questiondown \definedummyword\ss \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\expansion \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\result \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist % \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. \definedummyletter\!% \definedummyaccent\"% \definedummyaccent\'% \definedummyletter\*% \definedummyaccent\,% \definedummyletter\.% \definedummyletter\/% \definedummyletter\:% \definedummyaccent\=% \definedummyletter\?% \definedummyaccent\^% \definedummyaccent\`% \definedummyaccent\~% \definedummyword\u \definedummyword\v \definedummyword\H \definedummyword\dotaccent \definedummyword\ogonek \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent \definedummyword\udotaccent \definedummyword\dotless % % Texinfo font commands. \definedummyword\b \definedummyword\i \definedummyword\r \definedummyword\sc \definedummyword\t % % Commands that take arguments. \definedummyword\acronym \definedummyword\cite \definedummyword\code \definedummyword\command \definedummyword\dfn \definedummyword\emph \definedummyword\env \definedummyword\file \definedummyword\kbd \definedummyword\key \definedummyword\math \definedummyword\option \definedummyword\pxref \definedummyword\ref \definedummyword\samp \definedummyword\strong \definedummyword\tie \definedummyword\uref \definedummyword\url \definedummyword\var \definedummyword\verb \definedummyword\w \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\definedummyletter##1{\let##1\empty}% % Hopefully, all control words can become @asis. \let\definedummyword\definedummyaccent % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% % how to handle braces? \def\_{\normalunderscore}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% \def\ordf{a}% \def\ordm{o}% \def\o{o}% \def\questiondown{?}% \def\ss{ss}% \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. % (The following {} will end up in the sort string, but that's ok.) \def\bullet{bullet}% \def\comma{,}% \def\copyright{copyright}% \def\dots{...}% \def\enddots{...}% \def\equiv{==}% \def\error{error}% \def\euro{euro}% \def\expansion{==>}% \def\guillemetleft{<<}% \def\guillemetright{>>}% \def\guilsinglleft{<}% \def\guilsinglright{>}% \def\minus{-}% \def\point{.}% \def\pounds{pounds}% \def\print{-|}% \def\quotedblbase{"}% \def\quotedblleft{"}% \def\quotedblright{"}% \def\quoteleft{`}% \def\quoteright{'}% \def\quotesinglbase{,}% \def\registeredsymbol{R}% \def\result{=>}% \def\textdegree{o}% % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist } \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Write the entry in \toks0 to the index file: % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % % Process the index entry with all font commands turned off, to % get the string to sort by. {\indexnofonts \edef\temp{\the\toks0}% need full expansion \xdef\indexsorttmp{\temp}% }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{% \ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi } % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % % A straightforward implementation would start like this: % \def\entry#1#2{... % But this freezes the catcodes in the argument, and can cause problems to % @code, which sets - active. This problem was fixed by a kludge--- % ``-'' was active throughout whole index, but this isn't really right. % % The right solution is to prevent \entry from swallowing the whole text. % --kasal, 21nov03 \def\entry{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus1pt % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\doentry{% \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. } \def\finishentry#1{% % #1 is the page number. % % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \setbox\boxA = \hbox{#1}% \ifdim\wd\boxA = 0pt \ % \else % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#1.% \ \the\toksA \else \ #1% \fi \fi \par \endgroup } % Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % \unnumberedno is an oxymoron, of course. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achive this, remember the "biggest" unnum. sec. we are currently in: \chardef\unmlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unmlevel \chardef\unmlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unmlevel \def\headtype{U}% \else \chardef\unmlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % % \putwordChapter can contain complex things in translations. \toks0=\expandafter{\putwordChapter}% \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz % \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % % \putwordAppendix can contain complex things in translations. \toks0=\expandafter{\putwordAppendix}% \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } \outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% % Well, we could do the following in a group, but that would break % an assumption that \chapmacro is called at the outermost level. % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } \outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. \outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } \outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading % NOTE on use of \vbox for chapter headings, section headings, and such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a % heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\ptexraggedright \rmisbold #1\hfill}}% \bigskip \par\penalty 200\relax \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% \hbox to 0pt{}% \chappager \endgroup \fi } \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rmisbold % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % I don't think this chapter style is supported any more, so I'm not % updating it with the new noderef stuff. We'll see. --karl, 11aug03. % \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\ptexraggedright \rmisbold #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % \def\sectionlevel{#2}% \def\temptype{#3}% % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Go into vertical mode. Usually we'll already be there, but we % don't want the following whatsit to end up in a preceding paragraph % if the document didn't happen to have a blank line. \par % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) \vskip-\parskip % % This is purely so the last item on the list is a known \penalty > % 10000. This is so \startdefun can avoid allowing breakpoints after % section headings. Otherwise, it would insert a valid breakpoint between: % % @section sec-whatever % @deffn def-whatever \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @tex ... @end tex escapes into raw Tex temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. \envdef\tex{% \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \catcode`\`=\other \catcode`\'=\other \escapechar=`\\ % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of \def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt % Turn off paragraph indentation but redefine \indent to emulate % the normal \indent. \nonfillparindent=\parindent \parindent = 0pt \let\indent\nonfillindent % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } \begingroup \obeyspaces % We want to swallow spaces (but not other tokens) after the fake % @indent in our nonfill-environments, where spaces are normally % active and set to @tie, resulting in them not being ignored after % @indent. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% \gdef\nonfillindentcheck{% \ifx\temp % \expandafter\nonfillindentgobble% \else% \leavevmode\nonfillindentbox% \fi% }% \endgroup \def\nonfillindentgobble#1{\nonfillindent} \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it by one command: \def\makedispenv #1#2{ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two synonyms: \def\maketwodispenvs #1#2#3{ \makedispenv{#1}{#3} \makedispenv{#2}{#3} } % @lisp: indented, narrowed, typewriter font; @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvs {lisp}{example}{% \nonfillstart \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenv {display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenv{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill \gobble } \let\Eflushright = \afterenvbreak % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. \envdef\raggedright{% \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax } \let\Eraggedright\par \envdef\raggedleft{% \parindent=0pt \leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedleft\par \envdef\raggedcenter{% \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \def\quotationstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi \parsearg\quotationlabel } \envdef\quotation{% \setnormaldispenv \quotationstart } \envdef\smallquotation{% \setsmalldispenv \quotationstart } \let\Esmallquotation = \Equotation % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\undefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% % Don't do the quotes -- if we do, @set txicodequoteundirected and % @set txicodequotebacktick will not have effect on @verb and % @verbatim, and ?` and !` ligatures won't get disabled. %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % \def\starttabbox{\setbox0=\hbox\bgroup} % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen0=\wd0 % the width so far, or since the previous tab \divide\dimen0 by\tabw \multiply\dimen0 by\tabw % compute previous multiple of \tabw \advance\dimen0 by\tabw % advance to next multiple of \tabw \wd0=\dimen0 \box0 \starttabbox }% } \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \indexnofonts % Allow `@@' and other weird things in file names. \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a minor refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remaining is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } %%% Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } %%% Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } %%% Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } %%% Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } %%% Type: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % How we'll format the type name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % (plain.tex says that \dimen1 should be used only as global.) \parshape 2 0in \dimen0 \defargsindent \dimen2 % % Put the type name to the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% return value type \ifx\temp\empty\else \tclose{\temp} \fi #3% output function name }% {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. Let's try @var for that. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi \def\scanmacro#1{% \begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces % Undo catcode changes of \startcontents and \doprintindex % When called from @insertcopying or (short)caption, we need active % backslash to get it printed correctly. Previously, we had % \catcode`\\=\other instead. We'll see whether a problem appears % with macro expansion. --kasal, 19aug04 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % ... and \example \spaceisspace % % Append \endinput to make sure that TeX does not see the ending newline. % I've verified that it is necessary both for e-TeX and for ordinary TeX % --kasal, 29nov03 \scantokens{#1\endinput}% \endgroup } \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% \temp } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. \def\scanctxt{% \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% \scanctxt \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% \scanctxt \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } \def\macroargctxt{% \scanctxt \catcode`\\=\other } % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0% \else \expandafter\parsemargdef \argl;% \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\definedummyword \noexpand#1% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname #1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.blah for each blah % in the params list, to be ##N where N is the position in that list. % That gets used by \mbodybackslash (above). % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. \def\parsemargdef#1;{\paramno=0\def\paramlist{}% \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1% \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% % This defines the macro itself. There are six cases: recursive and % nonrecursive macros of zero, one, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \fi \fi} \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg) \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Just make them active and then expand them all to nothing. \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \atdummies % preserve commands, but don't expand them \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout }% \fi } % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces \def\printedmanual{\ignorespaces #5}% \def\printedrefname{\ignorespaces #3}% \setbox1=\hbox{\printedmanual\unskip}% \setbox0=\hbox{\printedrefname\unskip}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf {\indexnofonts \turnoffactive % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. \getfilename{#4}% % % See comments at \activebackslashdouble. {\activebackslashdouble \xdef\pdfxrefdest{#1}% \backslashparens\pdfxrefdest}% % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfxrefdest}% \else goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". We distinguish them by the % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd0 = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % if the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd1 > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not % insert empty discretionaries after hyphens, which means that it will % not find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, this % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. \ifdim \wd1 > 0pt \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via a macro so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \fi \endlink \endgroup} % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % \def\refx#1#2{% {% \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs \message{\linenumber Undefined cross reference `#1'.}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Usually it's % just a \def (we prepend XR to the control sequence name to avoid % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% {% The node name might contain 8-bit characters, which in our current % implementation are changed to commands like @'e. Don't let these % mess up the control sequence name. \indexnofonts \turnoffactive \xdef\safexrefname{#1}% }% % \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % Make the characters 128-255 be printing characters. {% \count1=128 \def\loop{% \catcode\count1=\other \advance\count1 by 1 \ifnum \count1<256 \loop \fi }% }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut \futurelet\next\fo@t } }%end \catcode `\@=11 % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\undefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing this stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \fi % % Leave vertical mode so that indentation from an enclosing % environment such as @quotation is respected. On the other hand, if % it's at the top level, we don't want the normal paragraph indentation. \noindent % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \medskip \fi % space after the standalone image \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \atdummies % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. \scanexp{% \xdef\noexpand\gtemp{% \ifx\thisshortcaption\empty \thiscaption \else \thisshortcaption \fi }% }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % % place the captured inserts % % BEWARE: when the floats start floating, we have to issue warning % whenever an insert appears inside a float which could possibly % float. --kasal, 26may04 % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % For single-language documents, @documentlanguage is usually given very % early, just after @documentencoding. Single argument is the language % (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{\begingroup \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX \endgroup} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } }% end of special _ catcode % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? Putting it in the current directory should work if nowhere else does.} % This macro is called from txi-??.tex files; the first argument is the % \language name to set (without the "\lang@" prefix), the second and % third args are \{left,right}hyphenmin. % % The language names to pass are determined when the format is built. % See the etex.log file created at that time, e.g., % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. % % With TeX Live 2008, etex now includes hyphenation patterns for all % available languages. This means we can support hyphenation in % Texinfo, at least to some extent. (This still doesn't solve the % accented characters problem.) % \catcode`@=11 \def\txisetlanguage#1#2#3{% % do not set the language if the name is undefined in the current TeX. \expandafter\ifx\csname lang@#1\endcsname \relax \message{no patterns for #1}% \else \global\language = \csname lang@#1\endcsname \fi % but there is no harm in adjusting the hyphenmin values regardless. \global\lefthyphenmin = #2\relax \global\righthyphenmin = #3\relax } % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active \utfeightchardefs % \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii } % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdef^^a0{~} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\copyright} \gdef^^aa{\ordf} \gdef^^ab{\guillemetleft} \gdef^^ac{$\lnot$} \gdef^^ad{\-} \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} \gdef^^b1{$\pm$} \gdef^^b2{$^2$} \gdef^^b3{$^3$} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} % \gdef^^b7{$^.$} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} % \gdef^^bb{\guilletright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} \gdef^^bf{\questiondown} % \gdef^^c0{\`A} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} \gdef^^c9{\'E} \gdef^^ca{\^E} \gdef^^cb{\"E} \gdef^^cc{\`I} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\"I} % \gdef^^d0{\DH} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\~O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\O} \gdef^^d9{\`U} \gdef^^da{\'U} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\TH} \gdef^^df{\ss} % \gdef^^e0{\`a} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\~a} \gdef^^e4{\"a} \gdef^^e5{\ringaccent a} \gdef^^e6{\ae} \gdef^^e7{\cedilla c} \gdef^^e8{\`e} \gdef^^e9{\'e} \gdef^^ea{\^e} \gdef^^eb{\"e} \gdef^^ec{\`{\dotless i}} \gdef^^ed{\'{\dotless i}} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % \gdef^^f0{\dh} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\~o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\o} \gdef^^f9{\`u} \gdef^^fa{\'u} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\th} \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdef^^a4{\euro} \gdef^^a6{\v S} \gdef^^a8{\v s} \gdef^^b4{\v Z} \gdef^^b8{\v z} \gdef^^bc{\OE} \gdef^^bd{\oe} \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{~} \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\v L} \gdef^^a6{\'S} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\v S} \gdef^^aa{\cedilla S} \gdef^^ab{\v T} \gdef^^ac{\'Z} \gdef^^ad{\-} \gdef^^ae{\v Z} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} \gdef^^b1{\ogonek{a}} \gdef^^b2{\ogonek{ }} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} \gdef^^b6{\'s} \gdef^^b7{\v{}} \gdef^^b8{\cedilla\ } \gdef^^b9{\v s} \gdef^^ba{\cedilla s} \gdef^^bb{\v t} \gdef^^bc{\'z} \gdef^^bd{\H{}} \gdef^^be{\v z} \gdef^^bf{\dotaccent z} % \gdef^^c0{\'R} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\u A} \gdef^^c4{\"A} \gdef^^c5{\'L} \gdef^^c6{\'C} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} \gdef^^ca{\ogonek{E}} \gdef^^cb{\"E} \gdef^^cc{\v E} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\v D} % \gdef^^d0{\DH} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\H O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\cedilla T} \gdef^^df{\ss} % \gdef^^e0{\'r} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\u a} \gdef^^e4{\"a} \gdef^^e5{\'l} \gdef^^e6{\'c} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} \gdef^^ea{\ogonek{e}} \gdef^^eb{\"e} \gdef^^ec{\v e} \gdef^^ed{\'\i} \gdef^^ee{\^\i} \gdef^^ef{\v d} % \gdef^^f0{\dh} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\H o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\v r} \gdef^^f9{\ringaccent u} \gdef^^fa{\'u} \gdef^^fb{\H u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\cedilla t} \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } \begingroup \catcode`\~13 \catcode`\"12 \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref \def\UTFviiiTwoOctets##1##2{% \csname u8:##1\string ##2\endcsname}% \def\UTFviiiThreeOctets##1##2##3{% \csname u8:##1\string ##2\string ##3\endcsname}% \def\UTFviiiFourOctets##1##2##3##4{% \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% \endgroup} \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz \multiply\countUTFz by 64 \advance\countUTFx by -\countUTFz \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B4}{\'{ }} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} \DeclareUnicodeCharacter{00C3}{\~A} \DeclareUnicodeCharacter{00C4}{\"A} \DeclareUnicodeCharacter{00C5}{\AA} \DeclareUnicodeCharacter{00C6}{\AE} \DeclareUnicodeCharacter{00C7}{\cedilla{C}} \DeclareUnicodeCharacter{00C8}{\`E} \DeclareUnicodeCharacter{00C9}{\'E} \DeclareUnicodeCharacter{00CA}{\^E} \DeclareUnicodeCharacter{00CB}{\"E} \DeclareUnicodeCharacter{00CC}{\`I} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} \DeclareUnicodeCharacter{00E3}{\~a} \DeclareUnicodeCharacter{00E4}{\"a} \DeclareUnicodeCharacter{00E5}{\aa} \DeclareUnicodeCharacter{00E6}{\ae} \DeclareUnicodeCharacter{00E7}{\cedilla{c}} \DeclareUnicodeCharacter{00E8}{\`e} \DeclareUnicodeCharacter{00E9}{\'e} \DeclareUnicodeCharacter{00EA}{\^e} \DeclareUnicodeCharacter{00EB}{\"e} \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} \DeclareUnicodeCharacter{0104}{\ogonek{A}} \DeclareUnicodeCharacter{0105}{\ogonek{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} \DeclareUnicodeCharacter{0118}{\ogonek{E}} \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} \DeclareUnicodeCharacter{015B}{\'s} \DeclareUnicodeCharacter{015C}{\^S} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{t}} \DeclareUnicodeCharacter{0163}{\cedilla{T}} \DeclareUnicodeCharacter{0164}{\v{T}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} \DeclareUnicodeCharacter{016B}{\=u} \DeclareUnicodeCharacter{016C}{\u{U}} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} \DeclareUnicodeCharacter{0177}{\^y} \DeclareUnicodeCharacter{0178}{\"Y} \DeclareUnicodeCharacter{0179}{\'Z} \DeclareUnicodeCharacter{017A}{\'z} \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} \DeclareUnicodeCharacter{01C7}{LJ} \DeclareUnicodeCharacter{01C8}{Lj} \DeclareUnicodeCharacter{01C9}{lj} \DeclareUnicodeCharacter{01CA}{NJ} \DeclareUnicodeCharacter{01CB}{Nj} \DeclareUnicodeCharacter{01CC}{nj} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} \DeclareUnicodeCharacter{01F3}{dz} \DeclareUnicodeCharacter{01F4}{\'G} \DeclareUnicodeCharacter{01F5}{\'g} \DeclareUnicodeCharacter{01F8}{\`N} \DeclareUnicodeCharacter{01F9}{\`n} \DeclareUnicodeCharacter{01FC}{\'{\AE}} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} \DeclareUnicodeCharacter{02DB}{\ogonek{ }} \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} \DeclareUnicodeCharacter{1E83}{\'w} \DeclareUnicodeCharacter{1E84}{\"W} \DeclareUnicodeCharacter{1E85}{\"w} \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} \DeclareUnicodeCharacter{1E8C}{\"X} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} \DeclareUnicodeCharacter{2019}{\quoteright} \DeclareUnicodeCharacter{201A}{\quotesinglbase} \DeclareUnicodeCharacter{201C}{\quotedblleft} \DeclareUnicodeCharacter{201D}{\quotedblright} \DeclareUnicodeCharacter{201E}{\quotedblbase} \DeclareUnicodeCharacter{2022}{\bullet} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} \DeclareUnicodeCharacter{20AC}{\euro} \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} \DeclareUnicodeCharacter{2212}{\minus} \DeclareUnicodeCharacter{2217}{\point} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be so finicky about underfull hboxes, either. \hbadness = 2000 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize \advance\dimen2 by \normaloffset % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\+=\other \catcode`\$=\other \def\normaldoublequote{"} \def\normaltilde{~} \def\normalcaret{^} \def\normalunderscore{_} \def\normalverticalbar{|} \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} \def\normaldollar{$}%$ font-lock fix % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active @def@normalbackslash{{@tt@backslashcurfont}} % On startup, @fixbackslash assigns: % @let \ = @normalbackslash % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. % @def@normalturnoffactive{% @let\=@normalbackslash @let"=@normaldoublequote @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus @let$=@normaldollar %$ font-lock fix @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These look ok in all fonts, so just make them not special. @catcode`@& = @other @catcode`@# = @other @catcode`@% = @other @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active @markupsetuplqdefault @markupsetuprqdefault @c Gnulib now utterly and painfully insists on no trailing whitespace. @c So we have to nuke it. @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c eval: (add-hook 'write-file-hooks 'nuke-trailing-whitespace) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore indent-2.2.11/config/missing0000755000177400010010000002623311270443577012656 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: