aboutsummaryrefslogtreecommitdiff
path: root/doc/grecs-syntax.texi
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-12-25 20:15:22 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-12-26 01:17:52 +0200
commitadd57c075c6f747a81c142ab48d59106de822664 (patch)
treec15f94acdf135954e2f63ac7657c57cdd134ed75 /doc/grecs-syntax.texi
parentd51e1365118ce87016a39bd94437e31b35b8d307 (diff)
downloadgrecs-add57c075c6f747a81c142ab48d59106de822664.tar.gz
grecs-add57c075c6f747a81c142ab48d59106de822664.tar.bz2
Add globbing pattern support to #include and #include_once
* doc/grecs-syntax.texi: Document changes to the #include statement. * doc/grecs_config.5: Likewise. * src/preproc.c (include_glob, include_pos) (include_once): New statics. (pp_list_find): Return 0 if list is NULL. (incl_copy): New statics. (source_lookup): Use incl_copy as the copy function. (pop_source): If more glob expansions are available, push next one onto input stack. (isglob): New static. (parse_include): Support globbing patterns. * tests/Makefile.am: Add new testes. * tests/testsuite.at: Likewise. * tests/incl00.at: New test case. * tests/incl01.at: New test case. * tests/incl02.at: New test case. * tests/incl03.at: New test case.
Diffstat (limited to 'doc/grecs-syntax.texi')
-rw-r--r--doc/grecs-syntax.texi25
1 files changed, 18 insertions, 7 deletions
diff --git a/doc/grecs-syntax.texi b/doc/grecs-syntax.texi
index c10cab6..da59d03 100644
--- a/doc/grecs-syntax.texi
+++ b/doc/grecs-syntax.texi
@@ -1,5 +1,5 @@
@c This file is part of grecs - Gray's Extensible Configuration System
-@c Copyright (C) 2007, 2009-2012 Sergey Poznyakoff
+@c Copyright (C) 2007, 2009-2014 Sergey Poznyakoff
@c
@c Grecs is free software; you can redistribute it and/or modify
@c it under the terms of the GNU General Public License as published by
@@ -82,12 +82,23 @@ next physical newline character.
@kwindex #include
@item #include <@var{file}>
@itemx #include @var{file}
-Include the contents of the file @var{file}. If @var{file} is an
-absolute file name, both forms are equivalent. Otherwise, the form
-with angle brackets searches for the file in the @dfn{include
-search path}, while the second one looks for it in the current working
-directory first, and, if not found there, in the include search
-path.
+Include the contents of the file @var{file}. There are three possible
+use cases.
+
+If @var{file} is an absolute file name, the named file is included.
+An error message will be issued if it does not exist.
+
+If @var{file} contains wildcard characters (@samp{*}, @samp{[},
+@samp{]} or @samp{?}), it is interpreted as shell globbing pattern and
+all files matching that pattern are included, in lexicographical
+order. If no files match the pattern, the statement is silently
+ignored.
+
+Otherwise, the form with angle brackets searches for file in the
+@dfn{include search path}, while the second one looks for it in the
+current working directory first, and, if not found there, in the
+include search path. If the file is not found, an error message will
+be issued.
The default include search path is:

Return to:

Send suggestions and report system problems to the System administrator.