diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-12-26 13:34:54 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-12-26 13:38:22 +0200 |
commit | a1d8a2d3662cde5f1d0ec411e372c3614bb49a6d (patch) | |
tree | e63ef5036c667de101d0c652a1a8c25e187656a1 | |
parent | 7284aa23593651e26ab726d375487d3fc55a6863 (diff) | |
download | pies-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-- | NEWS | 4 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | doc/pies.texi | 101 | ||||
m--------- | grecs | 0 | ||||
-rw-r--r-- | src/cmdline.opt | 10 |
5 files changed, 106 insertions, 13 deletions
@@ -1,4 +1,4 @@ | |||
1 | GNU Pies NEWS -- history of user-visible changes. 2013-01-06 | 1 | GNU Pies NEWS -- history of user-visible changes. 2014-12-26 |
2 | Copyright (C) 2009-2013 Sergey Poznyakoff | 2 | Copyright (C) 2009-2013 Sergey Poznyakoff |
3 | See the end of file for copying conditions. | 3 | See 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 | ||
9 | Version 1.2.90 (Git) | 9 | Version 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 | ||
17 | AC_PREREQ([2.63]) | 17 | AC_PREREQ([2.63]) |
18 | AC_INIT([GNU Pies], [1.2.90], [bug-pies@gnu.org.ua]) | 18 | AC_INIT([GNU Pies], [1.2.91], [bug-pies@gnu.org.ua]) |
19 | AC_CONFIG_SRCDIR([src/pies.h]) | 19 | AC_CONFIG_SRCDIR([src/pies.h]) |
20 | AC_CONFIG_AUX_DIR([build-aux]) | 20 | AC_CONFIG_AUX_DIR([build-aux]) |
21 | AC_CONFIG_HEADERS([config.h]) | 21 | AC_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, | |||
41 | 51 Franklin Street, Fifth Floor, | 41 | 51 Franklin Street, Fifth Floor, |
42 | Boston, MA 02110-1301 USA | 42 | Boston, MA 02110-1301 USA |
43 | 43 | ||
44 | Copyright @copyright{} 2005-2013 Sergey Poznyakoff | 44 | Copyright @copyright{} 2005-2014 Sergey Poznyakoff |
45 | 45 | ||
46 | Permission is granted to copy, distribute and/or modify this document | 46 | Permission is granted to copy, distribute and/or modify this document |
47 | under the terms of the GNU Free Documentation License, Version 1.3 or | 47 | under 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 | ||
352 | The following constructs, appearing at the start of a line are | ||
353 | treated specially: @samp{#include}, @samp{#include_once}, | ||
354 | @samp{#line}, @samp{# @var{num}} (where @var{num} is a decimal number). | ||
355 | These 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 |
354 | characters @samp{/*} (slash, star) and continue until the first | 359 | characters @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 |
546 | Before parsing, configuration file is preprocessed. This goes in | ||
547 | three stages. First, include directives are expanded. An | ||
548 | @dfn{include directive} begins with a @samp{#} sign at the beginning | ||
549 | of a line, followed by the word @samp{include} or @samp{include_once}. | ||
550 | Any amount of whitespace is allowed between the @samp{#} and the | ||
551 | word. The entire text up to the end of the line is removed and | ||
552 | replaced using the following rules: | ||
553 | |||
554 | @table @code | ||
555 | @kwindex #include | ||
556 | @item #include <@var{file}> | ||
557 | @itemx #include @var{file} | ||
558 | The contents of the file @var{file} is included. There are three possible | ||
559 | use cases. | ||
560 | |||
561 | If @var{file} is an absolute file name, the named file is included. | ||
562 | An error message will be issued if it does not exist. | ||
563 | |||
564 | If @var{file} contains wildcard characters (@samp{*}, @samp{[}, | ||
565 | @samp{]} or @samp{?}), it is interpreted as shell globbing pattern and | ||
566 | all files matching that pattern are included, in lexicographical | ||
567 | order. If no matching files are found, the directive is replaced with | ||
568 | an empty line. | ||
569 | |||
570 | Otherwise, the form with angle brackets searches for file in the | ||
571 | @dfn{include search path}, while the second one looks for it in the | ||
572 | current working directory first, and, if not found there, in the | ||
573 | include search path. If the file is not found, an error message will | ||
574 | be issued. | ||
575 | |||
576 | @cindex include search path, preprocessor | ||
577 | @cindex include directories, preprocessor | ||
578 | @cindex preprocessor include search path | ||
579 | @anchor{include search path} | ||
580 | The include search path is: | ||
581 | |||
582 | @enumerate 1 | ||
583 | @item | ||
584 | @xopindex{include-directory, described} | ||
585 | Any directories supplied with the @option{-I} (@option{--include-directory}) | ||
586 | command line option. These directories are scanned in the same order | ||
587 | as 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 | ||
594 | where @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 | ||
600 | been 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 |
543 | external preprocessor @command{m4}. For a complete user manual, refer | 605 | preprocessing. For a complete user manual, refer |
544 | to | 606 | to |
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 | |||
557 | information is then used by the parser to display meaningful | 619 | information is then used by the parser to display meaningful |
558 | diagnostic. An initial set of macro definitions is supplied by the | 620 | diagnostic. 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 | ||
563 | The default @file{pp-setup} file renames all @command{m4} built-in | 624 | The default @file{pp-setup} file renames all @command{m4} built-in |
564 | macro names so they all start with the prefix @samp{m4_}. This | 625 | macro 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 | |||
566 | advantage that it works with non-GNU @command{m4} implementations as | 627 | advantage that it works with non-GNU @command{m4} implementations as |
567 | well. | 628 | well. |
568 | 629 | ||
569 | Additional preprocessor symbols may be defined and the existing | 630 | The include path for @command{m4} is set as described above. |
570 | symbols may be undefined using the following command line options: | 631 | |
632 | Additional preprocessor symbols may be defined and existing | ||
633 | definitions 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. | |||
584 | Undefine symbol @var{sym}. | 647 | Undefine symbol @var{sym}. |
585 | @end table | 648 | @end table |
586 | 649 | ||
650 | Finally, the @command{m4} output is passed to the configuration | ||
651 | parser. When parsing, the following constructs appearing at the | ||
652 | beginning 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 | ||
659 | diagnostics, 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}. | ||
661 | If 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 | ||
665 | compatibility 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 | |||
2493 | equivalent to @command{pies --instance=inetd --syntax=inetd}. | 2574 | equivalent 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} | ||
2580 | Add directory @var{dir} to the list of directories to be scanned for | ||
2581 | include files. @xref{include search path}. | ||
2582 | |||
2496 | @opsummary{instance} | 2583 | @opsummary{instance} |
2497 | @item --instance=@var{name} | 2584 | @item --instance=@var{name} |
2498 | Define the name of the @command{pies} instance. @xref{instances}. | 2585 | Define 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>]) |