aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-12-26 13:34:54 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-12-26 13:38:22 +0200
commita1d8a2d3662cde5f1d0ec411e372c3614bb49a6d (patch)
treee63ef5036c667de101d0c652a1a8c25e187656a1
parent7284aa23593651e26ab726d375487d3fc55a6863 (diff)
downloadpies-a1d8a2d3662cde5f1d0ec411e372c3614bb49a6d.tar.gz
pies-a1d8a2d3662cde5f1d0ec411e372c3614bb49a6d.tar.bz2
Implement globbing patterns in include statements.
* grecs: Upgrade. * doc/pies.texi: Document built-in include and line directives. * src/cmdline.opt: New option -I (--include-directory). * configure.ac: Version 1.2.91 * NEWS: Update.
-rw-r--r--NEWS4
-rw-r--r--configure.ac4
-rw-r--r--doc/pies.texi101
m---------grecs0
-rw-r--r--src/cmdline.opt10
5 files changed, 106 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index 450d475..319e36c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
1GNU Pies NEWS -- history of user-visible changes. 2013-01-06 1GNU Pies NEWS -- history of user-visible changes. 2014-12-26
2Copyright (C) 2009-2013 Sergey Poznyakoff 2Copyright (C) 2009-2013 Sergey Poznyakoff
3See the end of file for copying conditions. 3See the end of file for copying conditions.
4 4
@@ -6,7 +6,7 @@ Please send Pies bug reports to <bug-pies@gnu.org> or
6<bug-pies@gnu.org.ua> 6<bug-pies@gnu.org.ua>
7 7
8 8
9Version 1.2.90 (Git) 9Version 1.2.91 (Git)
10 10
11* New flag siggroup. 11* New flag siggroup.
12 12
diff --git a/configure.ac b/configure.ac
index 34f4d4a..92ffbbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
1# This file is part of GNU Pies. -*- autoconf -*- 1# This file is part of GNU Pies. -*- autoconf -*-
2# Copyright (C) 2009-2013 Sergey Poznyakoff 2# Copyright (C) 2009-2014 Sergey Poznyakoff
3# 3#
4# GNU Pies is free software; you can redistribute it and/or modify 4# GNU Pies is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by 5# it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
15# along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. 15# along with GNU Pies. If not, see <http://www.gnu.org/licenses/>.
16 16
17AC_PREREQ([2.63]) 17AC_PREREQ([2.63])
18AC_INIT([GNU Pies], [1.2.90], [bug-pies@gnu.org.ua]) 18AC_INIT([GNU Pies], [1.2.91], [bug-pies@gnu.org.ua])
19AC_CONFIG_SRCDIR([src/pies.h]) 19AC_CONFIG_SRCDIR([src/pies.h])
20AC_CONFIG_AUX_DIR([build-aux]) 20AC_CONFIG_AUX_DIR([build-aux])
21AC_CONFIG_HEADERS([config.h]) 21AC_CONFIG_HEADERS([config.h])
diff --git a/doc/pies.texi b/doc/pies.texi
index b45a164..37ade1b 100644
--- a/doc/pies.texi
+++ b/doc/pies.texi
@@ -41,7 +41,7 @@ Published by the Free Software Foundation,
4151 Franklin Street, Fifth Floor, 4151 Franklin Street, Fifth Floor,
42Boston, MA 02110-1301 USA 42Boston, MA 02110-1301 USA
43 43
44Copyright @copyright{} 2005-2013 Sergey Poznyakoff 44Copyright @copyright{} 2005-2014 Sergey Poznyakoff
45 45
46Permission is granted to copy, distribute and/or modify this document 46Permission is granted to copy, distribute and/or modify this document
47under the terms of the GNU Free Documentation License, Version 1.3 or 47under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -349,6 +349,11 @@ with @samp{#} or @samp{//} and continue to the end of the line:
349// This too is a comment 349// This too is a comment
350@end smallexample 350@end smallexample
351 351
352The following constructs, appearing at the start of a line are
353treated specially: @samp{#include}, @samp{#include_once},
354@samp{#line}, @samp{# @var{num}} (where @var{num} is a decimal number).
355These are described in detail in @ref{Preprocessor}.
356
352@cindex multi-line comments 357@cindex multi-line comments
353 @dfn{Multi-line} or @dfn{C-style} comments start with the two 358 @dfn{Multi-line} or @dfn{C-style} comments start with the two
354characters @samp{/*} (slash, star) and continue until the first 359characters @samp{/*} (slash, star) and continue until the first
@@ -538,9 +543,66 @@ this is not required.
538@node Preprocessor 543@node Preprocessor
539@subsection Using Preprocessor to Improve the Configuration. 544@subsection Using Preprocessor to Improve the Configuration.
540@cindex preprocessor 545@cindex preprocessor
546Before parsing, configuration file is preprocessed. This goes in
547three stages. First, include directives are expanded. An
548@dfn{include directive} begins with a @samp{#} sign at the beginning
549of a line, followed by the word @samp{include} or @samp{include_once}.
550Any amount of whitespace is allowed between the @samp{#} and the
551word. The entire text up to the end of the line is removed and
552replaced using the following rules:
553
554@table @code
555@kwindex #include
556@item #include <@var{file}>
557@itemx #include @var{file}
558The contents of the file @var{file} is included. There are three possible
559use cases.
560
561If @var{file} is an absolute file name, the named file is included.
562An error message will be issued if it does not exist.
563
564If @var{file} contains wildcard characters (@samp{*}, @samp{[},
565@samp{]} or @samp{?}), it is interpreted as shell globbing pattern and
566all files matching that pattern are included, in lexicographical
567order. If no matching files are found, the directive is replaced with
568an empty line.
569
570Otherwise, the form with angle brackets searches for file in the
571@dfn{include search path}, while the second one looks for it in the
572current working directory first, and, if not found there, in the
573include search path. If the file is not found, an error message will
574be issued.
575
576@cindex include search path, preprocessor
577@cindex include directories, preprocessor
578@cindex preprocessor include search path
579@anchor{include search path}
580The include search path is:
581
582@enumerate 1
583@item
584@xopindex{include-directory, described}
585Any directories supplied with the @option{-I} (@option{--include-directory})
586command line option. These directories are scanned in the same order
587as they appear in the command line.
588
589@item @file{@var{prefix}/share/pies/@value{VERSION}/include}
590@item @file{@var{prefix}/share/pies/include}
591@end enumerate
592
593@noindent
594where @var{prefix} is the installation prefix.
595
596@kwindex #include_once
597@item #include_once <@var{file}>
598@itemx #include_once @var{file}
599 Same as @code{#include}, except that, if the @var{file} has already
600been included, it will not be included again.
601@end table
602
541@cindex m4 603@cindex m4
542 Before parsing, the configuration file is @dfn{preprocessed} using 604 The obtained material is then passed to @command{m4} for
543external preprocessor @command{m4}. For a complete user manual, refer 605preprocessing. For a complete user manual, refer
544to 606to
545@ifnothtml 607@ifnothtml
546@ref{Top, GNU M4 manual, GNU M4, m4, GNU M4 macro processor}. 608@ref{Top, GNU M4 manual, GNU M4, m4, GNU M4 macro processor}.
@@ -557,8 +619,7 @@ it to include line synchronization information in its output. This
557information is then used by the parser to display meaningful 619information is then used by the parser to display meaningful
558diagnostic. An initial set of macro definitions is supplied by the 620diagnostic. An initial set of macro definitions is supplied by the
559@file{pp-setup} file, located in 621@file{pp-setup} file, located in
560@file{@var{$prefix}/share/pies/@var{version}/include} directory (where 622@file{@var{$prefix}/share/pies/@value{VERSION}/include} directory.
561@var{version} means the version of the package).
562 623
563The default @file{pp-setup} file renames all @command{m4} built-in 624The default @file{pp-setup} file renames all @command{m4} built-in
564macro names so they all start with the prefix @samp{m4_}. This 625macro names so they all start with the prefix @samp{m4_}. This
@@ -566,8 +627,10 @@ is similar to GNU m4 @option{--prefix-builtin} options, but has an
566advantage that it works with non-GNU @command{m4} implementations as 627advantage that it works with non-GNU @command{m4} implementations as
567well. 628well.
568 629
569Additional preprocessor symbols may be defined and the existing 630The include path for @command{m4} is set as described above.
570symbols may be undefined using the following command line options: 631
632Additional preprocessor symbols may be defined and existing
633definitions cancelled using the following command line options:
571 634
572@table @option 635@table @option
573@xopindex{define, described} 636@xopindex{define, described}
@@ -584,6 +647,24 @@ the @var{value} is not given.
584Undefine symbol @var{sym}. 647Undefine symbol @var{sym}.
585@end table 648@end table
586 649
650Finally, the @command{m4} output is passed to the configuration
651parser. When parsing, the following constructs appearing at the
652beginning of a line are handled specially:
653
654@table @code
655@kwindex #line
656@item #line @var{num}
657@itemx #line @var{num} "@var{file}"
658 This line causes the parser to believe, for purposes of error
659diagnostics, that the line number of the next source line is given by
660@var{num} and the current input file is named by @var{file}.
661If the latter is absent, the remembered file name does not change.
662
663@item # @var{num} "@var{file}"
664 This is a special form of @code{#line} statement, understood for
665compatibility with the @sc{c} preprocessor.
666@end table
667
587@node Component Statement 668@node Component Statement
588@section Component Statement 669@section Component Statement
589@kwindex component 670@kwindex component
@@ -2493,6 +2574,12 @@ Run in @command{inetd}-compatibility mode. It is roughly
2493equivalent to @command{pies --instance=inetd --syntax=inetd}. 2574equivalent to @command{pies --instance=inetd --syntax=inetd}.
2494@xref{inetd}. 2575@xref{inetd}.
2495 2576
2577@opsummary{include-directory}
2578@item --include-directory=@var{dir}
2579@itemx -I @var{dir}
2580Add directory @var{dir} to the list of directories to be scanned for
2581include files. @xref{include search path}.
2582
2496@opsummary{instance} 2583@opsummary{instance}
2497@item --instance=@var{name} 2584@item --instance=@var{name}
2498Define the name of the @command{pies} instance. @xref{instances}. 2585Define the name of the @command{pies} instance. @xref{instances}.
diff --git a/grecs b/grecs
Subproject fa0d6d088a1fe22b178ef2565351f15622a1d6d Subproject add57c075c6f747a81c142ab48d59106de82266
diff --git a/src/cmdline.opt b/src/cmdline.opt
index a01ea4a..a0dc703 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -1,5 +1,5 @@
1/* This file is part of GNU Pies. -*- c -*- 1/* This file is part of GNU Pies. -*- c -*-
2 Copyright (C) 2008-2013 Sergey Poznyakoff 2 Copyright (C) 2008-2014 Sergey Poznyakoff
3 3
4 GNU Pies is free software; you can redistribute it and/or modify 4 GNU Pies is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@ OPTIONS_BEGIN("pies",
18 [<process invocation and execution supervisor>], 18 [<process invocation and execution supervisor>],
19 [<>], 19 [<>],
20 [<gnu>], 20 [<gnu>],
21 [<copyright_year=2011>], 21 [<copyright_year=2008-2014>],
22 [<copyright_holder=Sergey Poznyakoff>])