aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-08-08 08:53:46 +0300
committerSergey Poznyakoff <gray@gnu.org>2016-08-08 08:53:46 +0300
commitbd5b7c29986b8106595f35cbe303fc44cf8c4d0d (patch)
tree84b39cc6d228b3642f7105c48162193a05982882
parent102d1b9c1a94548dfa0c498845c77933db6a7738 (diff)
downloadgrecs-bd5b7c29986b8106595f35cbe303fc44cf8c4d0d.tar.gz
grecs-bd5b7c29986b8106595f35cbe303fc44cf8c4d0d.tar.bz2
Rename the projectargot
-rw-r--r--Makefile.am24
-rw-r--r--NEWS2
-rw-r--r--README.hacking4
-rw-r--r--README.standalone12
-rw-r--r--README.submodule34
-rw-r--r--am/argot.m4 (renamed from am/grecs.m4)196
-rw-r--r--build-aux/getopt.m424
-rw-r--r--build-aux/git2chg.awk2
-rwxr-xr-xbuild-aux/yyrename4
-rw-r--r--configure.ac6
-rw-r--r--doc/ARGOT_SETUP.3 (renamed from doc/GRECS_SETUP.3)38
-rw-r--r--doc/Makefile.am32
-rw-r--r--doc/argot-syntax.texi (renamed from doc/grecs-syntax.texi)8
-rw-r--r--doc/argot_asprintf.3 (renamed from doc/grecs_asprintf.3)28
-rw-r--r--doc/argot_config.5 (renamed from doc/grecs_config.5)20
-rw-r--r--doc/argot_error.3 (renamed from doc/grecs_error.3)48
-rw-r--r--doc/argot_format_locus.3 (renamed from doc/grecs_format_locus.3)32
-rw-r--r--doc/argot_format_node.3 (renamed from doc/grecs_format_node.3)56
-rw-r--r--doc/argot_format_node_path.3 (renamed from doc/grecs_format_node_path.3)36
-rw-r--r--doc/argot_format_value.3 (renamed from doc/grecs_format_value.3)30
-rw-r--r--doc/argot_include_path_setup.3 (renamed from doc/grecs_include_path_setup.3)26
-rw-r--r--doc/argot_malloc.3 (renamed from doc/grecs_malloc.3)72
-rw-r--r--doc/argot_node_free.3 (renamed from doc/grecs_node_free.3)20
-rw-r--r--doc/argot_parse.3 (renamed from doc/grecs_parse.3)92
-rw-r--r--doc/argot_stmt_path.5 (renamed from doc/grecs_stmt_path.5)12
-rw-r--r--doc/argot_strdup.3 (renamed from doc/grecs_strdup.3)24
-rw-r--r--doc/argot_tree_free.3 (renamed from doc/grecs_tree_free.3)20
-rw-r--r--doc/tmpl.310
-rw-r--r--doc/wordsplit.36
-rw-r--r--include/Makefile.am22
-rw-r--r--include/argot.h (renamed from include/grecs.h)44
-rw-r--r--include/argot/.gitignore (renamed from include/grecs/.gitignore)0
-rw-r--r--include/argot/Makefile.am43
-rw-r--r--include/argot/doc.h (renamed from include/grecs/doc.h)16
-rw-r--r--include/argot/error.h (renamed from include/grecs/error.h)22
-rw-r--r--include/argot/format.h62
-rw-r--r--include/argot/json.h (renamed from include/grecs/json.h)10
-rw-r--r--include/argot/lex.h52
-rw-r--r--include/argot/list.h54
-rw-r--r--include/argot/locus.h (renamed from include/grecs/locus.h)22
-rw-r--r--include/argot/mem.h (renamed from include/grecs/mem.h)28
-rw-r--r--include/argot/node.h62
-rw-r--r--include/argot/opt.h (renamed from include/grecs/opt.h)20
-rw-r--r--include/argot/parser.h56
-rw-r--r--include/argot/preproc.h46
-rw-r--r--include/argot/sockaddr.h66
-rw-r--r--include/argot/symtab.h53
-rw-r--r--include/argot/table.h102
-rw-r--r--include/argot/tree.h71
-rw-r--r--include/argot/txtacc.h (renamed from include/grecs/txtacc.h)28
-rw-r--r--include/argot/types.h.in (renamed from include/grecs/types.h.in)12
-rw-r--r--include/argot/util.h (renamed from include/grecs/util.h)12
-rw-r--r--include/argot/value.h (renamed from include/grecs/value.h)40
-rw-r--r--include/argot/version.h (renamed from include/grecs/version.h)22
-rw-r--r--include/grecs/Makefile.am43
-rw-r--r--include/grecs/format.h62
-rw-r--r--include/grecs/lex.h52
-rw-r--r--include/grecs/list.h54
-rw-r--r--include/grecs/node.h62
-rw-r--r--include/grecs/parser.h56
-rw-r--r--include/grecs/preproc.h46
-rw-r--r--include/grecs/sockaddr.h66
-rw-r--r--include/grecs/symtab.h53
-rw-r--r--include/grecs/table.h102
-rw-r--r--include/grecs/tree.h71
-rw-r--r--src/.gitignore10
-rw-r--r--src/Make-inst.am8
-rw-r--r--src/Make-shared.am6
-rw-r--r--src/Make-static.am6
-rw-r--r--src/Make.am70
-rw-r--r--src/argot-gram.y (renamed from src/grecs-gram.y)98
-rw-r--r--src/argot-lex.l (renamed from src/grecs-lex.l)160
-rw-r--r--src/asprintf.c10
-rw-r--r--src/bind-gram.y152
-rw-r--r--src/bind-lex.l132
-rw-r--r--src/cidr.c62
-rw-r--r--src/dhcpd-gram.y160
-rw-r--r--src/dhcpd-lex.l154
-rw-r--r--src/diag.c36
-rw-r--r--src/format.c204
-rw-r--r--src/git-parser.c150
-rw-r--r--src/ipstr.c16
-rw-r--r--src/join.c36
-rw-r--r--src/json-gram.y76
-rw-r--r--src/json-lex.l22
-rw-r--r--src/jsonfmt.c18
-rw-r--r--src/libargot.m4 (renamed from src/libgrecs.m4)32
-rw-r--r--src/lineacc.c46
-rw-r--r--src/list.c84
-rw-r--r--src/lookup.c252
-rw-r--r--src/mem.c48
-rw-r--r--src/meta1-gram.y80
-rw-r--r--src/meta1-lex.l56
-rw-r--r--src/opthelp.c52
-rw-r--r--src/parser.c54
-rw-r--r--src/parsertab.c26
-rw-r--r--src/path-parser.c82
-rw-r--r--src/pp-setup2
-rw-r--r--src/preproc.c258
-rw-r--r--src/sockaddr.c96
-rw-r--r--src/sort.c36
-rw-r--r--src/symtab.c92
-rw-r--r--src/text.c32
-rw-r--r--src/tree.c632
-rw-r--r--src/txtacc.c124
-rw-r--r--src/version.c100
-rw-r--r--src/yytrans8
-rw-r--r--tests/Makefile.am26
-rw-r--r--tests/argot00.at (renamed from tests/grecs00.at)8
-rw-r--r--tests/bind00.at4
-rw-r--r--tests/cfhelp.at2
-rw-r--r--tests/distck.at2
-rw-r--r--tests/distck.c12
-rw-r--r--tests/empty.at12
-rw-r--r--tests/enum.at2
-rw-r--r--tests/format00.at2
-rw-r--r--tests/format01.at2
-rw-r--r--tests/format02.at2
-rw-r--r--tests/gcf1.conf2
-rw-r--r--tests/gcfenum.c24
-rw-r--r--tests/gcffmt.c64
-rw-r--r--tests/gcfpeek.c44
-rw-r--r--tests/gcfset.c136
-rw-r--r--tests/gcfver.c14
-rw-r--r--tests/git.conf2
-rw-r--r--tests/glob00.at2
-rw-r--r--tests/glob01.at2
-rw-r--r--tests/glob02.at2
-rw-r--r--tests/glob03.at2
-rw-r--r--tests/glob04.at2
-rw-r--r--tests/glob05.at2
-rw-r--r--tests/incl00.at2
-rw-r--r--tests/incl01.at2
-rw-r--r--tests/incl02.at2
-rw-r--r--tests/incl03.at2
-rw-r--r--tests/join.at2
-rw-r--r--tests/json.c10
-rw-r--r--tests/locus-bind.at2
-rw-r--r--tests/locus-git.at8
-rw-r--r--tests/locus-meta1.at2
-rw-r--r--tests/locus00.at2
-rw-r--r--tests/locus01.at2
-rw-r--r--tests/locus02.at2
-rw-r--r--tests/parser-bind.at2
-rw-r--r--tests/parser-dhcpd.at2
-rw-r--r--tests/parser-git.at4
-rw-r--r--tests/parser-meta1.at2
-rw-r--r--tests/path-locus.at2
-rw-r--r--tests/peek00.at2
-rw-r--r--tests/peek01.at2
-rw-r--r--tests/peek02.at2
-rw-r--r--tests/peek03.at2
-rw-r--r--tests/reduce00.at4
-rw-r--r--tests/reduce01.at4
-rw-r--r--tests/reduce02.at4
-rw-r--r--tests/reduce03.at4
-rw-r--r--tests/set.at2
-rw-r--r--tests/sort00.at4
-rw-r--r--tests/sort01.at4
-rw-r--r--tests/stradj.at2
-rw-r--r--tests/strcat.at2
-rw-r--r--tests/testsuite.at10
-rw-r--r--tests/vercmp.at2
-rw-r--r--tests/wordsplit.at2
-rw-r--r--tests/wsp.c6
165 files changed, 3404 insertions, 3404 deletions
diff --git a/Makefile.am b/Makefile.am
index 3eaa8df..c86d78b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,8 +15,8 @@
15# along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15# along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16 16
17ACLOCAL_AMFLAGS = -I am 17ACLOCAL_AMFLAGS = -I am
18SUBDIRS=. include src @GRECS_TESTDIR@ @GRECS_DOCDIR@ 18SUBDIRS=. include src @ARGOT_TESTDIR@ @ARGOT_DOCDIR@
19EXTRA_DIST=build-aux/yyrename @GRECS_BUILD_AUX@ @GRECS_DISTDOC@ gitid.h 19EXTRA_DIST=build-aux/yyrename @ARGOT_BUILD_AUX@ @ARGOT_DISTDOC@ gitid.h
20 20
21noinst_HEADERS = gitid.h 21noinst_HEADERS = gitid.h
22BUILT_SOURCES = gitid.h README 22BUILT_SOURCES = gitid.h README
@@ -26,23 +26,23 @@ gitid.h:
26 @if test -e .git; then \ 26 @if test -e .git; then \
27 url=`git config --get remote.origin.url | sed 's|.*://||;s|/gitroot/|/|'`; \ 27 url=`git config --get remote.origin.url | sed 's|.*://||;s|/gitroot/|/|'`; \
28 case $$url in \ 28 case $$url in \
29 git.gnu.org.ua/grecs.git|*@git.gnu.org.ua/grecs.git) \ 29 git.gnu.org.ua/argot.git|*@git.gnu.org.ua/argot.git) \
30 dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\ 30 dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\
31 test -n "$$dirty" && dirty="-dirty"; \ 31 test -n "$$dirty" && dirty="-dirty"; \
32 ID=`git log -1 --pretty='format:%H-%ct-%ae'`$$dirty;\ 32 ID=`git log -1 --pretty='format:%H-%ct-%ae'`$$dirty;\
33 echo "#define GRECS_GIT_ID \"$$ID\"";; \ 33 echo "#define ARGOT_GIT_ID \"$$ID\"";; \
34 *) echo "#define GRECS_GIT_ID \"unknown\"";; \ 34 *) echo "#define ARGOT_GIT_ID \"unknown\"";; \
35 esac > gitid.tmp; \ 35 esac > gitid.tmp; \
36 cmp gitid.tmp gitid.h >/dev/null 2>&1 || mv gitid.tmp gitid.h; \ 36 cmp gitid.tmp gitid.h >/dev/null 2>&1 || mv gitid.tmp gitid.h; \
37 rm -f gitid.tmp; \ 37 rm -f gitid.tmp; \
38 fi; 38 fi;
39 39
40README: 40README:
41 test -f @GRECS_README@ && cp @GRECS_README@ README 41 test -f @ARGOT_README@ && cp @ARGOT_README@ README
42 42
43@GRECS_CHANGELOG@.PHONY: ChangeLog 43@ARGOT_CHANGELOG@.PHONY: ChangeLog
44@GRECS_CHANGELOG@ChangeLog: 44@ARGOT_CHANGELOG@ChangeLog:
45@GRECS_CHANGELOG@ $(AM_V_GEN)if test -d .git; then \ 45@ARGOT_CHANGELOG@ $(AM_V_GEN)if test -d .git; then \
46@GRECS_CHANGELOG@ git log --pretty='format:%ct %an <%ae>%n%n%s%n%n%b%n' | \ 46@ARGOT_CHANGELOG@ git log --pretty='format:%ct %an <%ae>%n%n%s%n%n%b%n' | \
47@GRECS_CHANGELOG@ awk -f $(top_srcdir)/build-aux/git2chg.awk > ChangeLog; \ 47@ARGOT_CHANGELOG@ awk -f $(top_srcdir)/build-aux/git2chg.awk > ChangeLog; \
48@GRECS_CHANGELOG@ fi 48@ARGOT_CHANGELOG@ fi
diff --git a/NEWS b/NEWS
index 5841811..7f37d39 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ Grecs NEWS -- history of user-visible changes. 2016-07-04
2Copyright (C) 2011-2016 Sergey Poznyakoff 2Copyright (C) 2011-2016 Sergey Poznyakoff
3See the end of file for copying conditions. 3See the end of file for copying conditions.
4 4
5Please send libgrecs bug reports to <gray+grecs@gnu.org.ua> 5Please send libargot bug reports to <gray+argot@gnu.org.ua>
6 6
7 7
8Version 1.0 (Git) 8Version 1.0 (Git)
diff --git a/README.hacking b/README.hacking
index 77e8e54..e43584f 100644
--- a/README.hacking
+++ b/README.hacking
@@ -11,7 +11,7 @@ For information about the standalone version, see the file
11README.standalone in this directory. 11README.standalone in this directory.
12 12
13For a detailed description of Grecs, see the documentation in 13For a detailed description of Grecs, see the documentation in
14the doc/ subdirectory, or visit http://grecs.man.gnu.org.ua. 14the doc/ subdirectory, or visit http://argot.man.gnu.org.ua.
15 15
16* Overview 16* Overview
17 17
@@ -64,7 +64,7 @@ with the actual ChangeLog after make.
64 64
65* Bug reporting. 65* Bug reporting.
66 66
67Send bug reports to <gray+grecs@gnu.org.ua>. 67Send bug reports to <gray+argot@gnu.org.ua>.
68 68
69 69
70* Copyright information: 70* Copyright information:
diff --git a/README.standalone b/README.standalone
index 6a4a1b6..470ae86 100644
--- a/README.standalone
+++ b/README.standalone
@@ -10,11 +10,11 @@ for the documentation, and is provided as a brief reference only.
10The complete documentation for Grecs is available in the 10The complete documentation for Grecs is available in the
11doc/ subdirectory, both as a set of manpages and as texinfo 11doc/ subdirectory, both as a set of manpages and as texinfo
12documents. To access the latter without installing the package 12documents. To access the latter without installing the package
13run `info -f doc/grecs.info'. After the package is installed 13run `info -f doc/argot.info'. After the package is installed
14the documentation can be accessed by running `info grecs'. 14the documentation can be accessed by running `info argot'.
15 15
16An online copy of the documentation in various formats is available 16An online copy of the documentation in various formats is available
17at http://grecs.man.gnu.org.ua. 17at http://argot.man.gnu.org.ua.
18 18
19* Overview 19* Overview
20 20
@@ -31,9 +31,9 @@ recursively, joining several trees together, reductions, etc.
31 31
32* Downloads 32* Downloads
33 33
34New versions of Libgrecs are available for download from 34New versions of Libargot are available for download from
35 35
36 ftp://download.gnu.org.ua/pub/release/grecs 36 ftp://download.gnu.org.ua/pub/release/argot
37 37
38* Building 38* Building
39 39
@@ -48,7 +48,7 @@ available [OPTIONS], see the file INSTALL in this directory.
48 48
49* Bug reporting. 49* Bug reporting.
50 50
51Send bug reports to <gray+grecs@gnu.org.ua>. 51Send bug reports to <gray+argot@gnu.org.ua>.
52 52
53 53
54* Copyright information: 54* Copyright information:
diff --git a/README.submodule b/README.submodule
index e04a4ec..5573a64 100644
--- a/README.submodule
+++ b/README.submodule
@@ -9,11 +9,11 @@ You will find a complete documentation for Grecs, in form of man
9pages, in the doc/ subdirectory. 9pages, in the doc/ subdirectory.
10 10
11An online copy of the documentation in various formats is available 11An online copy of the documentation in various formats is available
12at http://grecs.man.gnu.org.ua. 12at http://argot.man.gnu.org.ua.
13 13
14If you are interested in libgrecs, a standalone library implementation 14If you are interested in libargot, a standalone library implementation
15of Grecs, see the file README.standalone in this directory, or visit 15of Grecs, see the file README.standalone in this directory, or visit
16http://grecs.man.gnu.org.ua. 16http://argot.man.gnu.org.ua.
17 17
18* Overview 18* Overview
19 19
@@ -30,37 +30,37 @@ recursively, joining several trees together, reductions, etc.
30 30
31* Usage 31* Usage
32 32
331. Install grecs as a submodule: 331. Install argot as a submodule:
34 34
35 git submodule add git://git.gnu.org.ua/grecs.git grecs 35 git submodule add git://git.gnu.org.ua/argot.git argot
36 36
372. Add a call to GRECS_SETUP to your configure.ac. It can be as 372. Add a call to ARGOT_SETUP to your configure.ac. It can be as
38simple as: 38simple as:
39 39
40 GRECS_SETUP 40 ARGOT_SETUP
41 41
42If the subproject directory is not 'grecs', supply the actual 42If the subproject directory is not 'argot', supply the actual
43directory name as the first argument to this macro, e.g.: 43directory name as the first argument to this macro, e.g.:
44 44
45 GRECS_SETUP(lib/grecs) 45 ARGOT_SETUP(lib/argot)
46 46
47For a detailed description of the GRECS_SETUP macro, run 47For a detailed description of the ARGOT_SETUP macro, run
48`man doc/GRECS_SETUP.3'. 48`man doc/ARGOT_SETUP.3'.
49 49
503. In your Makefile.am, add @GRECS_INCLUDES@ to the INCLUDES value, 503. In your Makefile.am, add @ARGOT_INCLUDES@ to the INCLUDES value,
51and @GRECS_LDADD@ to LDADD, e.g.: 51and @ARGOT_LDADD@ to LDADD, e.g.:
52 52
53 INCLUDES = @GRECS_INCLUDES@ 53 INCLUDES = @ARGOT_INCLUDES@
54 LDADD = @GRECS_LDADD@ 54 LDADD = @ARGOT_LDADD@
55 55
564. Include "grecs.h" 564. Include "argot.h"
57 57
585. Use the library to handle your configuration files. See the 585. Use the library to handle your configuration files. See the
59documentation for a detailed discussion. 59documentation for a detailed discussion.
60 60
61* Bug reporting. 61* Bug reporting.
62 62
63Send bug reports to <gray+grecs@gnu.org.ua>. 63Send bug reports to <gray+argot@gnu.org.ua>.
64 64
65 65
66* Copyright information: 66* Copyright information:
diff --git a/am/grecs.m4 b/am/argot.m4
index 60244a1..f5a21aa 100644
--- a/am/grecs.m4
+++ b/am/argot.m4
@@ -1,4 +1,4 @@
1# This file is part of grecs - Gray's Extensible Configuration System -*- autoconf -*- 1# This file is part of argot - Gray's Extensible Configuration System -*- autoconf -*-
2# Copyright (C) 2007-2016 Sergey Poznyakoff 2# Copyright (C) 2007-2016 Sergey Poznyakoff
3# 3#
4# Grex is free software; you can redistribute it and/or modify 4# Grex is free software; you can redistribute it and/or modify
@@ -14,43 +14,43 @@
14# You should have received a copy of the GNU General Public License 14# You should have received a copy of the GNU General Public License
15# along with Grex. If not, see <http://www.gnu.org/licenses/>. 15# along with Grex. If not, see <http://www.gnu.org/licenses/>.
16 16
17# _GRECS_MANGLE_OPTION(NAME) 17# _ARGOT_MANGLE_OPTION(NAME)
18# ------------------------- 18# -------------------------
19# Convert NAME to a valid m4 identifier, by replacing invalid characters 19# Convert NAME to a valid m4 identifier, by replacing invalid characters
20# with underscores, and prepend the _GRECS_OPTION_ suffix to it. 20# with underscores, and prepend the _ARGOT_OPTION_ suffix to it.
21AC_DEFUN([_GRECS_MANGLE_OPTION], 21AC_DEFUN([_ARGOT_MANGLE_OPTION],
22[[_GRECS_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 22[[_ARGOT_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
23 23
24# _GRECS_SET_OPTION(NAME) 24# _ARGOT_SET_OPTION(NAME)
25# ---------------------- 25# ----------------------
26# Set option NAME. 26# Set option NAME.
27AC_DEFUN([_GRECS_SET_OPTION], 27AC_DEFUN([_ARGOT_SET_OPTION],
28[m4_define(_GRECS_MANGLE_OPTION([$1]), 1)]) 28[m4_define(_ARGOT_MANGLE_OPTION([$1]), 1)])
29 29
30# _GRECS_IF_OPTION_SET(NAME,IF-SET,IF-NOT-SET) 30# _ARGOT_IF_OPTION_SET(NAME,IF-SET,IF-NOT-SET)
31# ------------------------------------------- 31# -------------------------------------------
32# Check if option NAME is set. 32# Check if option NAME is set.
33AC_DEFUN([_GRECS_IF_OPTION_SET], 33AC_DEFUN([_ARGOT_IF_OPTION_SET],
34[m4_ifset(_GRECS_MANGLE_OPTION([$1]),[$2],[$3])]) 34[m4_ifset(_ARGOT_MANGLE_OPTION([$1]),[$2],[$3])])
35 35
36# _GRECS_OPTION_SWITCH(NAME1,IF-SET1,[NAME2,IF-SET2,[...]],[IF-NOT-SET]) 36# _ARGOT_OPTION_SWITCH(NAME1,IF-SET1,[NAME2,IF-SET2,[...]],[IF-NOT-SET])
37# ------------------------------------------------------------------------ 37# ------------------------------------------------------------------------
38# If NAME1 is set, run IF-SET1. Otherwise, if NAME2 is set, run IF-SET2. 38# If NAME1 is set, run IF-SET1. Otherwise, if NAME2 is set, run IF-SET2.
39# Continue the process for all name-if-set pairs within [...]. If none 39# Continue the process for all name-if-set pairs within [...]. If none
40# of the options is set, run IF-NOT-SET. 40# of the options is set, run IF-NOT-SET.
41AC_DEFUN([_GRECS_OPTION_SWITCH], 41AC_DEFUN([_ARGOT_OPTION_SWITCH],
42[m4_if([$4],,[_GRECS_IF_OPTION_SET($@)],dnl 42[m4_if([$4],,[_ARGOT_IF_OPTION_SET($@)],dnl
43[$3],,[_GRECS_IF_OPTION_SET($@)],dnl 43[$3],,[_ARGOT_IF_OPTION_SET($@)],dnl
44[_GRECS_IF_OPTION_SET([$1],[$2],[_GRECS_OPTION_SWITCH(m4_shift(m4_shift($@)))])])]) 44[_ARGOT_IF_OPTION_SET([$1],[$2],[_ARGOT_OPTION_SWITCH(m4_shift(m4_shift($@)))])])])
45 45
46# _GRECS_SET_OPTIONS(OPTIONS) 46# _ARGOT_SET_OPTIONS(OPTIONS)
47# ---------------------------------- 47# ----------------------------------
48# OPTIONS is a space-separated list of Grecs options. 48# OPTIONS is a space-separated list of Grecs options.
49AC_DEFUN([_GRECS_SET_OPTIONS], 49AC_DEFUN([_ARGOT_SET_OPTIONS],
50[m4_foreach_w([_GRECS_Option], [$1], [_GRECS_SET_OPTION(_GRECS_Option)])]) 50[m4_foreach_w([_ARGOT_Option], [$1], [_ARGOT_SET_OPTION(_ARGOT_Option)])])
51 51
52# GRECS_SETUP([dir],[OPTIONS],[pp-setup-file]) 52# ARGOT_SETUP([dir],[OPTIONS],[pp-setup-file])
53# dir - Directory in the source tree where grecs has been cloned. 53# dir - Directory in the source tree where argot has been cloned.
54# OPTIONS are: 54# OPTIONS are:
55# no-preproc Disable the use of preprocessor. 55# no-preproc Disable the use of preprocessor.
56# std-pp-setup Install standard pp-setup file. 56# std-pp-setup Install standard pp-setup file.
@@ -60,13 +60,13 @@ AC_DEFUN([_GRECS_SET_OPTIONS],
60# tests Build tests. 60# tests Build tests.
61# getopt Add getopt.m4 to the distribution. 61# getopt Add getopt.m4 to the distribution.
62# git2chg Add git2chg.awk to the distribution. 62# git2chg Add git2chg.awk to the distribution.
63# syntax-doc Add doc/grecs-syntax.texi to the distribution. 63# syntax-doc Add doc/argot-syntax.texi to the distribution.
64# install Build installable library. 64# install Build installable library.
65# shared Build shared (convenience) library. 65# shared Build shared (convenience) library.
66# install-headers [with "shared"] Install Grecs headers to 66# install-headers [with "shared"] Install Grecs headers to
67# GRECS_INCLUDE_DIR. 67# ARGOT_INCLUDE_DIR.
68# tree-api Use alternative signature of callback functions, 68# tree-api Use alternative signature of callback functions,
69# passing a pointer to grecs_node_t as an argument, 69# passing a pointer to argot_node_t as an argument,
70# instead of pointers to the value and locus. 70# instead of pointers to the value and locus.
71# sockaddr-list Sockaddr type keeps a singly-linked list of addresses 71# sockaddr-list Sockaddr type keeps a singly-linked list of addresses
72# returned by getaddrinfo. 72# returned by getaddrinfo.
@@ -79,19 +79,19 @@ AC_DEFUN([_GRECS_SET_OPTIONS],
79# If neither std-pp-setup option, nor pp-setup-file argument are supplied, 79# If neither std-pp-setup option, nor pp-setup-file argument are supplied,
80# no preprocessor setup file is installed. 80# no preprocessor setup file is installed.
81 81
82AC_DEFUN([GRECS_SETUP],[ 82AC_DEFUN([ARGOT_SETUP],[
83 m4_pushdef([grecsdir],m4_if($1,[.],,$1,,[grecs/],$1/)) 83 m4_pushdef([argotdir],m4_if($1,[.],,$1,,[argot/],$1/))
84 AC_PROG_YACC 84 AC_PROG_YACC
85 AM_PROG_LEX 85 AM_PROG_LEX
86 86
87 AC_HEADER_SYS_WAIT 87 AC_HEADER_SYS_WAIT
88 88
89 AC_SUBST([GRECS_SUBDIR],m4_if($1,,grecs,$1)) 89 AC_SUBST([ARGOT_SUBDIR],m4_if($1,,argot,$1))
90 _GRECS_SET_OPTIONS([$2]) 90 _ARGOT_SET_OPTIONS([$2])
91 # ********************** 91 # **********************
92 # Preprocessor 92 # Preprocessor
93 # ********************** 93 # **********************
94 _GRECS_IF_OPTION_SET([no-preproc], 94 _ARGOT_IF_OPTION_SET([no-preproc],
95 [use_ext_pp=no], 95 [use_ext_pp=no],
96 [AC_ARG_WITH([preprocessor], 96 [AC_ARG_WITH([preprocessor],
97 AC_HELP_STRING([--without-preprocessor], 97 AC_HELP_STRING([--without-preprocessor],
@@ -119,12 +119,12 @@ AC_DEFUN([GRECS_SETUP],[
119 AC_PATH_PROG(PPBIN, $DEFAULT_PREPROCESSOR) 119 AC_PATH_PROG(PPBIN, $DEFAULT_PREPROCESSOR)
120 if test -n "$PPBIN"; then 120 if test -n "$PPBIN"; then
121 DEFAULT_PREPROCESSOR="$PPBIN $PREPROC_OPTIONS" 121 DEFAULT_PREPROCESSOR="$PPBIN $PREPROC_OPTIONS"
122 _GRECS_IF_OPTION_SET([std-pp-setup], 122 _ARGOT_IF_OPTION_SET([std-pp-setup],
123 [PP_SETUP_FILE='pp-setup'], 123 [PP_SETUP_FILE='pp-setup'],
124 [m4_if([$3],,[PP_SETUP_FILE=],[PP_SETUP_FILE='$3'])]) 124 [m4_if([$3],,[PP_SETUP_FILE=],[PP_SETUP_FILE='$3'])])
125 AC_SUBST(PP_SETUP_FILE) 125 AC_SUBST(PP_SETUP_FILE)
126 if test -n "$PP_SETUP_FILE"; then 126 if test -n "$PP_SETUP_FILE"; then
127 _GRECS_IF_OPTION_SET([pp-setup-option], 127 _ARGOT_IF_OPTION_SET([pp-setup-option],
128 [AC_ARG_WITH([pp-setup-file], 128 [AC_ARG_WITH([pp-setup-file],
129 AC_HELP_STRING([--with-pp-setup-file], 129 AC_HELP_STRING([--with-pp-setup-file],
130 [install the default pp-setup file]), 130 [install the default pp-setup file]),
@@ -148,98 +148,98 @@ AC_DEFUN([GRECS_SETUP],[
148 else 148 else
149 DEFAULT_PREPROCESSOR=NULL 149 DEFAULT_PREPROCESSOR=NULL
150 fi 150 fi
151 _GRECS_IF_OPTION_SET([tests], 151 _ARGOT_IF_OPTION_SET([tests],
152 [m4_pushdef([TESTDIR],grecsdir[tests]) 152 [m4_pushdef([TESTDIR],argotdir[tests])
153 AC_CONFIG_TESTDIR(TESTDIR) 153 AC_CONFIG_TESTDIR(TESTDIR)
154 AC_CONFIG_FILES(TESTDIR/Makefile TESTDIR/atlocal) 154 AC_CONFIG_FILES(TESTDIR/Makefile TESTDIR/atlocal)
155 m4_popdef([TESTDIR]) 155 m4_popdef([TESTDIR])
156 AM_MISSING_PROG([AUTOM4TE], [autom4te]) 156 AM_MISSING_PROG([AUTOM4TE], [autom4te])
157 GRECS_TESTDIR=tests 157 ARGOT_TESTDIR=tests
158 ]) 158 ])
159 _GRECS_IF_OPTION_SET([getopt],[ 159 _ARGOT_IF_OPTION_SET([getopt],[
160 AC_CHECK_HEADERS([getopt.h]) 160 AC_CHECK_HEADERS([getopt.h])
161 AC_CHECK_FUNCS([sysconf getdtablesize getopt_long]) 161 AC_CHECK_FUNCS([sysconf getdtablesize getopt_long])
162 GRECS_BUILD_AUX="build-aux/getopt.m4" 162 ARGOT_BUILD_AUX="build-aux/getopt.m4"
163 ]) 163 ])
164 _GRECS_IF_OPTION_SET([git2chg],[GRECS_BUILD_AUX="$GRECS_BUILD_AUX build-aux/git2chg.awk"]) 164 _ARGOT_IF_OPTION_SET([git2chg],[ARGOT_BUILD_AUX="$ARGOT_BUILD_AUX build-aux/git2chg.awk"])
165 AM_CONDITIONAL([GRECS_COND_META1_PARSER], 165 AM_CONDITIONAL([ARGOT_COND_META1_PARSER],
166 _GRECS_OPTION_SWITCH([parser-meta1],[true], 166 _ARGOT_OPTION_SWITCH([parser-meta1],[true],
167 [all-parsers],[true], 167 [all-parsers],[true],
168 [false])) 168 [false]))
169 AM_CONDITIONAL([GRECS_COND_BIND_PARSER], 169 AM_CONDITIONAL([ARGOT_COND_BIND_PARSER],
170 _GRECS_OPTION_SWITCH([parser-bind],[true], 170 _ARGOT_OPTION_SWITCH([parser-bind],[true],
171 [all-parsers],[true], 171 [all-parsers],[true],
172 [false])) 172 [false]))
173 AM_CONDITIONAL([GRECS_COND_DHCPD_PARSER], 173 AM_CONDITIONAL([ARGOT_COND_DHCPD_PARSER],
174 _GRECS_OPTION_SWITCH([parser-dhcpd],[true], 174 _ARGOT_OPTION_SWITCH([parser-dhcpd],[true],
175 [all-parsers],[true], 175 [all-parsers],[true],
176 [false])) 176 [false]))
177 AM_CONDITIONAL([GRECS_COND_GIT_PARSER], 177 AM_CONDITIONAL([ARGOT_COND_GIT_PARSER],
178 _GRECS_OPTION_SWITCH([parser-git],[true], 178 _ARGOT_OPTION_SWITCH([parser-git],[true],
179 [all-parsers],[true], 179 [all-parsers],[true],
180 [false])) 180 [false]))
181 AM_CONDITIONAL([GRECS_COND_INSTALLHEADERS], 181 AM_CONDITIONAL([ARGOT_COND_INSTALLHEADERS],
182 _GRECS_IF_OPTION_SET([install-headers],[true],[false])) 182 _ARGOT_IF_OPTION_SET([install-headers],[true],[false]))
183 183
184 AM_CONDITIONAL([GRECS_COND_SOCKADDR_LIST], 184 AM_CONDITIONAL([ARGOT_COND_SOCKADDR_LIST],
185 _GRECS_IF_OPTION_SET([sockaddr-list],[true],[false])) 185 _ARGOT_IF_OPTION_SET([sockaddr-list],[true],[false]))
186 AM_CONDITIONAL([GRECS_COND_JSON], 186 AM_CONDITIONAL([ARGOT_COND_JSON],
187 _GRECS_IF_OPTION_SET([json],[true],[false])) 187 _ARGOT_IF_OPTION_SET([json],[true],[false]))
188 188
189 AC_SUBST([GRECS_SOCKADDR_LIST]) 189 AC_SUBST([ARGOT_SOCKADDR_LIST])
190 _GRECS_IF_OPTION_SET([sockaddr-list],[GRECS_SOCKADDR_LIST=1], 190 _ARGOT_IF_OPTION_SET([sockaddr-list],[ARGOT_SOCKADDR_LIST=1],
191 [GRECS_SOCKADDR_LIST=0]) 191 [ARGOT_SOCKADDR_LIST=0])
192 192
193 AC_SUBST([GRECS_TREE_API]) 193 AC_SUBST([ARGOT_TREE_API])
194 _GRECS_IF_OPTION_SET([tree-api],[GRECS_TREE_API=1],[GRECS_TREE_API=0]) 194 _ARGOT_IF_OPTION_SET([tree-api],[ARGOT_TREE_API=1],[ARGOT_TREE_API=0])
195 195
196 AC_SUBST([GRECS_SRCDIR],$1) 196 AC_SUBST([ARGOT_SRCDIR],$1)
197 AC_SUBST([GRECS_BUILD_AUX]) 197 AC_SUBST([ARGOT_BUILD_AUX])
198 AC_SUBST([GRECS_INCLUDES]) 198 AC_SUBST([ARGOT_INCLUDES])
199 AC_SUBST([GRECS_TESTDIR]) 199 AC_SUBST([ARGOT_TESTDIR])
200 AC_SUBST([GRECS_LDADD]) 200 AC_SUBST([ARGOT_LDADD])
201 AC_SUBST([GRECS_DOCDIR]) 201 AC_SUBST([ARGOT_DOCDIR])
202 AC_SUBST([GRECS_CHANGELOG]) 202 AC_SUBST([ARGOT_CHANGELOG])
203 AC_SUBST([GRECS_DISTCK_AT]) 203 AC_SUBST([ARGOT_DISTCK_AT])
204 AC_SUBST([GRECS_README]) 204 AC_SUBST([ARGOT_README])
205 AC_SUBST([GRECS_INCLUDES],['-I$(top_srcdir)/]grecsdir[include] [-I$(top_builddir)/]grecsdir[include]') 205 AC_SUBST([ARGOT_INCLUDES],['-I$(top_srcdir)/]argotdir[include] [-I$(top_builddir)/]argotdir[include]')
206 AC_SUBST([GRECS_HOST_PROJECT_INCLUDES]) 206 AC_SUBST([ARGOT_HOST_PROJECT_INCLUDES])
207 AC_SUBST([GRECS_DISTDOC]) 207 AC_SUBST([ARGOT_DISTDOC])
208 AC_SUBST([GRECS_INCLUDE_DIR],['$(pkgincludedir)']) 208 AC_SUBST([ARGOT_INCLUDE_DIR],['$(pkgincludedir)'])
209 209
210 _GRECS_OPTION_SWITCH([install],[ 210 _ARGOT_OPTION_SWITCH([install],[
211 LT_INIT 211 LT_INIT
212 GRECS_BUILD_TYPE=install 212 ARGOT_BUILD_TYPE=install
213 GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.la'] 213 ARGOT_LDADD=['$(top_builddir)/]argotdir[src/libargot.la']
214 GRECS_DOCDIR='doc' 214 ARGOT_DOCDIR='doc'
215 GRECS_CHANGELOG= 215 ARGOT_CHANGELOG=
216 GRECS_DISTCK_AT=distck.at 216 ARGOT_DISTCK_AT=distck.at
217 GRECS_README=README.standalone 217 ARGOT_README=README.standalone
218 AC_CONFIG_FILES(grecsdir[src/Makefile]:grecsdir[src/Make-inst.in] 218 AC_CONFIG_FILES(argotdir[src/Makefile]:argotdir[src/Make-inst.in]
219 grecsdir[doc/Makefile]) 219 argotdir[doc/Makefile])
220 ],[shared],[ 220 ],[shared],[
221 LT_INIT 221 LT_INIT
222 GRECS_BUILD_TYPE=shared 222 ARGOT_BUILD_TYPE=shared
223 GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.la'] 223 ARGOT_LDADD=['$(top_builddir)/]argotdir[src/libargot.la']
224 GRECS_CHANGELOG='#' 224 ARGOT_CHANGELOG='#'
225 GRECS_README=README.submodule 225 ARGOT_README=README.submodule
226 _GRECS_IF_OPTION_SET([syntax-doc],[GRECS_DISTDOC=doc/grecs-syntax.texi]) 226 _ARGOT_IF_OPTION_SET([syntax-doc],[ARGOT_DISTDOC=doc/argot-syntax.texi])
227 AC_CONFIG_FILES(grecsdir[src/Makefile]:grecsdir[src/Make-shared.in]) 227 AC_CONFIG_FILES(argotdir[src/Makefile]:argotdir[src/Make-shared.in])
228 ],[ 228 ],[
229 GRECS_BUILD_TYPE=static 229 ARGOT_BUILD_TYPE=static
230 GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.a'] 230 ARGOT_LDADD=['$(top_builddir)/]argotdir[src/libargot.a']
231 GRECS_CHANGELOG='#' 231 ARGOT_CHANGELOG='#'
232 GRECS_README=README.submodule 232 ARGOT_README=README.submodule
233 _GRECS_IF_OPTION_SET([syntax-doc],[GRECS_DISTDOC=doc/grecs-syntax.texi]) 233 _ARGOT_IF_OPTION_SET([syntax-doc],[ARGOT_DISTDOC=doc/argot-syntax.texi])
234 AC_CONFIG_FILES(grecsdir[src/Makefile]:grecsdir[src/Make-static.in]) 234 AC_CONFIG_FILES(argotdir[src/Makefile]:argotdir[src/Make-static.in])
235 ]) 235 ])
236 AM_CONDITIONAL([GRECS_COND_BUILD_INSTALL],[test $GRECS_BUILD_TYPE = install]) 236 AM_CONDITIONAL([ARGOT_COND_BUILD_INSTALL],[test $ARGOT_BUILD_TYPE = install])
237 AM_CONDITIONAL([GRECS_COND_BUILD_SHARED],[test $GRECS_BUILD_TYPE = shared]) 237 AM_CONDITIONAL([ARGOT_COND_BUILD_SHARED],[test $ARGOT_BUILD_TYPE = shared])
238 AM_CONDITIONAL([GRECS_COND_BUILD_STATIC],[test $GRECS_BUILD_TYPE = static]) 238 AM_CONDITIONAL([ARGOT_COND_BUILD_STATIC],[test $ARGOT_BUILD_TYPE = static])
239 239
240 AC_CONFIG_FILES(grecsdir[Makefile] 240 AC_CONFIG_FILES(argotdir[Makefile]
241 grecsdir[include/Makefile] 241 argotdir[include/Makefile]
242 grecsdir[include/grecs/Makefile] 242 argotdir[include/argot/Makefile]
243 grecsdir[include/grecs/types.h]:grecsdir[include/grecs/types.h.in]) 243 argotdir[include/argot/types.h]:argotdir[include/argot/types.h.in])
244 m4_popdef([grecsdir]) 244 m4_popdef([argotdir])
245]) 245])
diff --git a/build-aux/getopt.m4 b/build-aux/getopt.m4
index 86bac99..1b278bc 100644
--- a/build-aux/getopt.m4
+++ b/build-aux/getopt.m4
@@ -1,4 +1,4 @@
1dnl This file is part of grecs 1dnl This file is part of argot
2dnl Copyright (C) 2007-2016 Sergey Poznyakoff 2dnl Copyright (C) 2007-2016 Sergey Poznyakoff
3dnl 3dnl
4dnl Grecs is free software; you can redistribute it and/or modify 4dnl Grecs is free software; you can redistribute it and/or modify
@@ -254,11 +254,11 @@ popdef([<__GETOPT_SELECTOR>])>])
254 254
255dnl OPTNODE(name, value) 255dnl OPTNODE(name, value)
256define([<OPTNODE>],[<do { 256define([<OPTNODE>],[<do {
257 struct grecs_node *node = grecs_node_from_path($1, $2); 257 struct argot_node *node = argot_node_from_path($1, $2);
258 if (!cmdline_tree) 258 if (!cmdline_tree)
259 cmdline_tree = node; 259 cmdline_tree = node;
260 else 260 else
261 grecs_node_bind(cmdline_tree, node, 0); 261 argot_node_bind(cmdline_tree, node, 0);
262} while(0) 262} while(0)
263>]) 263>])
264 264
@@ -306,7 +306,7 @@ __GETOPT_LASTOPT
306>],[<$3 = optind;>]) 306>],[<$3 = optind;>])
307 if (cmdline_tree) 307 if (cmdline_tree)
308 { 308 {
309 struct grecs_node *rn = grecs_node_create(grecs_node_root, NULL); 309 struct argot_node *rn = argot_node_create(argot_node_root, NULL);
310 rn->down = cmdline_tree; 310 rn->down = cmdline_tree;
311 cmdline_tree = rn; 311 cmdline_tree = rn;
312 } 312 }
@@ -323,7 +323,7 @@ static char *subcommands[] = {
323 _getopt_sc_array($3) 323 _getopt_sc_array($3)
324 NULL 324 NULL
325};>]) 325};>])
326static struct grecs_proginfo proginfo = { 326static struct argot_proginfo proginfo = {
327 $2, /* progname */ 327 $2, /* progname */
328 ifelse([<$3>],,NULL,subcommands), /* subcommands */ 328 ifelse([<$3>],,NULL,subcommands), /* subcommands */
329 ifelse([<$4>],,"",N_("$4")), /* docstring */ 329 ifelse([<$4>],,"",N_("$4")), /* docstring */
@@ -344,7 +344,7 @@ _getopt_if_option_set([<copyright_holder>],dnl
344 PACKAGE_URL, /* url */ 344 PACKAGE_URL, /* url */
345 NULL /* epilogue */ 345 NULL /* epilogue */
346}; 346};
347static struct grecs_node *cmdline_tree; 347static struct argot_node *cmdline_tree;
348 348
349_getopt_if_option_set([<program_version>],dnl 349_getopt_if_option_set([<program_version>],dnl
350[<const char *_getopt_if_option_null(program_version,program_version,[<_getopt_get_option(program_version)>]) = $2 " (" PACKAGE_NAME ") " PACKAGE_VERSION; 350[<const char *_getopt_if_option_null(program_version,program_version,[<_getopt_get_option(program_version)>]) = $2 " (" PACKAGE_NAME ") " PACKAGE_VERSION;
@@ -374,20 +374,20 @@ _getopt_if_option_set([<gnu>],[<
374 GROUP([<Other options>]) 374 GROUP([<Other options>])
375 OPTION([<help>],h,,[<Give this help list>]) 375 OPTION([<help>],h,,[<Give this help list>])
376 BEGIN 376 BEGIN
377 grecs_print_help(&proginfo); 377 argot_print_help(&proginfo);
378 exit(0); 378 exit(0);
379 END 379 END
380_getopt_if_option_set([<nousage>],,[< 380_getopt_if_option_set([<nousage>],,[<
381 OPTION([<usage>],,,[<Give a short usage message>]) 381 OPTION([<usage>],,,[<Give a short usage message>])
382 BEGIN 382 BEGIN
383 grecs_print_usage(&proginfo); 383 argot_print_usage(&proginfo);
384 exit(0); 384 exit(0);
385 END>]) 385 END>])
386_getopt_if_option_set([<noversion>],,[< 386_getopt_if_option_set([<noversion>],,[<
387 OPTION([<version>],V,,[<Print program version>]) 387 OPTION([<version>],V,,[<Print program version>])
388 BEGIN 388 BEGIN
389 /* Give version */ 389 /* Give version */
390 grecs_print_version(&proginfo, stdout); 390 argot_print_version(&proginfo, stdout);
391 exit(0); 391 exit(0);
392 END>])>]) 392 END>])>])
393divert 393divert
@@ -400,8 +400,8 @@ _getopt_if_option_set([<nostdincl>],,[<
400#endif 400#endif
401#include <unistd.h> 401#include <unistd.h>
402>]) 402>])
403#include <grecs.h> 403#include <argot.h>
404#include <grecs/opt.h> 404#include <argot/opt.h>
405/* Option codes */ 405/* Option codes */
406enum { 406enum {
407 _OPTION_INIT=255, 407 _OPTION_INIT=255,
@@ -414,7 +414,7 @@ static struct option long_options[] = {
414 {0, 0, 0, 0} 414 {0, 0, 0, 0}
415}; 415};
416#endif 416#endif
417static struct grecs_opthelp opthelp[] = { 417static struct argot_opthelp opthelp[] = {
418 undivert(3) 418 undivert(3)
419}; 419};
420undivert(5) 420undivert(5)
diff --git a/build-aux/git2chg.awk b/build-aux/git2chg.awk
index 254bb02..e6278e3 100644
--- a/build-aux/git2chg.awk
+++ b/build-aux/git2chg.awk
@@ -1,4 +1,4 @@
1# This file is part of grecs 1# This file is part of argot
2# Copyright (C) 2007-2016 Sergey Poznyakoff 2# Copyright (C) 2007-2016 Sergey Poznyakoff
3# 3#
4# Grecs is free software; you can redistribute it and/or modify 4# Grecs is free software; you can redistribute it and/or modify
diff --git a/build-aux/yyrename b/build-aux/yyrename
index f23ee18..802cdb4 100755
--- a/build-aux/yyrename
+++ b/build-aux/yyrename
@@ -27,7 +27,7 @@
27# 27#
28# The prefix is looked up in the file yytrans, located in the INFILE's 28# The prefix is looked up in the file yytrans, located in the INFILE's
29# directory. If this file does not exist, the prefix is constructed 29# directory. If this file does not exist, the prefix is constructed
30# by concatenating the string 'grecs_' and the ``root name''. The root 30# by concatenating the string 'argot_' and the ``root name''. The root
31# name is built by removing '-lex.l' or '-gram.y' from the base name. 31# name is built by removing '-lex.l' or '-gram.y' from the base name.
32# If the latter does not end in any of these, the root name 32# If the latter does not end in any of these, the root name
33# is constructed by removing the suffix from the base name. 33# is constructed by removing the suffix from the base name.
@@ -85,7 +85,7 @@ else
85 pfx= 85 pfx=
86fi 86fi
87if test -z "$pfx"; then 87if test -z "$pfx"; then
88 pfx=grecs_`echo $root | tr .- __` 88 pfx=argot_`echo $root | tr .- __`
89fi 89fi
90 90
91eval $* || exit $? 91eval $* || exit $?
diff --git a/configure.ac b/configure.ac
index 6ffa55b..19e90ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,8 +15,8 @@
15# along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15# along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16 16
17AC_PREREQ(2.63) 17AC_PREREQ(2.63)
18AC_INIT([libgrecs], [1.0], [gray+grecs@gnu.org.ua]) 18AC_INIT([libargot], [1.0], [gray+argot@gnu.org.ua])
19AC_CONFIG_SRCDIR([src/grecs-gram.y]) 19AC_CONFIG_SRCDIR([src/argot-gram.y])
20AC_CONFIG_AUX_DIR([build-aux]) 20AC_CONFIG_AUX_DIR([build-aux])
21AC_CONFIG_HEADER([config.h]) 21AC_CONFIG_HEADER([config.h])
22AM_INIT_AUTOMAKE([1.11 gnu tar-ustar dist-xz std-options silent-rules]) 22AM_INIT_AUTOMAKE([1.11 gnu tar-ustar dist-xz std-options silent-rules])
@@ -37,6 +37,6 @@ AC_HEADER_STDC
37 37
38# Grecs subsystem 38# Grecs subsystem
39 39
40GRECS_SETUP(., [install tests git2chg all-parsers json]) 40ARGOT_SETUP(., [install tests git2chg all-parsers json])
41 41
42AC_OUTPUT 42AC_OUTPUT
diff --git a/doc/GRECS_SETUP.3 b/doc/ARGOT_SETUP.3
index 8aa086a..3c18d1e 100644
--- a/doc/GRECS_SETUP.3
+++ b/doc/ARGOT_SETUP.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,14 +14,14 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_SETUP 3 "August 13, 2012" "GRECS" "Grecs User Reference" 17.TH ARGOT_SETUP 3 "August 13, 2012" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19GRECS_SETUP \- Initialize \fBgrecs\fR submodule. 19ARGOT_SETUP \- Initialize \fBargot\fR submodule.
20.SH SYNOPSIS 20.SH SYNOPSIS
21.BI "GRECS_SETUP(" "dir" ", " "options" ", " "pp-setup-file" ) 21.BI "ARGOT_SETUP(" "dir" ", " "options" ", " "pp-setup-file" )
22.SH DESCRIPTION 22.SH DESCRIPTION
23The \fBGRECS_SETUP\fR macro is invoked from the host project's 23The \fBARGOT_SETUP\fR macro is invoked from the host project's
24\fBconfigure.ac\fR. It initializes the \fBgrecs\fR submodule 24\fBconfigure.ac\fR. It initializes the \fBargot\fR submodule
25variables for compilation within that project. 25variables for compilation within that project.
26.PP 26.PP
27All arguments are optional. 27All arguments are optional.
@@ -29,15 +29,15 @@ All arguments are optional.
29The 29The
30.I dir 30.I dir
31argument specifies the directory, relative to the source tree top, 31argument specifies the directory, relative to the source tree top,
32where \fBgrecs\fR has been cloned. If omitted, \fBgrecs\fR is assumed. 32where \fBargot\fR has been cloned. If omitted, \fBargot\fR is assumed.
33.sp 33.sp
34For example, if \fBgrecs\fR was cloned using the following command: 34For example, if \fBargot\fR was cloned using the following command:
35.sp 35.sp
36.nf 36.nf
37 git clone ssh://git.gnu.org.ua/gitroot/grecs.git lib/grecs 37 git clone ssh://git.gnu.org.ua/gitroot/argot.git lib/argot
38.fi 38.fi
39.sp 39.sp
40then the \fIdir\fR argument must be \fBlib/grecs\fR. 40then the \fIdir\fR argument must be \fBlib/argot\fR.
41.PP 41.PP
42The 42The
43.I options 43.I options
@@ -63,19 +63,19 @@ Build the parser for MeTA1 configuration files.
63Disable the use of preprocessor. 63Disable the use of preprocessor.
64.TP 64.TP
65.B install 65.B install
66Create and install shared library \fBlibgrecs.so\fR. Install the 66Create and install shared library \fBlibargot.so\fR. Install the
67documentation as well. 67documentation as well.
68.TP 68.TP
69.B shared 69.B shared
70Create a shared convenience library. By default, a static library is 70Create a shared convenience library. By default, a static library is
71created. Use this option if you want to incorporate grecs into another 71created. Use this option if you want to incorporate argot into another
72shared library. 72shared library.
73.TP 73.TP
74.B install-header 74.B install-header
75Install header files. This option is valid only when used together 75Install header files. This option is valid only when used together
76with \fBshared\fR. Header files will be installed in 76with \fBshared\fR. Header files will be installed in
77\fBpkgincludedir\fR. To select another installation directory, define 77\fBpkgincludedir\fR. To select another installation directory, define
78the variable \fBGRECS_INCLUDE_DIR\fR to the name of that directory. 78the variable \fBARGOT_INCLUDE_DIR\fR to the name of that directory.
79.TP 79.TP
80.B std-pp-setup 80.B std-pp-setup
81Install the standard \fBpp-setup\fR file. 81Install the standard \fBpp-setup\fR file.
@@ -98,7 +98,7 @@ Add \fBgit2chg.awk\fR to the distributed tarball. The file is located
98in \fIdir\fR/build-aux. 98in \fIdir\fR/build-aux.
99.TP 99.TP
100.B syntax-doc 100.B syntax-doc
101Add \fBdoc/grecs-syntax.texi\fR file to the distributed tarball. Use this 101Add \fBdoc/argot-syntax.texi\fR file to the distributed tarball. Use this
102if your texinfo documentation includes that file. 102if your texinfo documentation includes that file.
103.PP 103.PP
104The 104The
@@ -117,17 +117,17 @@ parameter are supplied, no preprocessor setup file is installed.
117.SS "Default setup" 117.SS "Default setup"
118.RS 4 118.RS 4
119.nf 119.nf
120GRECS_SETUP 120ARGOT_SETUP
121.fi 121.fi
122.RE 122.RE
123.SS "Complex setup" 123.SS "Complex setup"
124The library sources are in \fBlib/grecs\fR. Configure the testsuite 124The library sources are in \fBlib/argot\fR. Configure the testsuite
125and add the \fBgetopt.m4\fR file to the distribution. Install 125and add the \fBgetopt.m4\fR file to the distribution. Install
126preprocessor setup file from \fBsrc/pp-setup\fR: 126preprocessor setup file from \fBsrc/pp-setup\fR:
127.sp 127.sp
128.RS 4 128.RS 4
129.nf 129.nf
130GRECS_SETUP(lib/grecs, [tests getopt], [$(top_srcdir)/src/pp-setup]) 130ARGOT_SETUP(lib/argot, [tests getopt], [$(top_srcdir)/src/pp-setup])
131.RE 131.RE
132.SH "SEE ALSO" 132.SH "SEE ALSO"
133.BR getopt.m4 (5), 133.BR getopt.m4 (5),
@@ -135,11 +135,11 @@ GRECS_SETUP(lib/grecs, [tests getopt], [$(top_srcdir)/src/pp-setup])
135.SH AUTHORS 135.SH AUTHORS
136Sergey Poznyakoff 136Sergey Poznyakoff
137.SH "BUG REPORTS" 137.SH "BUG REPORTS"
138Report bugs to <gray+grecs@gnu.org.ua>. 138Report bugs to <gray+argot@gnu.org.ua>.
139.SH COLOPHON 139.SH COLOPHON
140The \fBGrecs\fR library is constantly changing, so this manual page 140The \fBGrecs\fR library is constantly changing, so this manual page
141may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 141may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
142documentation, visit <http://www.gnu.org.ua/software/grecs>. 142documentation, visit <http://www.gnu.org.ua/software/argot>.
143.SH COPYRIGHT 143.SH COPYRIGHT
144Copyright \(co 2011 Sergey Poznyakoff 144Copyright \(co 2011 Sergey Poznyakoff
145.br 145.br
diff --git a/doc/Makefile.am b/doc/Makefile.am
index a646367..ac32a36 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,4 +1,4 @@
1# This file is part of grecs - Gray's Extensible Configuration System 1# This file is part of argot - Gray's Extensible Configuration System
2# Copyright (C) 2007-2016 Sergey Poznyakoff 2# Copyright (C) 2007-2016 Sergey Poznyakoff
3# 3#
4# Grecs is free software; you can redistribute it and/or modify 4# Grecs is free software; you can redistribute it and/or modify
@@ -15,19 +15,19 @@
15# along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15# along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16 16
17dist_man_MANS = \ 17dist_man_MANS = \
18 GRECS_SETUP.3\ 18 ARGOT_SETUP.3\
19 grecs_asprintf.3\ 19 argot_asprintf.3\
20 grecs_config.5\ 20 argot_config.5\
21 grecs_error.3\ 21 argot_error.3\
22 grecs_format_locus.3\ 22 argot_format_locus.3\
23 grecs_format_node_path.3\ 23 argot_format_node_path.3\
24 grecs_format_node.3\ 24 argot_format_node.3\
25 grecs_format_value.3\ 25 argot_format_value.3\
26 grecs_include_path_setup.3\ 26 argot_include_path_setup.3\
27 grecs_malloc.3\ 27 argot_malloc.3\
28 grecs_node_free.3\ 28 argot_node_free.3\
29 grecs_parse.3\ 29 argot_parse.3\
30 grecs_stmt_path.5\ 30 argot_stmt_path.5\
31 grecs_strdup.3\ 31 argot_strdup.3\
32 grecs_tree_free.3 32 argot_tree_free.3
33 33
diff --git a/doc/grecs-syntax.texi b/doc/argot-syntax.texi
index 2ddedea..db81133 100644
--- a/doc/grecs-syntax.texi
+++ b/doc/argot-syntax.texi
@@ -1,4 +1,4 @@
1@c This file is part of grecs - Gray's Extensible Configuration System 1@c This file is part of argot - Gray's Extensible Configuration System
2@c Copyright (C) 2007-2016 Sergey Poznyakoff 2@c Copyright (C) 2007-2016 Sergey Poznyakoff
3@c 3@c
4@c Grecs is free software; you can redistribute it and/or modify 4@c Grecs is free software; you can redistribute it and/or modify
@@ -20,7 +20,7 @@
20@c @lowersections: 20@c @lowersections:
21@c 21@c
22@c @raisesections 22@c @raisesections
23@c @include grecs-syntax.texi 23@c @include argot-syntax.texi
24@c @lowersections 24@c @lowersections
25@c 25@c
26@c 2. This texinfo source refers to the following values: 26@c 2. This texinfo source refers to the following values:
@@ -219,8 +219,8 @@ physical lines, e.g.:
219 If the character following a backslash is not one of those specified 219 If the character following a backslash is not one of those specified
220above, the backslash is ignored and a warning is issued. 220above, the backslash is ignored and a warning is issued.
221 221
222@c FIXME: If grecs_parser_options variable has 222@c FIXME: If argot_parser_options variable has
223@c FIXME: GRECS_OPTION_QUOTED_STRING_CONCAT bit set, then the 223@c FIXME: ARGOT_OPTION_QUOTED_STRING_CONCAT bit set, then the
224@c FIXME: following holds: 224@c FIXME: following holds:
225 225
226@ignore 226@ignore
diff --git a/doc/grecs_asprintf.3 b/doc/argot_asprintf.3
index 25279be..fa86190 100644
--- a/doc/grecs_asprintf.3
+++ b/doc/argot_asprintf.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,25 +14,25 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_ASPRINTF 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_ASPRINTF 3 "May 4, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_asprintf, grecs_vasprintf \- print to allocated string 19argot_asprintf, argot_vasprintf \- print to allocated string
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "int grecs_vasprintf(char " "**pbuf" ", size_t " "*psize" \ 24.BI "int argot_vasprintf(char " "**pbuf" ", size_t " "*psize" \
25 ", const char " "*format" ", " 25 ", const char " "*format" ", "
26.ti +17 26.ti +17
27.BI "va_list " "ap" ); 27.BI "va_list " "ap" );
28.br 28.br
29.BI "int grecs_asprintf(char " "**pbuf" ", size_t " "*psize" \ 29.BI "int argot_asprintf(char " "**pbuf" ", size_t " "*psize" \
30 ", const char *" "format" ", ...);" 30 ", const char *" "format" ", ...);"
31.SH DESCRIPTION 31.SH DESCRIPTION
32The functions 32The functions
33.BI grecs_asprintf () 33.BI argot_asprintf ()
34and 34and
35.BI grecs_vasprintf () 35.BI argot_vasprintf ()
36are analogs of 36are analogs of
37.BR sprintf (3) 37.BR sprintf (3)
38and 38and
@@ -52,23 +52,23 @@ In both cases, if the buffer has been reallocated, on return
52\fBpbuf\fR will contain its new address and \fBpsize\fR its new size. 52\fBpbuf\fR will contain its new address and \fBpsize\fR its new size.
53.PP 53.PP
54For initial allocation, 54For initial allocation,
55.BR grecs_malloc (3) 55.BR argot_malloc (3)
56is used. To reallocate memory, both functions use 56is used. To reallocate memory, both functions use
57.BR grecs_realloc (3). 57.BR argot_realloc (3).
58.SH RETURN VALUE 58.SH RETURN VALUE
59None. If memory allocation fails, a diagnostics is output and the 59None. If memory allocation fails, a diagnostics is output and the
60program is terminated. 60program is terminated.
61.SH "SEE ALSO" 61.SH "SEE ALSO"
62.BR grecs_malloc (3), 62.BR argot_malloc (3),
63.BR grecs_realloc (3). 63.BR argot_realloc (3).
64.SH AUTHORS 64.SH AUTHORS
65Sergey Poznyakoff 65Sergey Poznyakoff
66.SH "BUG REPORTS" 66.SH "BUG REPORTS"
67Report bugs to <gray+grecs@gnu.org.ua>. 67Report bugs to <gray+argot@gnu.org.ua>.
68.SH COLOPHON 68.SH COLOPHON
69The \fBGrecs\fR library is constantly changing, so this manual page 69The \fBGrecs\fR library is constantly changing, so this manual page
70may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 70may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
71documentation, visit <http://www.gnu.org.ua/software/grecs>. 71documentation, visit <http://www.gnu.org.ua/software/argot>.
72.SH COPYRIGHT 72.SH COPYRIGHT
73Copyright \(co 2011 Sergey Poznyakoff 73Copyright \(co 2011 Sergey Poznyakoff
74.br 74.br
diff --git a/doc/grecs_config.5 b/doc/argot_config.5
index 5fdaed4..abd6420 100644
--- a/doc/grecs_config.5
+++ b/doc/argot_config.5
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_CONFIG 3 "December 25, 2014" "GRECS" "Grecs User Reference" 17.TH ARGOT_CONFIG 3 "December 25, 2014" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19\fBGrecs\fR configuration file syntax 19\fBGrecs\fR configuration file syntax
20.SH DESCRIPTION 20.SH DESCRIPTION
@@ -94,11 +94,11 @@ the program which uses the configuration file, and \fIVERSION\fR for
94its version number. 94its version number.
95.sp 95.sp
96The include search path can be modified using the 96The include search path can be modified using the
97.BI grecs_include_path_setup () 97.BI argot_include_path_setup ()
98and 98and
99.BI grecs_include_path_setup_v () 99.BI argot_include_path_setup_v ()
100functions. Refer to 100functions. Refer to
101.BR grecs_include_path_setup (3), 101.BR argot_include_path_setup (3),
102for a detailed discussion. 102for a detailed discussion.
103.TP 103.TP
104.BR "#include_once <" "file" > 104.BR "#include_once <" "file" >
@@ -323,17 +323,17 @@ advantage that it works with non-GNU m4 implementations as
323well. 323well.
324.SH "SEE ALSO" 324.SH "SEE ALSO"
325.BR m4 (1), 325.BR m4 (1),
326.BR grecs_parse (3), 326.BR argot_parse (3),
327.BR grecs_include_path_setup (3), 327.BR argot_include_path_setup (3),
328.BR grecs_tree_process (3). 328.BR argot_tree_process (3).
329.SH AUTHORS 329.SH AUTHORS
330Sergey Poznyakoff 330Sergey Poznyakoff
331.SH "BUG REPORTS" 331.SH "BUG REPORTS"
332Report bugs to <gray+grecs@gnu.org.ua>. 332Report bugs to <gray+argot@gnu.org.ua>.
333.SH COLOPHON 333.SH COLOPHON
334The \fBGrecs\fR library is constantly changing, so this manual page 334The \fBGrecs\fR library is constantly changing, so this manual page
335may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 335may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
336documentation, visit <http://www.gnu.org.ua/software/grecs>. 336documentation, visit <http://www.gnu.org.ua/software/argot>.
337.SH COPYRIGHT 337.SH COPYRIGHT
338Copyright \(co 2011 Sergey Poznyakoff 338Copyright \(co 2011 Sergey Poznyakoff
339.br 339.br
diff --git a/doc/grecs_error.3 b/doc/argot_error.3
index a020d36..ab623dc 100644
--- a/doc/grecs_error.3
+++ b/doc/argot_error.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,29 +14,29 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_ERROR 3 "July 1, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_ERROR 3 "July 1, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_error, grecs_warning \- grecs error reporting functions 19argot_error, argot_warning \- argot error reporting functions
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "void grecs_error(grecs_locus_t " "*locus" ", int " "errnum" ", " 24.BI "void argot_error(argot_locus_t " "*locus" ", int " "errnum" ", "
25.ti +17 25.ti +17
26.BI "const char " "*format" ", ...);" 26.BI "const char " "*format" ", ...);"
27.br 27.br
28.BI "void grecs_warning(grecs_locus_t " "*locus" ", int " "errnum" ", " 28.BI "void argot_warning(argot_locus_t " "*locus" ", int " "errnum" ", "
29.ti +17 29.ti +17
30.BI "const char " "*format" ", ...);" 30.BI "const char " "*format" ", ...);"
31.sp 31.sp
32.BI "void (*grecs_print_diag_fun)(grecs_locus_t " "*locus" ", " 32.BI "void (*argot_print_diag_fun)(argot_locus_t " "*locus" ", "
33.ti +17 33.ti +17
34.BI "int " "err" ", int " "errnum" ", const char " "*msg" ); 34.BI "int " "err" ", int " "errnum" ", const char " "*msg" );
35.sp 35.sp
36.B extern int grecs_error_count; 36.B extern int argot_error_count;
37.SH DESCRIPTION 37.SH DESCRIPTION
38.BI grecs_error () 38.BI argot_error ()
39is a error reporting function for \fBgrecs\fR library. It flushes 39is a error reporting function for \fBargot\fR library. It flushes
40stdout, and outputs to stderr the file name and line number, as 40stdout, and outputs to stderr the file name and line number, as
41supplied by the 41supplied by the
42.BI locus 42.BI locus
@@ -52,22 +52,22 @@ If \fIlocus\fR is \fBNULL\fR, it is ignored and no file location is
52printed. 52printed.
53.PP 53.PP
54Each call to 54Each call to
55.BI grecs_error () 55.BI argot_error ()
56increments the value of the 56increments the value of the
57.BI grecs_error_count 57.BI argot_error_count
58global variable. 58global variable.
59The 59The
60.BI grecs_warning () 60.BI argot_warning ()
61function works the same as 61function works the same as
62.BI grecs_error (), 62.BI argot_error (),
63except that it outputs, before the formatted message and after the 63except that it outputs, before the formatted message and after the
64file location, the word \fBwarning\fR, followed by a semicolon 64file location, the word \fBwarning\fR, followed by a semicolon
65and a space character. It does not modify the 65and a space character. It does not modify the
66.BI grecs_error_count 66.BI argot_error_count
67variable. 67variable.
68.PP 68.PP
69Calling program can modify the behavior of both functions by setting 69Calling program can modify the behavior of both functions by setting
70.BI grecs_print_diag_fun 70.BI argot_print_diag_fun
71to the address of a custom error-reporting function. This function is 71to the address of a custom error-reporting function. This function is
72called with the following arguments: 72called with the following arguments:
73.TP 73.TP
@@ -86,21 +86,21 @@ System error code, or \fB0\fR, if no system error occurred.
86.I msg 86.I msg
87Formatted message. 87Formatted message.
88.PP 88.PP
89The \fBgrecs_locus_t\fR structure consists of two \fBpoints\fR, each 89The \fBargot_locus_t\fR structure consists of two \fBpoints\fR, each
90point describing the beginning and the end of the input fragment in 90point describing the beginning and the end of the input fragment in
91question: 91question:
92.sp 92.sp
93.nf 93.nf
94.in +5 94.in +5
95struct grecs_locus_point { 95struct argot_locus_point {
96 char *file; 96 char *file;
97 unsigned line; 97 unsigned line;
98 unsigned col; 98 unsigned col;
99}; 99};
100typedef struct { 100typedef struct {
101 struct grecs_locus_point beg; 101 struct argot_locus_point beg;
102 struct grecs_locus_point end; 102 struct argot_locus_point end;
103} grecs_locus_t; 103} argot_locus_t;
104.in 104.in
105.fi 105.fi
106.PP 106.PP
@@ -109,7 +109,7 @@ member contains the input line number and the \fBcol\fR member
109contains the column number. Both lines and columns are numbered from 109contains the column number. Both lines and columns are numbered from
1101. 1101.
111.PP 111.PP
112On output, the \fBgrecs_locus_t\fR structure is formatted as follows: 112On output, the \fBargot_locus_t\fR structure is formatted as follows:
113.sp 113.sp
114.nf 114.nf
115.in +5 115.in +5
@@ -160,11 +160,11 @@ None.
160.SH AUTHORS 160.SH AUTHORS
161Sergey Poznyakoff 161Sergey Poznyakoff
162.SH "BUG REPORTS" 162.SH "BUG REPORTS"
163Report bugs to <gray+grecs@gnu.org.ua>. 163Report bugs to <gray+argot@gnu.org.ua>.
164.SH COLOPHON 164.SH COLOPHON
165The \fBGrecs\fR library is constantly changing, so this manual page 165The \fBGrecs\fR library is constantly changing, so this manual page
166may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 166may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
167documentation, visit <http://www.gnu.org.ua/software/grecs>. 167documentation, visit <http://www.gnu.org.ua/software/argot>.
168.SH COPYRIGHT 168.SH COPYRIGHT
169Copyright \(co 2011 Sergey Poznyakoff 169Copyright \(co 2011 Sergey Poznyakoff
170.br 170.br
diff --git a/doc/grecs_format_locus.3 b/doc/argot_format_locus.3
index 5ab3542..52bfc3d 100644
--- a/doc/grecs_format_locus.3
+++ b/doc/argot_format_locus.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,27 +14,27 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_FORMAT_LOCUS 3 "May 19, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_FORMAT_LOCUS 3 "May 19, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_format_locus \- format and output source file location 19argot_format_locus \- format and output source file location
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "void grecs_format_locus(grecs_locus_t " "*locus" "," 24.BI "void argot_format_locus(argot_locus_t " "*locus" ","
25.ti +17 25.ti +17
26.BI "struct grecs_format_closure " "*clos" ); 26.BI "struct argot_format_closure " "*clos" );
27.sp 27.sp
28.BI "void grecs_print_locus(grecs_locus_t " "*locus" ", FILE " "*fp" ); 28.BI "void argot_print_locus(argot_locus_t " "*locus" ", FILE " "*fp" );
29 29
30.SH DESCRIPTION 30.SH DESCRIPTION
31\fBgrecs_print_locus\fR formats the location from \fIlocus\fR in the 31\fBargot_print_locus\fR formats the location from \fIlocus\fR in the
32human-readable form and outputs it using the format closure 32human-readable form and outputs it using the format closure
33\fIclos\fR. The closure is defined as: 33\fIclos\fR. The closure is defined as:
34.sp 34.sp
35.nf 35.nf
36.in +5 36.in +5
37struct grecs_format_closure 37struct argot_format_closure
38{ 38{
39 int (*fmtfun)(const char *str, void *data); 39 int (*fmtfun)(const char *str, void *data);
40 void *data; 40 void *data;
@@ -47,7 +47,7 @@ be called one or more times. On each invocation, it is supplied with
47the string to be output as its first argument, and pointer to 47the string to be output as its first argument, and pointer to
48\fBdata\fR as the second one. 48\fBdata\fR as the second one.
49.PP 49.PP
50\fBgrecs_print_locus\fR is an alternative interface, which formats the 50\fBargot_print_locus\fR is an alternative interface, which formats the
51location from \fIlocus\fR in the human-readable form and outputs it to 51location from \fIlocus\fR in the human-readable form and outputs it to
52file \fBfp\fR. 52file \fBfp\fR.
53.PP 53.PP
@@ -60,21 +60,21 @@ doing anything.
60None. 60None.
61.SH NOTES 61.SH NOTES
62This are auxiliary functions used by 62This are auxiliary functions used by
63.BR grecs_format_node (3) 63.BR argot_format_node (3)
64and 64and
65.BR grecs_print_node (3), 65.BR argot_print_node (3),
66correspondingly. They are is seldom needed in user programs. 66correspondingly. They are is seldom needed in user programs.
67.SH "SEE ALSO" 67.SH "SEE ALSO"
68.BR grecs_format_node (3), 68.BR argot_format_node (3),
69.BR grecs_print_node (3). 69.BR argot_print_node (3).
70.SH AUTHORS 70.SH AUTHORS
71Sergey Poznyakoff 71Sergey Poznyakoff
72.SH "BUG REPORTS" 72.SH "BUG REPORTS"
73Report bugs to <gray+grecs@gnu.org.ua>. 73Report bugs to <gray+argot@gnu.org.ua>.
74.SH COLOPHON 74.SH COLOPHON
75The \fBGrecs\fR library is constantly changing, so this manual page 75The \fBGrecs\fR library is constantly changing, so this manual page
76may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 76may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
77documentation, visit <http://www.gnu.org.ua/software/grecs>. 77documentation, visit <http://www.gnu.org.ua/software/argot>.
78.SH COPYRIGHT 78.SH COPYRIGHT
79Copyright \(co 2011 Sergey Poznyakoff 79Copyright \(co 2011 Sergey Poznyakoff
80.br 80.br
diff --git a/doc/grecs_format_node.3 b/doc/argot_format_node.3
index bf2b8db..3e0a9fb 100644
--- a/doc/grecs_format_node.3
+++ b/doc/argot_format_node.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,26 +14,26 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_FORMAT_NODE 3 "May 19, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_FORMAT_NODE 3 "May 19, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_format_node \- format and print a single node from a syntax tree 19argot_format_node \- format and print a single node from a syntax tree
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "void grecs_format_node(struct grecs_node *" "node" ", int " \ 24.BI "void argot_format_node(struct argot_node *" "node" ", int " \
25 "flags" "," 25 "flags" ","
26.ti +17 26.ti +17
27.BI "struct grecs_format_closure " "*clos" ); 27.BI "struct argot_format_closure " "*clos" );
28.sp 28.sp
29.BI "void grecs_print_node(struct grecs_node *" "node" ", int " \ 29.BI "void argot_print_node(struct argot_node *" "node" ", int " \
30 "flags" ", FILE " "*fp" ); 30 "flags" ", FILE " "*fp" );
31.SH DESCRIPTION 31.SH DESCRIPTION
32\fBgrecs_format_node\fR formats the contents of a parse tree node 32\fBargot_format_node\fR formats the contents of a parse tree node
33\fInode\fR, according to formatting options, given by \fIflags\fR. The 33\fInode\fR, according to formatting options, given by \fIflags\fR. The
34formatter closure \fIclos\fR is used for actual output. 34formatter closure \fIclos\fR is used for actual output.
35.PP 35.PP
36\fBgrecs_print_node\fR is an alternative entry point, which formats 36\fBargot_print_node\fR is an alternative entry point, which formats
37the node to the given file. 37the node to the given file.
38.PP 38.PP
39The \fBflags\fR argument is a bitwise \fBOR\fR of one or more of the 39The \fBflags\fR argument is a bitwise \fBOR\fR of one or more of the
@@ -43,49 +43,49 @@ following options:
43This character will be used as pathname component separator, instead 43This character will be used as pathname component separator, instead
44of the default dot. 44of the default dot.
45.TP 45.TP
46.B GRECS_NODE_FLAG_LOCUS 46.B ARGOT_NODE_FLAG_LOCUS
47Print the source location. The location is printed as the file name, 47Print the source location. The location is printed as the file name,
48followed by a semicolon, followed by the line number and another 48followed by a semicolon, followed by the line number and another
49semicolon. Locations are separated from the rest of output by a single 49semicolon. Locations are separated from the rest of output by a single
50space character. 50space character.
51.TP 51.TP
52.B GRECS_NODE_FLAG_PATH 52.B ARGOT_NODE_FLAG_PATH
53Print the \fInode path\fR. See 53Print the \fInode path\fR. See
54.BR grecs_stmt_path (5), 54.BR argot_stmt_path (5),
55for a description. If printed, the path is separated from the 55for a description. If printed, the path is separated from the
56remaining output on its right by a semicolon and a space. 56remaining output on its right by a semicolon and a space.
57.TP 57.TP
58.B GRECS_NODE_FLAG_VALUE 58.B ARGOT_NODE_FLAG_VALUE
59Print the node value. 59Print the node value.
60.TP 60.TP
61.B GRECS_NODE_FLAG_QUOTE 61.B ARGOT_NODE_FLAG_QUOTE
62Always quote the value. By default, the value will be quoted only 62Always quote the value. By default, the value will be quoted only
63when necessary, i.e. if it contains white space, quotes or special 63when necessary, i.e. if it contains white space, quotes or special
64characters. This option is useful only together with 64characters. This option is useful only together with
65\fBGRECS_NODE_FLAG_VALUE\fR. 65\fBARGOT_NODE_FLAG_VALUE\fR.
66.TP 66.TP
67.B GRECS_NODE_FLAG_NOQUOTE 67.B ARGOT_NODE_FLAG_NOQUOTE
68Never quote values. If both \fBGRECS_NODE_FLAG_QUOTE\fR and 68Never quote values. If both \fBARGOT_NODE_FLAG_QUOTE\fR and
69\fBGRECS_NODE_FLAG_NOQUOTE\fR are given, the former takes precedence 69\fBARGOT_NODE_FLAG_NOQUOTE\fR are given, the former takes precedence
70over the latter. 70over the latter.
71.TP 71.TP
72.B GRECS_NODE_FLAG_QUOTE_HEX 72.B ARGOT_NODE_FLAG_QUOTE_HEX
73Print non-printable characters as C hex escapets. This option is 73Print non-printable characters as C hex escapets. This option is
74ignored if \fBGRECS_NODE_FLAG_NOQUOTE\fR is set. 74ignored if \fBARGOT_NODE_FLAG_NOQUOTE\fR is set.
75.TP 75.TP
76.B GRECS_NODE_FLAG_DEFAULT 76.B ARGOT_NODE_FLAG_DEFAULT
77Same as 77Same as
78.sp 78.sp
79.nf 79.nf
80GRECS_NODE_FLAG_PATH|GRECS_NODE_FLAG_VALUE|GRECS_NODE_FLAG_QUOTE 80ARGOT_NODE_FLAG_PATH|ARGOT_NODE_FLAG_VALUE|ARGOT_NODE_FLAG_QUOTE
81.PP 81.PP
82If \fBflag\fR is 0, \fBGRECS_NODE_FLAG_DEFAULT\fR is assumed. 82If \fBflag\fR is 0, \fBARGOT_NODE_FLAG_DEFAULT\fR is assumed.
83.SH CLOSURE 83.SH CLOSURE
84The format closure is defined as: 84The format closure is defined as:
85.sp 85.sp
86.nf 86.nf
87.in +5 87.in +5
88struct grecs_format_closure 88struct argot_format_closure
89{ 89{
90 int (*fmtfun)(const char *str, void *data); 90 int (*fmtfun)(const char *str, void *data);
91 void *data; 91 void *data;
@@ -100,16 +100,16 @@ the string to be output as its first argument, and pointer to
100.SH "RETURN VALUE" 100.SH "RETURN VALUE"
101None. 101None.
102.SH "SEE ALSO" 102.SH "SEE ALSO"
103.BR grecs_config (5), 103.BR argot_config (5),
104.BR grecs_stmt_path (5). 104.BR argot_stmt_path (5).
105.SH AUTHORS 105.SH AUTHORS
106Sergey Poznyakoff 106Sergey Poznyakoff
107.SH "BUG REPORTS" 107.SH "BUG REPORTS"
108Report bugs to <gray+grecs@gnu.org.ua>. 108Report bugs to <gray+argot@gnu.org.ua>.
109.SH COLOPHON 109.SH COLOPHON
110The \fBGrecs\fR library is constantly changing, so this manual page 110The \fBGrecs\fR library is constantly changing, so this manual page
111may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 111may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
112documentation, visit <http://www.gnu.org.ua/software/grecs>. 112documentation, visit <http://www.gnu.org.ua/software/argot>.
113.SH COPYRIGHT 113.SH COPYRIGHT
114Copyright \(co 2011 Sergey Poznyakoff 114Copyright \(co 2011 Sergey Poznyakoff
115.br 115.br
diff --git a/doc/grecs_format_node_path.3 b/doc/argot_format_node_path.3
index 0d4fa85..e85e2bb 100644
--- a/doc/grecs_format_node_path.3
+++ b/doc/argot_format_node_path.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,55 +14,55 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_FORMAT_NODE_PATH 3 "May 19, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_FORMAT_NODE_PATH 3 "May 19, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_format_node_path \- format and output statement pathname for the 19argot_format_node_path \- format and output statement pathname for the
20node 20node
21.SH SYNOPSIS 21.SH SYNOPSIS
22.nf 22.nf
23.B #include <grecs.h> 23.B #include <argot.h>
24.sp 24.sp
25.BI "void grecs_format_node_path(struct grecs_node " "*node" ", int " \ 25.BI "void argot_format_node_path(struct argot_node " "*node" ", int " \
26 "flag" ", " 26 "flag" ", "
27.ti +17 27.ti +17
28.BI "struct grecs_format_closure " "*clos" ); 28.BI "struct argot_format_closure " "*clos" );
29.sp 29.sp
30.BI "void grecs_print_node_path(struct grecs_node " "*node" ", int " \ 30.BI "void argot_print_node_path(struct argot_node " "*node" ", int " \
31 "flag" ", FILE " "*fp" ); 31 "flag" ", FILE " "*fp" );
32.SH DESCRIPTION 32.SH DESCRIPTION
33\fBgrecs_format_node_path\fR computes the \fIstatement pathname\fR for 33\fBargot_format_node_path\fR computes the \fIstatement pathname\fR for
34the \fInode\fR, and outputs it using the closure \fIclos\fR. See 34the \fInode\fR, and outputs it using the closure \fIclos\fR. See
35section \fBCLOSURE\fR in 35section \fBCLOSURE\fR in
36.BR grecs_format_node (3), 36.BR argot_format_node (3),
37for a description of struct grecs_format_closure. 37for a description of struct argot_format_closure.
38.PP 38.PP
39\fBgrecs_print_node_path\fR is an alternative interface that outputs 39\fBargot_print_node_path\fR is an alternative interface that outputs
40the formatted data to the file. 40the formatted data to the file.
41.PP 41.PP
42The \fIflags\fR argument describes what character to use as a pathname 42The \fIflags\fR argument describes what character to use as a pathname
43component separator and how to format the statement tag, if \fInode\fR 43component separator and how to format the statement tag, if \fInode\fR
44refers to a block statement. See 44refers to a block statement. See
45.BR grecs_format_node (3), 45.BR argot_format_node (3),
46for a discussion of available flags. 46for a discussion of available flags.
47.SH "RETURN VALUE" 47.SH "RETURN VALUE"
48None. 48None.
49.SH NOTES 49.SH NOTES
50This are auxiliary functions used by 50This are auxiliary functions used by
51.BR grecs_format_node (3) 51.BR argot_format_node (3)
52and 52and
53.BR grecs_print_node (3), 53.BR argot_print_node (3),
54correspondingly. They are is seldom needed in user programs. 54correspondingly. They are is seldom needed in user programs.
55.SH "SEE ALSO" 55.SH "SEE ALSO"
56.BR grecs_format_node (3), 56.BR argot_format_node (3),
57.BR grecs_stmt_path (5). 57.BR argot_stmt_path (5).
58.SH AUTHORS 58.SH AUTHORS
59Sergey Poznyakoff 59Sergey Poznyakoff
60.SH "BUG REPORTS" 60.SH "BUG REPORTS"
61Report bugs to <gray+grecs@gnu.org.ua>. 61Report bugs to <gray+argot@gnu.org.ua>.
62.SH COLOPHON 62.SH COLOPHON
63The \fBGrecs\fR library is constantly changing, so this manual page 63The \fBGrecs\fR library is constantly changing, so this manual page
64may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 64may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
65documentation, visit <http://www.gnu.org.ua/software/grecs>. 65documentation, visit <http://www.gnu.org.ua/software/argot>.
66.SH COPYRIGHT 66.SH COPYRIGHT
67Copyright \(co 2011 Sergey Poznyakoff 67Copyright \(co 2011 Sergey Poznyakoff
68.br 68.br
diff --git a/doc/grecs_format_value.3 b/doc/argot_format_value.3
index bfd90a2..73a667c 100644
--- a/doc/grecs_format_value.3
+++ b/doc/argot_format_value.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,47 +14,47 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_FORMAT_VALUE 3 "May 19, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_FORMAT_VALUE 3 "May 19, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_format_value \- format and output a configuration value 19argot_format_value \- format and output a configuration value
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "void grecs_format_value(struct grecs_value *" "val" ", int " \ 24.BI "void argot_format_value(struct argot_value *" "val" ", int " \
25 "flags" ", " 25 "flags" ", "
26.ti +17 26.ti +17
27.BI "struct grecs_format_closure " "*clos" ); 27.BI "struct argot_format_closure " "*clos" );
28.sp 28.sp
29.BI "void grecs_print_value(struct grecs_value *" "val" ", int " \ 29.BI "void argot_print_value(struct argot_value *" "val" ", int " \
30 "flags" ", FILE " "*fp" ); 30 "flags" ", FILE " "*fp" );
31.SH DESCRIPTION 31.SH DESCRIPTION
32\fBgrecs_format_value\fR formats the value \fIval\fR and outputs it 32\fBargot_format_value\fR formats the value \fIval\fR and outputs it
33using the formatting closure \fIclos\fR. The \fIflags\fR argument 33using the formatting closure \fIclos\fR. The \fIflags\fR argument
34describes how to format the value. See 34describes how to format the value. See
35.BR grecs_format_node (3), 35.BR argot_format_node (3),
36for a discussion of available flags. 36for a discussion of available flags.
37.PP 37.PP
38\fBgrecs_print_value\fR is an alternative interface that outputs the 38\fBargot_print_value\fR is an alternative interface that outputs the
39formatted data to a file. 39formatted data to a file.
40.SH "RETURN VALUE" 40.SH "RETURN VALUE"
41None. 41None.
42.SH NOTES 42.SH NOTES
43This are auxiliary functions used by 43This are auxiliary functions used by
44.BR grecs_format_node (3) 44.BR argot_format_node (3)
45and 45and
46.BR grecs_print_node (3), 46.BR argot_print_node (3),
47correspondingly. They are is seldom needed in user programs. 47correspondingly. They are is seldom needed in user programs.
48.SH "SEE ALSO" 48.SH "SEE ALSO"
49.BR grecs_format_node (3). 49.BR argot_format_node (3).
50.SH AUTHORS 50.SH AUTHORS
51Sergey Poznyakoff 51Sergey Poznyakoff
52.SH "BUG REPORTS" 52.SH "BUG REPORTS"
53Report bugs to <gray+grecs@gnu.org.ua>. 53Report bugs to <gray+argot@gnu.org.ua>.
54.SH COLOPHON 54.SH COLOPHON
55The \fBGrecs\fR library is constantly changing, so this manual page 55The \fBGrecs\fR library is constantly changing, so this manual page
56may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 56may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
57documentation, visit <http://www.gnu.org.ua/software/grecs>. 57documentation, visit <http://www.gnu.org.ua/software/argot>.
58.SH COPYRIGHT 58.SH COPYRIGHT
59Copyright \(co 2011 Sergey Poznyakoff 59Copyright \(co 2011 Sergey Poznyakoff
60.br 60.br
diff --git a/doc/grecs_include_path_setup.3 b/doc/argot_include_path_setup.3
index 6e61ec9..49ce06f 100644
--- a/doc/grecs_include_path_setup.3
+++ b/doc/argot_include_path_setup.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,39 +14,39 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_INCLUDE_PATH_SETUP 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_INCLUDE_PATH_SETUP 3 "May 4, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_include_path_setup, grecs_include_path_setup_v \- add 19argot_include_path_setup, argot_include_path_setup_v \- add
20directories to the \fBgrecs\fR preprocessor include path 20directories to the \fBargot\fR preprocessor include path
21.SH SYNOPSIS 21.SH SYNOPSIS
22.nf 22.nf
23.B #include <grecs.h> 23.B #include <argot.h>
24.sp 24.sp
25.BI "void grecs_include_path_setup(const char *" "dir" ", ...);" 25.BI "void argot_include_path_setup(const char *" "dir" ", ...);"
26.br 26.br
27.BI "void grecs_include_path_setup_v(char **" "dirs" ); 27.BI "void argot_include_path_setup_v(char **" "dirs" );
28.SH DESCRIPTION 28.SH DESCRIPTION
29These functions add directories to the end of the include search path 29These functions add directories to the end of the include search path
30used by the \fBgrecs\fR preprocessor. 30used by the \fBargot\fR preprocessor.
31.PP 31.PP
32\fBgrecs_include_path_setup\fR takes arbitrary number of 32\fBargot_include_path_setup\fR takes arbitrary number of
33arguments. Each argument must be pointer to a directory name. The 33arguments. Each argument must be pointer to a directory name. The
34argument list must terminate with a \fBNULL\fR argument. 34argument list must terminate with a \fBNULL\fR argument.
35.PP 35.PP
36\fBgrecs_include_path_setup_v\fR takes directory names from a 36\fBargot_include_path_setup_v\fR takes directory names from a
37\fBNULL\fR-terminated array of character pointers. 37\fBNULL\fR-terminated array of character pointers.
38.SH "RETURN VALUE" 38.SH "RETURN VALUE"
39None. 39None.
40.SH "SEE ALSO" 40.SH "SEE ALSO"
41.BR grecs_config (5). 41.BR argot_config (5).
42.SH AUTHORS 42.SH AUTHORS
43Sergey Poznyakoff 43Sergey Poznyakoff
44.SH "BUG REPORTS" 44.SH "BUG REPORTS"
45Report bugs to <gray+grecs@gnu.org.ua>. 45Report bugs to <gray+argot@gnu.org.ua>.
46.SH COLOPHON 46.SH COLOPHON
47The \fBGrecs\fR library is constantly changing, so this manual page 47The \fBGrecs\fR library is constantly changing, so this manual page
48may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 48may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
49documentation, visit <http://www.gnu.org.ua/software/grecs>. 49documentation, visit <http://www.gnu.org.ua/software/argot>.
50.SH COPYRIGHT 50.SH COPYRIGHT
51Copyright \(co 2011 Sergey Poznyakoff 51Copyright \(co 2011 Sergey Poznyakoff
52.br 52.br
diff --git a/doc/grecs_malloc.3 b/doc/argot_malloc.3
index 97d4273..0059bbb 100644
--- a/doc/grecs_malloc.3
+++ b/doc/argot_malloc.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,41 +14,41 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_MALLOC 3 "May 7, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_MALLOC 3 "May 7, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_malloc, grecs_zalloc, grecs_calloc, grecs_realloc \- Allocate 19argot_malloc, argot_zalloc, argot_calloc, argot_realloc \- Allocate
20dynamic memory for \fBGrecs\fR. 20dynamic memory for \fBGrecs\fR.
21.SH SYNOPSIS 21.SH SYNOPSIS
22.nf 22.nf
23.B #include <grecs.h> 23.B #include <argot.h>
24.sp 24.sp
25.BI "void *grecs_malloc(size_t " "size" ); 25.BI "void *argot_malloc(size_t " "size" );
26.br 26.br
27.BI "void *grecs_zalloc(size_t " "size" ); 27.BI "void *argot_zalloc(size_t " "size" );
28.br 28.br
29.BI "void *grecs_calloc(size_t " "nmemb" ", size_t " "size" ); 29.BI "void *argot_calloc(size_t " "nmemb" ", size_t " "size" );
30.br 30.br
31.BI "void *grecs_realloc(void " "*ptr" ", size_t " "size" ); 31.BI "void *argot_realloc(void " "*ptr" ", size_t " "size" );
32.br 32.br
33.BI "void grecs_free(void " "*ptr" ); 33.BI "void argot_free(void " "*ptr" );
34.br 34.br
35.BI "void grecs_alloc_die(void);" 35.BI "void argot_alloc_die(void);"
36.sp 36.sp
37.BI "void *(*grecs_malloc_fun)(size_t " "size" ); 37.BI "void *(*argot_malloc_fun)(size_t " "size" );
38.br 38.br
39.BI "void *(*grecs_realloc_fun)(void " "*ptr" ", size_t " "size" ); 39.BI "void *(*argot_realloc_fun)(void " "*ptr" ", size_t " "size" );
40.br 40.br
41.BI "void (*grecs_free_fun)(void " "*ptr" ); 41.BI "void (*argot_free_fun)(void " "*ptr" );
42.br 42.br
43.BI "void (*grecs_alloc_die_fun)(void);" 43.BI "void (*argot_alloc_die_fun)(void);"
44.SH DESCRIPTION 44.SH DESCRIPTION
45.PP 45.PP
46The \fBgrecs_malloc\fR, \fBgrecs_calloc\fR and \fBgrecs_realloc\fR 46The \fBargot_malloc\fR, \fBargot_calloc\fR and \fBargot_realloc\fR
47functions work exactly as they \fIlibc\fR counterparts do, except that 47functions work exactly as they \fIlibc\fR counterparts do, except that
48if unable to allocate memory they terminate the program, by calling 48if unable to allocate memory they terminate the program, by calling
49\fBgrecs_alloc_die\fR function. 49\fBargot_alloc_die\fR function.
50.PP 50.PP
51.BR grecs_calloc () 51.BR argot_calloc ()
52allocates memory for an array of 52allocates memory for an array of
53.I nmemb 53.I nmemb
54elements of 54elements of
@@ -56,13 +56,13 @@ elements of
56bytes each and returns a pointer to the allocated memory. 56bytes each and returns a pointer to the allocated memory.
57The memory is set to zero. 57The memory is set to zero.
58.PP 58.PP
59.BR grecs_malloc () 59.BR argot_malloc ()
60allocates 60allocates
61.I size 61.I size
62bytes and returns a pointer to the allocated memory. 62bytes and returns a pointer to the allocated memory.
63The memory is not cleared. 63The memory is not cleared.
64.PP 64.PP
65.BR grecs_realloc () 65.BR argot_realloc ()
66changes the size of the memory block pointed to by 66changes the size of the memory block pointed to by
67.I ptr 67.I ptr
68to 68to
@@ -72,56 +72,56 @@ The contents will be unchanged to the minimum of the old and new
72sizes; 72sizes;
73newly allocated memory will be uninitialized. 73newly allocated memory will be uninitialized.
74.PP 74.PP
75.BR grecs_zalloc () 75.BR argot_zalloc ()
76allocates 76allocates
77.I size 77.I size
78bytes and returns a pointer to the allocated memory. The memory is 78bytes and returns a pointer to the allocated memory. The memory is
79set to zero. 79set to zero.
80.PP 80.PP
81.BR grecs_free () 81.BR argot_free ()
82frees the memory space pointed to by \fBptr\fR, which must have been 82frees the memory space pointed to by \fBptr\fR, which must have been
83returned by a previous call to one of the memory allocation functions 83returned by a previous call to one of the memory allocation functions
84discussed above. 84discussed above.
85.PP 85.PP
86The \fBgrecs_malloc_fun\fR hook is used \fBgrecs_malloc\fR, 86The \fBargot_malloc_fun\fR hook is used \fBargot_malloc\fR,
87\fBgrecs_calloc\fR and \fBgrecs_zalloc\fR to allocate new memory 87\fBargot_calloc\fR and \fBargot_zalloc\fR to allocate new memory
88chunk. By default it points to 88chunk. By default it points to
89.BR malloc (3). 89.BR malloc (3).
90.PP 90.PP
91Similarly, the \fBgrecs_realloc_fun\fR, is used by 91Similarly, the \fBargot_realloc_fun\fR, is used by
92\fBgrecs_realloc\fR function. By default it points to 92\fBargot_realloc\fR function. By default it points to
93.BR realloc (3). 93.BR realloc (3).
94.PP 94.PP
95The \fBgrecs_free_fun\fR is used by 95The \fBargot_free_fun\fR is used by
96.BR grecs_free (). 96.BR argot_free ().
97By default it points to 97By default it points to
98.BR free (3). 98.BR free (3).
99.PP 99.PP
100These hooks provide a way for the calling program to use its custom 100These hooks provide a way for the calling program to use its custom
101memory allocation routines. 101memory allocation routines.
102.PP 102.PP
103.BR grecs_alloc_die () 103.BR argot_alloc_die ()
104This function is called when memory allocation fails. It prints 104This function is called when memory allocation fails. It prints
105appropriate diagnostics using \fBgrecs_error(3)\fR and aborts the 105appropriate diagnostics using \fBargot_error(3)\fR and aborts the
106program. If \fBgrecs_alloc_die_fun\fR, it is called prior to 106program. If \fBargot_alloc_die_fun\fR, it is called prior to
107outputting the diagnostics. 107outputting the diagnostics.
108 108
109.SH "RETURN VALUE" 109.SH "RETURN VALUE"
110For \fBgrecs_malloc\fR, \fBgrecs_calloc\fR, \fBgrecs_zalloc\fR and 110For \fBargot_malloc\fR, \fBargot_calloc\fR, \fBargot_zalloc\fR and
111\fBgrecs_realloc\fR return a pointer to the allocated memory, which is 111\fBargot_realloc\fR return a pointer to the allocated memory, which is
112suitably aligned for any kind of variable. 112suitably aligned for any kind of variable.
113.PP 113.PP
114On error, \fBgrecs_alloc_die\fR is called and the program is terminated. 114On error, \fBargot_alloc_die\fR is called and the program is terminated.
115.SH "SEE ALSO" 115.SH "SEE ALSO"
116.BR grecs_strdup (3) 116.BR argot_strdup (3)
117.SH AUTHORS 117.SH AUTHORS
118Sergey Poznyakoff. 118Sergey Poznyakoff.
119.SH "BUG REPORTS" 119.SH "BUG REPORTS"
120Report bugs to <gray+grecs@gnu.org.ua>. 120Report bugs to <gray+argot@gnu.org.ua>.
121.SH COLOPHON 121.SH COLOPHON
122The \fBGrecs\fR library is constantly changing, so this manual page 122The \fBGrecs\fR library is constantly changing, so this manual page
123may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 123may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
124documentation, visit <http://www.gnu.org.ua/software/grecs>. 124documentation, visit <http://www.gnu.org.ua/software/argot>.
125.SH COPYRIGHT 125.SH COPYRIGHT
126Copyright \(co 2011 Sergey Poznyakoff 126Copyright \(co 2011 Sergey Poznyakoff
127.br 127.br
diff --git a/doc/grecs_node_free.3 b/doc/argot_node_free.3
index 8637811..6fd6f61 100644
--- a/doc/grecs_node_free.3
+++ b/doc/argot_node_free.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,34 +14,34 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_NODE_FREE 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_NODE_FREE 3 "May 4, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_node_free \- reclaim the memory used by a node 19argot_node_free \- reclaim the memory used by a node
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "void grecs_node_free(struct grecs_node " "*node" ); 24.BI "void argot_node_free(struct argot_node " "*node" );
25.SH DESCRIPTION 25.SH DESCRIPTION
26\fBgrecs_node_free\fR reclaims the memory used by the parse tree node 26\fBargot_node_free\fR reclaims the memory used by the parse tree node
27\fInode\fR. 27\fInode\fR.
28.PP 28.PP
29The function does not unlink the node from the lists it is part of, 29The function does not unlink the node from the lists it is part of,
30see 30see
31.BR grecs_tree_free (3), 31.BR argot_tree_free (3),
32if this is what you need. 32if this is what you need.
33.SH "RETURN VALUE" 33.SH "RETURN VALUE"
34None. 34None.
35.SH "SEE ALSO" 35.SH "SEE ALSO"
36.BR grecs_tree_free (3). 36.BR argot_tree_free (3).
37.SH AUTHORS 37.SH AUTHORS
38Sergey Poznyakoff 38Sergey Poznyakoff
39.SH "BUG REPORTS" 39.SH "BUG REPORTS"
40Report bugs to <gray+grecs@gnu.org.ua>. 40Report bugs to <gray+argot@gnu.org.ua>.
41.SH COLOPHON 41.SH COLOPHON
42The \fBGrecs\fR library is constantly changing, so this manual page 42The \fBGrecs\fR library is constantly changing, so this manual page
43may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 43may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
44documentation, visit <http://www.gnu.org.ua/software/grecs>. 44documentation, visit <http://www.gnu.org.ua/software/argot>.
45.SH COPYRIGHT 45.SH COPYRIGHT
46Copyright \(co 2011 Sergey Poznyakoff 46Copyright \(co 2011 Sergey Poznyakoff
47.br 47.br
diff --git a/doc/grecs_parse.3 b/doc/argot_parse.3
index 27e451b..4db155c 100644
--- a/doc/grecs_parse.3
+++ b/doc/argot_parse.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,23 +14,23 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_PARSE 3 "July 1, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_PARSE 3 "July 1, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_parse \- parse a configuration file. 19argot_parse \- parse a configuration file.
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "struct grecs_node *grecs_parse(const char *" "name" ); 24.BI "struct argot_node *argot_parse(const char *" "name" );
25.SH DESCRIPTION 25.SH DESCRIPTION
26The 26The
27.BR grecs_parse () 27.BR argot_parse ()
28function reads the file \fBname\fR, which must be formatted 28function reads the file \fBname\fR, which must be formatted
29according to 29according to
30.BR grecs_config (5) 30.BR argot_config (5)
31and returns the parsed-out syntax tree. On errors, \fBNULL\fR is 31and returns the parsed-out syntax tree. On errors, \fBNULL\fR is
32returned and appropriate diagnostic messages are printed using 32returned and appropriate diagnostic messages are printed using
33.BR grecs_error (3). 33.BR argot_error (3).
34.PP 34.PP
35The syntax tree consists of \fInodes\fR, linked together so as to 35The syntax tree consists of \fInodes\fR, linked together so as to
36represent the file structure. A node is described by the following 36represent the file structure. A node is described by the following
@@ -38,32 +38,32 @@ object:
38.sp 38.sp
39.nf 39.nf
40.in +5 40.in +5
41typedef struct grecs_node { 41typedef struct argot_node {
42 enum grecs_node_type type; 42 enum argot_node_type type;
43 grecs_locus_t locus; 43 argot_locus_t locus;
44 struct grecs_node *up; 44 struct argot_node *up;
45 struct grecs_node *down; 45 struct argot_node *down;
46 struct grecs_node *next; 46 struct argot_node *next;
47 struct grecs_node *prev; 47 struct argot_node *prev;
48 char *ident; 48 char *ident;
49 grecs_locus_t idloc; 49 argot_locus_t idloc;
50 union { 50 union {
51 struct grecs_value *value; 51 struct argot_value *value;
52 struct grecs_symtab *texttab; 52 struct argot_symtab *texttab;
53 } v; 53 } v;
54} grecs_node_t; 54} argot_node_t;
55.in 55.in
56.fi 56.fi
57.PP 57.PP
58The \fItype\fR member describes the type of this node. Its value is 58The \fItype\fR member describes the type of this node. Its value is
59\fBgrecs_node_stmt\fR for simple statements and 59\fBargot_node_stmt\fR for simple statements and
60\fBgrecs_node_block\fR, for block statements. The topmost node (the 60\fBargot_node_block\fR, for block statements. The topmost node (the
61one returned by \fBgrecs_tree_parse\fR) has type \fBgrecs_node_root\fR. 61one returned by \fBargot_tree_parse\fR) has type \fBargot_node_root\fR.
62.PP 62.PP
63The \fIlocus\fR describes the location in the input file, which this 63The \fIlocus\fR describes the location in the input file, which this
64node described. See 64node described. See
65.BR grecs_error (3), 65.BR argot_error (3),
66for a description of \fBgrecs_locus_t\fR. 66for a description of \fBargot_locus_t\fR.
67.PP 67.PP
68Adjacent nodes form a doubly-linked list using the \fBnext\fR and 68Adjacent nodes form a doubly-linked list using the \fBnext\fR and
69\fBprev\fR pointers. Thus, the node pointed to by \fBnext\fR 69\fBprev\fR pointers. Thus, the node pointed to by \fBnext\fR
@@ -71,7 +71,7 @@ describes the statement that appears immediately after the one
71described by the current node, whereas \fBprev\fR points to the node 71described by the current node, whereas \fBprev\fR points to the node
72describing a preceding statement. 72describing a preceding statement.
73.PP 73.PP
74If \fItype\fR is \fBgrecs_node_block\fR, the \fBdown\fR member points 74If \fItype\fR is \fBargot_node_block\fR, the \fBdown\fR member points
75to the first \fBsub-statement\fR in this block. \fBdown->next\fR 75to the first \fBsub-statement\fR in this block. \fBdown->next\fR
76will point to the second statement (if any), and so on. 76will point to the second statement (if any), and so on.
77.PP 77.PP
@@ -105,7 +105,7 @@ input file. Notice, that it differs from \fBlocus\fR described above.
105.PP 105.PP
106The \fBv\fR union keeps data which depend on the type of this node. 106The \fBv\fR union keeps data which depend on the type of this node.
107The \fBv.texttab\fR member is defined only for the root node (type 107The \fBv.texttab\fR member is defined only for the root node (type
108\fBgrecs_node_root\fR). It points to a symbol table which holds shared 108\fBargot_node_root\fR). It points to a symbol table which holds shared
109strings for this tree. In particular, this table holds file names 109strings for this tree. In particular, this table holds file names
110referenced by \fBlocus\fR members of all underlying nodes. 110referenced by \fBlocus\fR members of all underlying nodes.
111.PP 111.PP
@@ -114,33 +114,33 @@ the value associated with this statement. A value is defined as:
114.sp 114.sp
115.nf 115.nf
116.in +5 116.in +5
117typedef struct grecs_value { 117typedef struct argot_value {
118 int type; 118 int type;
119 grecs_locus_t locus; 119 argot_locus_t locus;
120 union { 120 union {
121 struct grecs_list *list; 121 struct argot_list *list;
122 char *string; 122 char *string;
123 struct { 123 struct {
124 size_t c; 124 size_t c;
125 struct grecs_value **v; 125 struct argot_value **v;
126 } arg; 126 } arg;
127 } v; 127 } v;
128} grecs_value_t; 128} argot_value_t;
129.in 129.in
130.fi 130.fi
131.PP 131.PP
132The \fBtype\fR will be \fBGRECS_TYPE_STRING\fR, for string values, 132The \fBtype\fR will be \fBARGOT_TYPE_STRING\fR, for string values,
133\fBGRECS_TYPE_LIST\fR, for list values, and \fBGRECS_TYPE_ARRAY\fR, 133\fBARGOT_TYPE_LIST\fR, for list values, and \fBARGOT_TYPE_ARRAY\fR,
134for arrays of values. Depending on its value, the following members 134for arrays of values. Depending on its value, the following members
135of the union are used: 135of the union are used:
136.TP 136.TP
137.B GRECS_TYPE_STRING 137.B ARGOT_TYPE_STRING
138Actual string value is pointed to by \fBv.string\fR. 138Actual string value is pointed to by \fBv.string\fR.
139.TP 139.TP
140.B GRECS_TYPE_LIST 140.B ARGOT_TYPE_LIST
141The list value is pointed to by \fBv.list\fR. 141The list value is pointed to by \fBv.list\fR.
142.TP 142.TP
143.B GRECS_TYPE_ARRAY 143.B ARGOT_TYPE_ARRAY
144The array itself is stored in \fBv.arg.v\fR. The \fBv.arg.c\fR member 144The array itself is stored in \fBv.arg.v\fR. The \fBv.arg.c\fR member
145contains the number of elements in the array. 145contains the number of elements in the array.
146.PP 146.PP
@@ -157,29 +157,29 @@ screen:
157int 157int
158main(int argc, char **argv) 158main(int argc, char **argv)
159{ 159{
160 struct grecs_node *tree; 160 struct argot_node *tree;
161 161
162 tree = grecs_parse(argv[1]); 162 tree = argot_parse(argv[1]);
163 grecs_format_node(tree, GRECS_NODE_FLAG_DEFAULT, stdout); 163 argot_format_node(tree, ARGOT_NODE_FLAG_DEFAULT, stdout);
164 fputc('\\n', stdout); 164 fputc('\\n', stdout);
165 grecs_tree_free(tree); 165 argot_tree_free(tree);
166 exit(0); 166 exit(0);
167} 167}
168.in 168.in
169.fi 169.fi
170.SH "SEE ALSO" 170.SH "SEE ALSO"
171.BR grecs_config (5), 171.BR argot_config (5),
172.BR grecs_error (3), 172.BR argot_error (3),
173.BR grecs_format_node (3), 173.BR argot_format_node (3),
174.BR grecs_tree_free (3). 174.BR argot_tree_free (3).
175.SH AUTHORS 175.SH AUTHORS
176Sergey Poznyakoff 176Sergey Poznyakoff
177.SH "BUG REPORTS" 177.SH "BUG REPORTS"
178Report bugs to <gray+grecs@gnu.org.ua>. 178Report bugs to <gray+argot@gnu.org.ua>.
179.SH COLOPHON 179.SH COLOPHON
180The \fBGrecs\fR library is constantly changing, so this manual page 180The \fBGrecs\fR library is constantly changing, so this manual page
181may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 181may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
182documentation, visit <http://www.gnu.org.ua/software/grecs>. 182documentation, visit <http://www.gnu.org.ua/software/argot>.
183.SH COPYRIGHT 183.SH COPYRIGHT
184Copyright \(co 2011 Sergey Poznyakoff 184Copyright \(co 2011 Sergey Poznyakoff
185.br 185.br
diff --git a/doc/grecs_stmt_path.5 b/doc/argot_stmt_path.5
index 2436630..bc2cc0a 100644
--- a/doc/grecs_stmt_path.5
+++ b/doc/argot_stmt_path.5
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,10 +14,10 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_STMT_PATH 5 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_STMT_PATH 5 "May 4, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19Statement pathname \- a unique identifier of a statement in 19Statement pathname \- a unique identifier of a statement in
20\fBgrecs\fR configuration file. 20\fBargot\fR configuration file.
21.SH DESCRIPTION 21.SH DESCRIPTION
22\fBGrecs\fR configuration files have a distinct hierarchical 22\fBGrecs\fR configuration files have a distinct hierarchical
23structure. Each statement in such a file can therefore be identified 23structure. Each statement in such a file can therefore be identified
@@ -93,15 +93,15 @@ component separator, e.g.:
93 .program=\(dqa.out\(dq.bar.baz 93 .program=\(dqa.out\(dq.bar.baz
94.fi 94.fi
95.SH "SEE ALSO" 95.SH "SEE ALSO"
96.BR grecs_config (5). 96.BR argot_config (5).
97.SH AUTHORS 97.SH AUTHORS
98Sergey Poznyakoff 98Sergey Poznyakoff
99.SH "BUG REPORTS" 99.SH "BUG REPORTS"
100Report bugs to <gray+grecs@gnu.org.ua>. 100Report bugs to <gray+argot@gnu.org.ua>.
101.SH COLOPHON 101.SH COLOPHON
102The \fBGrecs\fR library is constantly changing, so this manual page 102The \fBGrecs\fR library is constantly changing, so this manual page
103may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 103may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
104documentation, visit <http://www.gnu.org.ua/software/grecs>. 104documentation, visit <http://www.gnu.org.ua/software/argot>.
105.SH COPYRIGHT 105.SH COPYRIGHT
106Copyright \(co 2011 Sergey Poznyakoff 106Copyright \(co 2011 Sergey Poznyakoff
107.br 107.br
diff --git a/doc/grecs_strdup.3 b/doc/argot_strdup.3
index e180264..ce53b07 100644
--- a/doc/grecs_strdup.3
+++ b/doc/argot_strdup.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,41 +14,41 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_STRDUP 3 "May 7, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_STRDUP 3 "May 7, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_strdup \- duplicate a string 19argot_strdup \- duplicate a string
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "char *grecs_strdup(const char *" "str" ); 24.BI "char *argot_strdup(const char *" "str" );
25 25
26.SH DESCRIPTION 26.SH DESCRIPTION
27The 27The
28.BR strdup () 28.BR strdup ()
29function returns a pointer to a new string which is a duplicate of the 29function returns a pointer to a new string which is a duplicate of the
30string \fIstr\fR. Memory for the new string is obtained with 30string \fIstr\fR. Memory for the new string is obtained with
31.BR grecs_malloc (3), 31.BR argot_malloc (3),
32and must be freed with 32and must be freed with
33.BR grecs_free (3). 33.BR argot_free (3).
34.SH "RETURN VALUE" 34.SH "RETURN VALUE"
35The 35The
36.BR grecs_strdup () 36.BR argot_strdup ()
37function returns a pointer to the duplicated string. 37function returns a pointer to the duplicated string.
38.PP 38.PP
39On error, 39On error,
40.BR grecs_alloc_die (3) 40.BR argot_alloc_die (3)
41is called, which terminates the program. 41is called, which terminates the program.
42.SH "SEE ALSO" 42.SH "SEE ALSO"
43.BR grecs_alloc_die (3) 43.BR argot_alloc_die (3)
44.SH AUTHORS 44.SH AUTHORS
45Sergey Poznyakoff 45Sergey Poznyakoff
46.SH "BUG REPORTS" 46.SH "BUG REPORTS"
47Report bugs to <gray+grecs@gnu.org.ua>. 47Report bugs to <gray+argot@gnu.org.ua>.
48.SH COLOPHON 48.SH COLOPHON
49The \fBGrecs\fR library is constantly changing, so this manual page 49The \fBGrecs\fR library is constantly changing, so this manual page
50may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 50may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
51documentation, visit <http://www.gnu.org.ua/software/grecs>. 51documentation, visit <http://www.gnu.org.ua/software/argot>.
52.SH COPYRIGHT 52.SH COPYRIGHT
53Copyright \(co 2011 Sergey Poznyakoff 53Copyright \(co 2011 Sergey Poznyakoff
54.br 54.br
diff --git a/doc/grecs_tree_free.3 b/doc/argot_tree_free.3
index 7b0faf6..b064a23 100644
--- a/doc/grecs_tree_free.3
+++ b/doc/argot_tree_free.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,32 +14,32 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_XXX 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_XXX 3 "May 4, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19grecs_tree_free \- reclaim the memory used by entire parse tree 19argot_tree_free \- reclaim the memory used by entire parse tree
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.BI "void grecs_tree_free(struct grecs_node " "*node" ); 24.BI "void argot_tree_free(struct argot_node " "*node" );
25.SH DESCRIPTION 25.SH DESCRIPTION
26\fBgrecs_tree_free\fR reclaims the memory used by \fInode\fR and all 26\fBargot_tree_free\fR reclaims the memory used by \fInode\fR and all
27nodes it points to, recursively. 27nodes it points to, recursively.
28.PP 28.PP
29The argument \fInode\fR must be the root of a parse tree. 29The argument \fInode\fR must be the root of a parse tree.
30.SH "RETURN VALUE" 30.SH "RETURN VALUE"
31None. 31None.
32.SH "SEE ALSO" 32.SH "SEE ALSO"
33.BR grecs_parse (3), 33.BR argot_parse (3),
34.BR grecs_node_free (3). 34.BR argot_node_free (3).
35.SH AUTHORS 35.SH AUTHORS
36Sergey Poznyakoff 36Sergey Poznyakoff
37.SH "BUG REPORTS" 37.SH "BUG REPORTS"
38Report bugs to <gray+grecs@gnu.org.ua>. 38Report bugs to <gray+argot@gnu.org.ua>.
39.SH COLOPHON 39.SH COLOPHON
40The \fBGrecs\fR library is constantly changing, so this manual page 40The \fBGrecs\fR library is constantly changing, so this manual page
41may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 41may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
42documentation, visit <http://www.gnu.org.ua/software/grecs>. 42documentation, visit <http://www.gnu.org.ua/software/argot>.
43.SH COPYRIGHT 43.SH COPYRIGHT
44Copyright \(co 2011 Sergey Poznyakoff 44Copyright \(co 2011 Sergey Poznyakoff
45.br 45.br
diff --git a/doc/tmpl.3 b/doc/tmpl.3
index b4eeb96..6827d77 100644
--- a/doc/tmpl.3
+++ b/doc/tmpl.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,12 +14,12 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH GRECS_XXX 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH ARGOT_XXX 3 "May 4, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19 19
20.SH SYNOPSIS 20.SH SYNOPSIS
21.nf 21.nf
22.B #include <grecs.h> 22.B #include <argot.h>
23.sp 23.sp
24.SH DESCRIPTION 24.SH DESCRIPTION
25.SH "RETURN VALUE" 25.SH "RETURN VALUE"
@@ -28,11 +28,11 @@
28.SH AUTHORS 28.SH AUTHORS
29Sergey Poznyakoff 29Sergey Poznyakoff
30.SH "BUG REPORTS" 30.SH "BUG REPORTS"
31Report bugs to <gray+grecs@gnu.org.ua>. 31Report bugs to <gray+argot@gnu.org.ua>.
32.SH COLOPHON 32.SH COLOPHON
33The \fBGrecs\fR library is constantly changing, so this manual page 33The \fBGrecs\fR library is constantly changing, so this manual page
34may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR 34may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
35documentation, visit <http://www.gnu.org.ua/software/grecs>. 35documentation, visit <http://www.gnu.org.ua/software/argot>.
36.SH COPYRIGHT 36.SH COPYRIGHT
37Copyright \(co 2011 Sergey Poznyakoff 37Copyright \(co 2011 Sergey Poznyakoff
38.br 38.br
diff --git a/doc/wordsplit.3 b/doc/wordsplit.3
index 067ea5e..13b634b 100644
--- a/doc/wordsplit.3
+++ b/doc/wordsplit.3
@@ -1,4 +1,4 @@
1.\" This file is part of grecs -*- nroff -*- 1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff 2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Grecs is free software; you can redistribute it and/or modify 4.\" Grecs is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" 16.\"
17.TH WORDSPLIT 3 "December 3, 2014" "GRECS" "Grecs User Reference" 17.TH WORDSPLIT 3 "December 3, 2014" "ARGOT" "Grecs User Reference"
18.SH NAME 18.SH NAME
19wordsplit \- split string into words 19wordsplit \- split string into words
20.SH SYNOPSIS 20.SH SYNOPSIS
@@ -971,7 +971,7 @@ char **shell_parse(char *s)
971.SH AUTHORS 971.SH AUTHORS
972Sergey Poznyakoff 972Sergey Poznyakoff
973.SH "BUG REPORTS" 973.SH "BUG REPORTS"
974Report bugs to <gray+grecs@gnu.org.ua>. 974Report bugs to <gray+argot@gnu.org.ua>.
975.SH COPYRIGHT 975.SH COPYRIGHT
976Copyright \(co 2009-2014 Sergey Poznyakoff 976Copyright \(co 2009-2014 Sergey Poznyakoff
977.br 977.br
diff --git a/include/Makefile.am b/include/Makefile.am
index 6a017a3..75c70ce 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,19 +1,19 @@
1SUBDIRS = grecs 1SUBDIRS = argot
2GRECS_HDR = grecs.h wordsplit.h 2ARGOT_HDR = argot.h wordsplit.h
3 3
4if GRECS_COND_BUILD_INSTALL 4if ARGOT_COND_BUILD_INSTALL
5 include_HEADERS = $(GRECS_HDR) 5 include_HEADERS = $(ARGOT_HDR)
6endif 6endif
7 7
8if GRECS_COND_BUILD_SHARED 8if ARGOT_COND_BUILD_SHARED
9if GRECS_COND_INSTALLHEADERS 9if ARGOT_COND_INSTALLHEADERS
10 grecsincludedir = @GRECS_INCLUDE_DIR@ 10 argotincludedir = @ARGOT_INCLUDE_DIR@
11 grecsinclude_HEADERS = $(GRECS_HDR) 11 argotinclude_HEADERS = $(ARGOT_HDR)
12else 12else
13 noinst_HEADERS = $(GRECS_HDR) 13 noinst_HEADERS = $(ARGOT_HDR)
14endif 14endif
15endif 15endif
16 16
17if GRECS_COND_BUILD_STATIC 17if ARGOT_COND_BUILD_STATIC
18 noinst_HEADERS = $(GRECS_HDR) 18 noinst_HEADERS = $(ARGOT_HDR)
19endif 19endif
diff --git a/include/grecs.h b/include/argot.h
index eac11d4..0f5e870 100644
--- a/include/grecs.h
+++ b/include/argot.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System -*- c -*- 1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,27 +14,27 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_H 17#ifndef _ARGOT_H
18#define _GRECS_H 18#define _ARGOT_H
19 19
20#include <grecs/types.h> 20#include <argot/types.h>
21#include <grecs/version.h> 21#include <argot/version.h>
22#include <grecs/doc.h> 22#include <argot/doc.h>
23#include <grecs/error.h> 23#include <argot/error.h>
24#include <grecs/format.h> 24#include <argot/format.h>
25#include <grecs/lex.h> 25#include <argot/lex.h>
26#include <grecs/list.h> 26#include <argot/list.h>
27#include <grecs/locus.h> 27#include <argot/locus.h>
28#include <grecs/mem.h> 28#include <argot/mem.h>
29#include <grecs/node.h> 29#include <argot/node.h>
30#include <grecs/parser.h> 30#include <argot/parser.h>
31#include <grecs/preproc.h> 31#include <argot/preproc.h>
32#include <grecs/sockaddr.h> 32#include <argot/sockaddr.h>
33#include <grecs/symtab.h> 33#include <argot/symtab.h>
34#include <grecs/table.h> 34#include <argot/table.h>
35#include <grecs/tree.h> 35#include <argot/tree.h>
36#include <grecs/txtacc.h> 36#include <argot/txtacc.h>
37#include <grecs/util.h> 37#include <argot/util.h>
38#include <grecs/value.h> 38#include <argot/value.h>
39 39
40#endif 40#endif
diff --git a/include/grecs/.gitignore b/include/argot/.gitignore
index 8cb8a05..8cb8a05 100644
--- a/include/grecs/.gitignore
+++ b/include/argot/.gitignore
diff --git a/include/argot/Makefile.am b/include/argot/Makefile.am
new file mode 100644
index 0000000..9fb3fa1
--- /dev/null
+++ b/include/argot/Makefile.am
@@ -0,0 +1,43 @@
1ARGOT_PKG_HDR =\
2 doc.h\
3 error.h\
4 format.h\
5 lex.h\
6 list.h\
7 locus.h\
8 mem.h\
9 node.h\
10 opt.h\
11 parser.h\
12 preproc.h\
13 sockaddr.h\
14 symtab.h\
15 table.h\
16 tree.h\
17 txtacc.h\
18 types.h\
19 util.h\
20 value.h\
21 version.h
22
23if ARGOT_COND_JSON
24 ARGOT_PKG_HDR += json.h
25endif
26
27if ARGOT_COND_BUILD_INSTALL
28 argotincludedir = @ARGOT_INCLUDE_DIR@
29 argotinclude_HEADERS = $(ARGOT_PKG_HDR)
30endif
31
32if ARGOT_COND_BUILD_SHARED
33if ARGOT_COND_INSTALLHEADERS
34 argotincludedir = @ARGOT_INCLUDE_DIR@
35 argotinclude_HEADERS = $(ARGOT_PKG_HDR)
36else
37 noinst_HEADERS = $(ARGOT_PKG_HDR)
38endif
39endif
40
41if ARGOT_COND_BUILD_STATIC
42 noinst_HEADERS = $(ARGOT_PKG_HDR)
43endif
diff --git a/include/grecs/doc.h b/include/argot/doc.h
index b2514fb..2b2da95 100644
--- a/include/grecs/doc.h
+++ b/include/argot/doc.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System -*- c -*- 1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,19 +14,19 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_DOC_H 17#ifndef _ARGOT_DOC_H
18#define _GRECS_DOC_H 18#define _ARGOT_DOC_H
19 19
20#include <stdio.h> 20#include <stdio.h>
21#include <grecs/table.h> 21#include <argot/table.h>
22 22
23void grecs_print_docstring(const char *docstring, unsigned level, 23void argot_print_docstring(const char *docstring, unsigned level,
24 FILE *stream); 24 FILE *stream);
25void grecs_print_simple_statement(struct grecs_keyword *kwp, 25void argot_print_simple_statement(struct argot_keyword *kwp,
26 unsigned level, FILE *stream); 26 unsigned level, FILE *stream);
27void grecs_print_block_statement(struct grecs_keyword *kwp, 27void argot_print_block_statement(struct argot_keyword *kwp,
28 unsigned level, FILE *stream); 28 unsigned level, FILE *stream);
29void grecs_print_statement_array(struct grecs_keyword *kwp, 29void argot_print_statement_array(struct argot_keyword *kwp,
30 unsigned n, 30 unsigned n,
31 unsigned level, FILE *stream); 31 unsigned level, FILE *stream);
32#endif 32#endif
diff --git a/include/grecs/error.h b/include/argot/error.h
index 8630b8a..423af12 100644
--- a/include/grecs/error.h
+++ b/include/argot/error.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System -*- c -*- 1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,25 +14,25 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_ERROR_H 17#ifndef _ARGOT_ERROR_H
18#define _GRECS_ERROR_H 18#define _ARGOT_ERROR_H
19 19
20#include <grecs/locus.h> 20#include <argot/locus.h>
21 21
22extern int grecs_log_to_stderr; 22extern int argot_log_to_stderr;
23extern void (*grecs_log_setup_hook)(void); 23extern void (*argot_log_setup_hook)(void);
24 24
25extern void (*grecs_print_diag_fun)(grecs_locus_t const *, int, int, 25extern void (*argot_print_diag_fun)(argot_locus_t const *, int, int,
26 const char*); 26 const char*);
27 27
28void grecs_warning(grecs_locus_t const *locus, 28void argot_warning(argot_locus_t const *locus,
29 int errcode, const char *fmt, ...) 29 int errcode, const char *fmt, ...)
30 __attribute__ ((__format__ (__printf__, 3, 4))); 30 __attribute__ ((__format__ (__printf__, 3, 4)));
31void grecs_error(grecs_locus_t const *locus, int errcode, 31void argot_error(argot_locus_t const *locus, int errcode,
32 const char *fmt, ...) 32 const char *fmt, ...)
33 __attribute__ ((__format__ (__printf__, 3, 4))); 33 __attribute__ ((__format__ (__printf__, 3, 4)));
34 34
35int grecs_asprint_locus(char **locstr, size_t *size, 35int argot_asprint_locus(char **locstr, size_t *size,
36 grecs_locus_t const *locus); 36 argot_locus_t const *locus);
37 37
38#endif 38#endif
diff --git a/include/argot/format.h b/include/argot/format.h
new file mode 100644
index 0000000..f989904
--- /dev/null
+++ b/include/argot/format.h
@@ -0,0 +1,62 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_FORMAT_H
18#define _ARGOT_FORMAT_H
19
20#include <argot/value.h>
21#include <argot/locus.h>
22#include <argot/node.h>
23#include <argot/txtacc.h>
24
25struct argot_format_closure {
26 int (*fmtfun)(const char *, void *);
27 void *data;
28};
29
30void argot_format_locus(argot_locus_t *locus, struct argot_format_closure *fp);
31void argot_format_node_path(struct argot_node *node, int flag,
32 struct argot_format_closure *fp);
33void argot_format_value(struct argot_value *val, int flags,
34 struct argot_format_closure *fp);
35
36#define ARGOT_NODE_FLAG_PATH 0x00100
37#define ARGOT_NODE_FLAG_VALUE 0x00200
38#define ARGOT_NODE_FLAG_DESCEND 0x01000
39#define ARGOT_NODE_FLAG_LOCUS 0x02000
40#define ARGOT_NODE_FLAG_QUOTE 0x04000
41#define ARGOT_NODE_FLAG_NOQUOTE 0x08000
42#define ARGOT_NODE_FLAG_QUOTE_HEX 0x10000
43
44#define _ARGOT_NODE_MASK_DELIM 0x000ff
45#define _ARGOT_NODE_MASK_OUTPUT 0x00f00
46
47#define ARGOT_NODE_FLAG_DEFAULT \
48 (ARGOT_NODE_FLAG_PATH|ARGOT_NODE_FLAG_VALUE|\
49 ARGOT_NODE_FLAG_DESCEND|ARGOT_NODE_FLAG_QUOTE)
50int argot_format_node(struct argot_node *node, int flags,
51 struct argot_format_closure *fp);
52
53void argot_print_locus(argot_locus_t *locus, FILE *fp);
54void argot_print_node_path(struct argot_node *node, int flag, FILE *fp);
55void argot_print_value(struct argot_value *val, int flags, FILE *fp);
56
57int argot_print_node(struct argot_node *node, int flags, FILE *fp);
58
59void argot_txtacc_format_value(struct argot_value *val, int flags,
60 argot_txtacc_t acc);
61
62#endif
diff --git a/include/grecs/json.h b/include/argot/json.h
index f8402e7..f453ecf 100644
--- a/include/grecs/json.h
+++ b/include/argot/json.h
@@ -14,7 +14,7 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#include <grecs.h> 17#include <argot.h>
18 18
19enum json_value_type 19enum json_value_type
20{ 20{
@@ -30,7 +30,7 @@ struct json_value;
30struct json_array { 30struct json_array {
31 size_t oc; 31 size_t oc;
32 struct json_value **ov; 32 struct json_value **ov;
33 struct grecs_list *ol; 33 struct argot_list *ol;
34}; 34};
35 35
36struct json_value { 36struct json_value {
@@ -40,7 +40,7 @@ struct json_value {
40 double n; /* json_number */ 40 double n; /* json_number */
41 char *s; /* json_string */ 41 char *s; /* json_string */
42 struct json_array *a; /* json_arr */ 42 struct json_array *a; /* json_arr */
43 struct grecs_symtab *o; /* json_object */ 43 struct argot_symtab *o; /* json_object */
44 } v; 44 } v;
45}; 45};
46 46
@@ -50,7 +50,7 @@ struct json_pair {
50}; 50};
51 51
52extern char const *json_err_diag; 52extern char const *json_err_diag;
53extern struct grecs_locus json_err_locus; 53extern struct argot_locus json_err_locus;
54extern struct json_value *json_return_obj; 54extern struct json_value *json_return_obj;
55 55
56void jsonlex_setup(char const *s, size_t l); 56void jsonlex_setup(char const *s, size_t l);
@@ -58,7 +58,7 @@ void jsonlex_diag(const char *s);
58int json_unescape(char c, char *o); 58int json_unescape(char c, char *o);
59 59
60struct json_value *json_value_create(int type); 60struct json_value *json_value_create(int type);
61struct grecs_symtab *json_assoc_create(void); 61struct argot_symtab *json_assoc_create(void);
62void json_value_free(struct json_value *obj); 62void json_value_free(struct json_value *obj);
63 63
64struct json_value *json_parse_string(char const *input, size_t len); 64struct json_value *json_parse_string(char const *input, size_t len);
diff --git a/include/argot/lex.h b/include/argot/lex.h
new file mode 100644
index 0000000..f0699d2
--- /dev/null
+++ b/include/argot/lex.h
@@ -0,0 +1,52 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_LEX_H
18#define _ARGOT_LEX_H
19
20int argot_lex_begin(const char*, int);
21void argot_lex_end(int err);
22
23char *argot_install_text(const char *str);
24void argot_destroy_text(void);
25struct argot_symtab *argot_text_table(void);
26
27void argot_parse_line_directive(char *text, argot_locus_t *ploc,
28 struct argot_locus_point *ppoint,
29 size_t *pxlines);
30void argot_parse_line_directive_cpp(char *text, argot_locus_t *ploc,
31 struct argot_locus_point *ppoint,
32 size_t *pxlines);
33
34void argot_line_acc_create(void);
35void argot_line_acc_free(void);
36void argot_line_acc_grow_char(int c);
37int argot_line_acc_grow_char_unescape(int c);
38void argot_line_acc_grow(const char *text, size_t len);
39void argot_line_acc_grow_unescape_last(char *text, size_t len,
40 argot_locus_t const *loc);
41
42void argot_line_begin(void);
43#define argot_line_add argot_line_acc_grow
44char *argot_line_finish(void);
45
46int argot_str_is_ipv4(const char *addr);
47int argot_str_is_num(const char *s);
48int argot_str_is_ipv6(const char *addr);
49int argot_str_is_num(const char *s);
50int argot_str_is_ipaddr(const char *addr);
51
52#endif
diff --git a/include/argot/list.h b/include/argot/list.h
new file mode 100644
index 0000000..8293fc6
--- /dev/null
+++ b/include/argot/list.h
@@ -0,0 +1,54 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_LIST_H
18#define _ARGOT_LIST_H
19
20typedef struct argot_list_entry *argot_list_entry_ptr_t;
21typedef struct argot_list *argot_list_ptr_t;
22
23struct argot_list_entry {
24 struct argot_list_entry *next, *prev;
25 void *data;
26};
27
28struct argot_list {
29 struct argot_list_entry *head, *tail;
30 size_t count;
31 int (*cmp)(const void *, const void *);
32 void (*free_entry)(void *);
33};
34
35argot_list_ptr_t argot_list_create(void);
36size_t argot_list_size(argot_list_ptr_t);
37void argot_list_append(argot_list_ptr_t, void *);
38void argot_list_push(argot_list_ptr_t, void *);
39void *argot_list_pop(argot_list_ptr_t);
40void *argot_list_locate(argot_list_ptr_t, void *);
41void *argot_list_index(argot_list_ptr_t, size_t);
42void *argot_list_remove_tail(argot_list_ptr_t);
43void argot_list_remove_entry(argot_list_ptr_t, argot_list_entry_ptr_t);
44void argot_list_clear(argot_list_ptr_t);
45void argot_list_free(argot_list_ptr_t);
46void argot_list_add(argot_list_ptr_t, argot_list_ptr_t);
47int argot_list_compare(argot_list_ptr_t, argot_list_ptr_t);
48
49/* FIXME */
50struct argot_list *_argot_simple_list_create(int dispose);
51struct argot_list *argot_value_list_create(void);
52
53
54#endif
diff --git a/include/grecs/locus.h b/include/argot/locus.h
index 4ca6d21..1f8071b 100644
--- a/include/grecs/locus.h
+++ b/include/argot/locus.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System 1/* argot - Gray's Extensible Configuration System
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,29 +14,29 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_LOCUS_H 17#ifndef _ARGOT_LOCUS_H
18#define _GRECS_LOCUS_H 18#define _ARGOT_LOCUS_H
19 19
20struct grecs_locus_point { 20struct argot_locus_point {
21 char *file; 21 char *file;
22 unsigned line; 22 unsigned line;
23 unsigned col; 23 unsigned col;
24}; 24};
25 25
26#define grecs_locus_point_advance_line(loc) do { \ 26#define argot_locus_point_advance_line(loc) do { \
27 (loc).line++; \ 27 (loc).line++; \
28 (loc).col = 0; \ 28 (loc).col = 0; \
29 } while (0) 29 } while (0)
30 30
31#define GRECS_LOCUS_POINT_EQ(a,b) \ 31#define ARGOT_LOCUS_POINT_EQ(a,b) \
32 ((strcmp((a)->file, (b)->file) == 0) && ((a)->line == (b)->line)) 32 ((strcmp((a)->file, (b)->file) == 0) && ((a)->line == (b)->line))
33 33
34typedef struct grecs_locus { 34typedef struct argot_locus {
35 struct grecs_locus_point beg; 35 struct argot_locus_point beg;
36 struct grecs_locus_point end; 36 struct argot_locus_point end;
37} grecs_locus_t; 37} argot_locus_t;
38 38
39#define YYLTYPE grecs_locus_t 39#define YYLTYPE argot_locus_t
40 40
41#define YYLLOC_DEFAULT(Current, Rhs, N) \ 41#define YYLLOC_DEFAULT(Current, Rhs, N) \
42 do { \ 42 do { \
diff --git a/include/grecs/mem.h b/include/argot/mem.h
index de46b32..8607902 100644
--- a/include/grecs/mem.h
+++ b/include/argot/mem.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System -*- c -*- 1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,20 +14,20 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_MEM_H 17#ifndef _ARGOT_MEM_H
18#define _GRECS_MEM_H 18#define _ARGOT_MEM_H
19 19
20extern void *(*grecs_malloc_fun)(size_t size); 20extern void *(*argot_malloc_fun)(size_t size);
21extern void *(*grecs_realloc_fun)(void *ptr, size_t size); 21extern void *(*argot_realloc_fun)(void *ptr, size_t size);
22extern void (*grecs_alloc_die_fun)(void); 22extern void (*argot_alloc_die_fun)(void);
23extern void (*grecs_free_fun)(void *ptr); 23extern void (*argot_free_fun)(void *ptr);
24 24
25void *grecs_malloc(size_t size); 25void *argot_malloc(size_t size);
26void *grecs_zalloc(size_t size); 26void *argot_zalloc(size_t size);
27void *grecs_calloc(size_t nmemb, size_t size); 27void *argot_calloc(size_t nmemb, size_t size);
28void *grecs_realloc(void *ptr, size_t size); 28void *argot_realloc(void *ptr, size_t size);
29void grecs_alloc_die(void); 29void argot_alloc_die(void);
30char *grecs_strdup(const char *str); 30char *argot_strdup(const char *str);
31void grecs_free(void *ptr); 31void argot_free(void *ptr);
32 32
33#endif 33#endif
diff --git a/include/argot/node.h b/include/argot/node.h
new file mode 100644
index 0000000..fcf542e
--- /dev/null
+++ b/include/argot/node.h
@@ -0,0 +1,62 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_NODE_H
18#define _ARGOT_NODE_H
19
20#include <argot/locus.h>
21#include <argot/symtab.h>
22#include <argot/value.h>
23
24enum argot_node_type {
25 argot_node_root,
26 argot_node_stmt,
27 argot_node_block
28};
29
30typedef struct argot_node {
31 enum argot_node_type type;
32 argot_locus_t locus;
33 struct argot_node *up;
34 struct argot_node *down;
35 struct argot_node *next;
36 struct argot_node *prev;
37 char *ident;
38 argot_locus_t idloc;
39 union {
40 argot_value_t *value;
41 argot_symtab_ptr_t texttab;
42 } v;
43} argot_node_t;
44
45void argot_node_free(struct argot_node *node);
46struct argot_node *argot_node_create(enum argot_node_type type,
47 argot_locus_t *loc);
48struct argot_node *argot_node_create_points(enum argot_node_type type,
49 struct argot_locus_point beg,
50 struct argot_locus_point end);
51void argot_node_bind(struct argot_node *master, struct argot_node *node,
52 int dn);
53int argot_node_eq(struct argot_node *a, struct argot_node *b);
54int argot_node_unlink(struct argot_node *node);
55
56struct argot_node *argot_node_from_path(const char *path, const char *value);
57struct argot_node *argot_node_from_path_locus(const char *path,
58 const char *value,
59 argot_locus_t *locus,
60 argot_locus_t *vallocus);
61
62#endif
diff --git a/include/grecs/opt.h b/include/argot/opt.h
index 5153033..24d4035 100644
--- a/include/grecs/opt.h
+++ b/include/argot/opt.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System 1/* argot - Gray's Extensible Configuration System
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,15 +14,15 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_OPT_H 17#ifndef _ARGOT_OPT_H
18#define _GRECS_OPT_H 18#define _ARGOT_OPT_H
19 19
20struct grecs_proginfo { 20struct argot_proginfo {
21 const char *progname; 21 const char *progname;
22 char **subcmd; 22 char **subcmd;
23 const char *docstring; 23 const char *docstring;
24 const char *args_doc; 24 const char *args_doc;
25 struct grecs_opthelp *opthelp; 25 struct argot_opthelp *opthelp;
26 size_t optcount; 26 size_t optcount;
27 void (*print_help_hook)(FILE *stream); 27 void (*print_help_hook)(FILE *stream);
28 void (*print_version_hook)(FILE *stream); 28 void (*print_version_hook)(FILE *stream);
@@ -37,7 +37,7 @@ struct grecs_proginfo {
37 const char *epilogue; 37 const char *epilogue;
38}; 38};
39 39
40struct grecs_opthelp { 40struct argot_opthelp {
41 const char *opt; 41 const char *opt;
42 const char *arg; 42 const char *arg;
43 int is_optional; 43 int is_optional;
@@ -49,10 +49,10 @@ struct grecs_opthelp {
49#define GROUPCOLUMN 2 49#define GROUPCOLUMN 2
50#define USAGECOLUMN 13 50#define USAGECOLUMN 13
51 51
52void grecs_print_help(struct grecs_proginfo *pinfo); 52void argot_print_help(struct argot_proginfo *pinfo);
53void grecs_print_usage(struct grecs_proginfo *pinfo); 53void argot_print_usage(struct argot_proginfo *pinfo);
54void grecs_print_version_only(struct grecs_proginfo *pinfo, FILE *stream); 54void argot_print_version_only(struct argot_proginfo *pinfo, FILE *stream);
55void grecs_print_version(struct grecs_proginfo *pinfo, FILE *stream); 55void argot_print_version(struct argot_proginfo *pinfo, FILE *stream);
56 56
57#endif 57#endif
58 58
diff --git a/include/argot/parser.h b/include/argot/parser.h
new file mode 100644
index 0000000..286e42e
--- /dev/null
+++ b/include/argot/parser.h
@@ -0,0 +1,56 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_PARSER_H
18#define _ARGOT_PARSER_H
19
20typedef struct argot_node *(*argot_parser_t)(const char *name, int trace);
21
22#define ARGOT_TRACE_GRAM 0x01
23#define ARGOT_TRACE_LEX 0x02
24
25extern int argot_trace_flags;
26extern argot_parser_t argot_parser_fun;
27extern int argot_default_port;
28
29extern struct argot_locus_point argot_current_locus_point;
30extern argot_locus_t argot_locus;
31extern int argot_error_count;
32
33#define ARGOT_OPTION_ADJUST_STRING_LOCATIONS 0x01
34#define ARGOT_OPTION_QUOTED_STRING_CONCAT 0x02
35extern int argot_parser_options;
36
37/* Main entry point */
38struct argot_node *argot_parse(const char *name);
39void argot_gram_trace(int n);
40void argot_lex_trace(int n);
41
42/* Parsers: */
43struct argot_node *argot_argot_parser(const char *name, int traceflags);
44struct argot_node *argot_meta1_parser(const char *name, int traceflags);
45struct argot_node *argot_bind_parser(const char *name, int traceflags);
46struct argot_node *argot_dhcpd_parser(const char *name, int traceflags);
47struct argot_node *argot_git_parser(const char *name, int traceflags);
48struct argot_node *argot_path_parser(const char *name, int traceflags);
49
50
51/* Parser database */
52int argot_enumerate_parsers(int (*fun)(const char *, argot_parser_t, void *),
53 void *);
54argot_parser_t argot_get_parser_by_type(const char *type);
55
56#endif
diff --git a/include/argot/preproc.h b/include/argot/preproc.h
new file mode 100644
index 0000000..dc567c8
--- /dev/null
+++ b/include/argot/preproc.h
@@ -0,0 +1,46 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_PREPROC_H
18#define _ARGOT_PREPROC_H
19
20#include <sys/types.h>
21
22extern const char *argot_preprocessor;
23
24size_t argot_preproc_fill_buffer(char *buf, size_t size);
25void argot_preproc_add_include_dir(char *dir);
26int argot_preproc_init(const char *name);
27void argot_preproc_done(void);
28int argot_preproc_run(const char *config_file, const char *extpp);
29
30#define ARGOT_STD_INCLUDE 0x01
31#define ARGOT_USR_INCLUDE 0x02
32
33size_t argot_include_path_count(int flag);
34int argot_foreach_include_dir(int flag, int (*fun)(int, const char *, void *),
35 void *data);
36
37char *argot_find_include_file(const char *name, int allow_cwd);
38
39FILE *argot_preproc_extrn_start(const char *file, pid_t *ppid);
40void argot_preproc_extrn_shutdown(pid_t pid);
41
42void argot_include_path_clear(void);
43void argot_include_path_setup(const char *dir, ...);
44void argot_include_path_setup_v(char **dirs);
45
46#endif
diff --git a/include/argot/sockaddr.h b/include/argot/sockaddr.h
new file mode 100644
index 0000000..e5325c1
--- /dev/null
+++ b/include/argot/sockaddr.h
@@ -0,0 +1,66 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_SOCKADDR_H
18#define _ARGOT_SOCKADDR_H
19
20struct argot_sockaddr {
21#if ARGOT_SOCKADDR_LIST
22 struct argot_sockaddr *next;
23#endif
24 int len;
25 struct sockaddr *sa;
26};
27
28#if ARGOT_SOCKADDR_LIST
29
30#define ARGOT_AH_PASSIVE 0x01
31#define ARGOT_HINT_SERVICE 0x02
32#define ARGOT_HINT_PORT 0x04
33
34struct argot_sockaddr_hints {
35 int flags;
36 char *service;
37 unsigned short port;
38};
39
40extern struct argot_sockaddr_hints *argot_sockaddr_hints;
41
42struct argot_sockaddr *argot_sockaddr_new(size_t s);
43void argot_sockaddr_free(struct argot_sockaddr *p);
44
45int argot_str_to_sockaddr(struct argot_sockaddr **sap,
46 const char *arg, struct argot_sockaddr_hints *gh,
47 argot_locus_t const *locus);
48#endif
49
50#define ARGOT_INADDR_BYTES 16
51
52struct argot_cidr
53{
54 int family;
55 int len;
56 unsigned char address[ARGOT_INADDR_BYTES];
57 unsigned char netmask[ARGOT_INADDR_BYTES];
58};
59
60int argot_str_to_cidr(struct argot_cidr *pcidr, const char *str,
61 argot_locus_t const *locus);
62
63int argot_sockaddr_to_cidr(struct argot_cidr *cidr, const struct sockaddr *sa);
64int argot_sockadd_cidr_match(struct sockaddr *sa, struct argot_cidr *cidr);
65
66#endif
diff --git a/include/argot/symtab.h b/include/argot/symtab.h
new file mode 100644
index 0000000..b84f3b7
--- /dev/null
+++ b/include/argot/symtab.h
@@ -0,0 +1,53 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_SYMTAB_H
18#define _ARGOT_SYMTAB_H
19
20typedef struct argot_symtab *argot_symtab_ptr_t;
21typedef struct argot_syment *argot_syment_ptr_t;
22
23struct argot_syment {
24 char *name;
25};
26
27typedef int (*argot_symtab_enumerator_t)(void *sym, void *data);
28
29const char *argot_symtab_strerror(int rc);
30
31void *argot_symtab_lookup_or_install(argot_symtab_ptr_t st,
32 void *key, int *install);
33void argot_symtab_clear(argot_symtab_ptr_t st);
34argot_symtab_ptr_t argot_symtab_create(size_t elsize,
35 unsigned (*hash_fun)(void *, unsigned long),
36 int (*cmp_fun)(const void *, const void *),
37 int (*copy_fun)(void *, void *),
38 void *(*alloc_fun)(size_t),
39 void (*free_fun)(void *));
40argot_symtab_ptr_t argot_symtab_create_default(size_t elsize);
41
42void argot_symtab_free(argot_symtab_ptr_t pst);
43int argot_symtab_remove(argot_symtab_ptr_t st, void *elt);
44int argot_symtab_replace(argot_symtab_ptr_t st, void *ent, void **old_ent);
45int argot_symtab_enumerate(argot_symtab_ptr_t st,
46 argot_symtab_enumerator_t fun, void *data);
47
48size_t argot_symtab_count_entries(argot_symtab_ptr_t st);
49
50unsigned argot_hash_string(const char *name, unsigned long hashsize);
51unsigned argot_hash_string_ci(const char *name, unsigned long hashsize);
52
53#endif
diff --git a/include/argot/table.h b/include/argot/table.h
new file mode 100644
index 0000000..73d4a4d
--- /dev/null
+++ b/include/argot/table.h
@@ -0,0 +1,102 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_TABLE_H
18#define _ARGOT_TABLE_H
19
20#include <argot/node.h>
21
22enum argot_data_type {
23 argot_type_void,
24 argot_type_string,
25 argot_type_short,
26 argot_type_ushort,
27 argot_type_int,
28 argot_type_uint,
29 argot_type_long,
30 argot_type_ulong,
31 argot_type_size,
32/* argot_type_off,*/
33 argot_type_time,
34 argot_type_bool,
35 argot_type_ipv4,
36 argot_type_cidr,
37 argot_type_host,
38 argot_type_sockaddr,
39 argot_type_section,
40 argot_type_null
41};
42
43#define ARGOT_DFLT 0x00 /* Default keyword flags */
44#define ARGOT_AGGR 0x01 /* Multiple entries aggregate */
45#define ARGOT_MULT 0x02 /* Statement can appear multiple times */
46#define ARGOT_INAC 0x04 /* Inactive keyword */
47#define ARGOT_LIST 0x08 /* Value is a list of declared type */
48#define ARGOT_HIDDEN 0x10 /* Hidden keyword: don't display in help output */
49#define ARGOT_CONST 0x20 /* For string types: initial value is constant,
50 don't try to free it before assigning new value.
51 This flag is cleared after the first assignment.
52 */
53
54enum argot_callback_command {
55 argot_callback_section_begin,
56 argot_callback_section_end,
57 argot_callback_set_value
58};
59
60typedef int (*argot_callback_fn)(
61#if ARGOT_TREE_API
62 enum argot_callback_command cmd,
63 argot_node_t * /* node */,
64 void * /* varptr */,
65 void * /* cb_data */
66#else
67 enum argot_callback_command cmd,
68 argot_locus_t * /* locus */,
69 void * /* varptr */,
70 argot_value_t * /* value */,
71 void * /* cb_data */
72#endif
73 );
74
75struct argot_keyword {
76 const char *ident;
77 const char *argname;
78 const char *docstring;
79 enum argot_data_type type;
80 int flags;
81 void *varptr;
82 size_t offset;
83 argot_callback_fn callback;
84 void *callback_data;
85 struct argot_keyword *kwd;
86};
87
88extern int argot_string_convert(void *target, enum argot_data_type type,
89 const char *string,
90 argot_locus_t const *locus);
91extern void argot_process_ident(struct argot_keyword *kwp,
92 argot_value_t *value,
93 void *base,
94 argot_locus_t *locus);
95
96const char *argot_data_type_string(enum argot_data_type type);
97
98int argot_tree_process(struct argot_node *node, struct argot_keyword *kwd);
99int argot_tree_reduce(struct argot_node *node, struct argot_keyword *kwd,
100 int flags);
101
102#endif
diff --git a/include/argot/tree.h b/include/argot/tree.h
new file mode 100644
index 0000000..a3ad5c6
--- /dev/null
+++ b/include/argot/tree.h
@@ -0,0 +1,71 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_TREE_H
18#define _ARGOT_TREE_H
19
20#include <argot/node.h>
21
22int argot_tree_free(struct argot_node *node);
23void argot_tree_sort(struct argot_node *node,
24 int (*compare)(struct argot_node const *,
25 struct argot_node const *));
26struct argot_node *argot_tree_first_node(struct argot_node *tree);
27struct argot_node *argot_next_node(struct argot_node *node);
28
29struct argot_node *argot_find_node(struct argot_node *node, const char *path);
30
31enum argot_tree_recurse_op {
32 argot_tree_recurse_set,
33 argot_tree_recurse_pre,
34 argot_tree_recurse_post
35};
36
37enum argot_tree_recurse_res {
38 argot_tree_recurse_ok,
39 argot_tree_recurse_fail,
40 argot_tree_recurse_skip,
41 argot_tree_recurse_stop
42};
43
44typedef enum argot_tree_recurse_res
45 (*argot_tree_recursor_t)(enum argot_tree_recurse_op,
46 struct argot_node *, void *);
47
48int argot_tree_recurse(struct argot_node *node, argot_tree_recursor_t recfun,
49 void *data);
50int argot_tree_join(struct argot_node *dst, struct argot_node *src);
51
52enum argot_tree_recurse_res argot_node_exact_match(
53 enum argot_tree_recurse_op op,
54 struct argot_node *node, void *data);
55
56typedef struct argot_match_buf *argot_match_buf_t;
57struct argot_node *argot_match_first(struct argot_node *tree,
58 const char *pattern,
59 argot_match_buf_t *buf);
60struct argot_node *argot_match_next(struct argot_match_buf *buf);
61void argot_match_buf_free(struct argot_match_buf *buf);
62argot_match_buf_t argot_match_buf_create(int argc, char **argv,
63 struct argot_value **labelv);
64struct argot_node *argot_match_buf_first(struct argot_match_buf *buf,
65 struct argot_node *tree);
66struct argot_node *argot_match_buf_get_node(argot_match_buf_t buf);
67size_t argot_match_buf_get_args(argot_match_buf_t buf, char ***argv);
68struct argot_node *argot_match_buf_get_root(argot_match_buf_t buf);
69void argot_match_buf_set_root(argot_match_buf_t buf, struct argot_node *root);
70
71#endif
diff --git a/include/grecs/txtacc.h b/include/argot/txtacc.h
index d6dc1c4..bdcccbc 100644
--- a/include/grecs/txtacc.h
+++ b/include/argot/txtacc.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System -*- c -*- 1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,23 +14,23 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_TXTACC_H 17#ifndef _ARGOT_TXTACC_H
18#define _GRECS_TXTACC_H 18#define _ARGOT_TXTACC_H
19 19
20#define GRECS_TXTACC_BUFSIZE 1024 20#define ARGOT_TXTACC_BUFSIZE 1024
21typedef struct grecs_txtacc *grecs_txtacc_t; 21typedef struct argot_txtacc *argot_txtacc_t;
22 22
23grecs_txtacc_t grecs_txtacc_create(void); 23argot_txtacc_t argot_txtacc_create(void);
24void grecs_txtacc_free(grecs_txtacc_t); 24void argot_txtacc_free(argot_txtacc_t);
25void grecs_txtacc_grow(grecs_txtacc_t, const char *, size_t); 25void argot_txtacc_grow(argot_txtacc_t, const char *, size_t);
26void grecs_txtacc_grow_string(grecs_txtacc_t, const char *); 26void argot_txtacc_grow_string(argot_txtacc_t, const char *);
27void grecs_txtacc_grow_string_escape(grecs_txtacc_t, const char *); 27void argot_txtacc_grow_string_escape(argot_txtacc_t, const char *);
28#define grecs_txtacc_grow_char(acc,c) \ 28#define argot_txtacc_grow_char(acc,c) \
29 do { \ 29 do { \
30 char __ch = c; \ 30 char __ch = c; \
31 grecs_txtacc_grow(acc,&__ch,1); \ 31 argot_txtacc_grow(acc,&__ch,1); \
32 } while (0) 32 } while (0)
33char *grecs_txtacc_finish(grecs_txtacc_t, int); 33char *argot_txtacc_finish(argot_txtacc_t, int);
34void grecs_txtacc_free_string(grecs_txtacc_t, char *); 34void argot_txtacc_free_string(argot_txtacc_t, char *);
35 35
36#endif 36#endif
diff --git a/include/grecs/types.h.in b/include/argot/types.h.in
index b891a05..41f6628 100644
--- a/include/grecs/types.h.in
+++ b/include/argot/types.h.in
@@ -1,11 +1,11 @@
1#ifndef _GRECS_TYPES_H 1#ifndef _ARGOT_TYPES_H
2#define _GRECS_TYPES_H 2#define _ARGOT_TYPES_H
3 3
4#define GRECS_VERSION_MAJOR 1 4#define ARGOT_VERSION_MAJOR 1
5#define GRECS_VERSION_MINOR 0 5#define ARGOT_VERSION_MINOR 0
6 6
7#define GRECS_TREE_API @GRECS_TREE_API@ 7#define ARGOT_TREE_API @ARGOT_TREE_API@
8#define GRECS_SOCKADDR_LIST @GRECS_SOCKADDR_LIST@ 8#define ARGOT_SOCKADDR_LIST @ARGOT_SOCKADDR_LIST@
9 9
10#if ENABLE_NLS 10#if ENABLE_NLS
11# include "gettext.h" 11# include "gettext.h"
diff --git a/include/grecs/util.h b/include/argot/util.h
index cf3bee1..0208100 100644
--- a/include/grecs/util.h
+++ b/include/argot/util.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System -*- c -*- 1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,13 +14,13 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_UTIL_H 17#ifndef _ARGOT_UTIL_H
18#define _GRECS_UTIL_H 18#define _ARGOT_UTIL_H
19 19
20#include <stdarg.h> 20#include <stdarg.h>
21 21
22ssize_t grecs_getline(char **pbuf, size_t *psize, FILE *fp); 22ssize_t argot_getline(char **pbuf, size_t *psize, FILE *fp);
23int grecs_vasprintf(char **pbuf, size_t *psize, const char *fmt, va_list ap); 23int argot_vasprintf(char **pbuf, size_t *psize, const char *fmt, va_list ap);
24int grecs_asprintf(char **pbuf, size_t *psize, const char *fmt, ...); 24int argot_asprintf(char **pbuf, size_t *psize, const char *fmt, ...);
25 25
26#endif 26#endif
diff --git a/include/grecs/value.h b/include/argot/value.h
index 8cd2800..1bfc8b0 100644
--- a/include/grecs/value.h
+++ b/include/argot/value.h
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System -*- c -*- 1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -14,39 +14,39 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */ 15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16 16
17#ifndef _GRECS_VALUE_H 17#ifndef _ARGOT_VALUE_H
18#define _GRECS_VALUE_H 18#define _ARGOT_VALUE_H
19 19
20#include <grecs/locus.h> 20#include <argot/locus.h>
21#include <grecs/list.h> 21#include <argot/list.h>
22 22
23#define GRECS_TYPE_STRING 0 23#define ARGOT_TYPE_STRING 0
24#define GRECS_TYPE_LIST 1 24#define ARGOT_TYPE_LIST 1
25#define GRECS_TYPE_ARRAY 2 25#define ARGOT_TYPE_ARRAY 2
26 26
27typedef struct grecs_value { 27typedef struct argot_value {
28 int type; 28 int type;
29 grecs_locus_t locus; 29 argot_locus_t locus;
30 union { 30 union {
31 grecs_list_ptr_t list; 31 argot_list_ptr_t list;
32 char *string; 32 char *string;
33 struct { 33 struct {
34 size_t c; 34 size_t c;
35 struct grecs_value **v; 35 struct argot_value **v;
36 } arg; 36 } arg;
37 } v; 37 } v;
38} grecs_value_t; 38} argot_value_t;
39 39
40#define GRECS_VALUE_EMPTY_P(val) \ 40#define ARGOT_VALUE_EMPTY_P(val) \
41 (!(val) || \ 41 (!(val) || \
42 ((val)->type == GRECS_TYPE_STRING && (val)->v.string == NULL)) 42 ((val)->type == ARGOT_TYPE_STRING && (val)->v.string == NULL))
43 43
44void grecs_value_free(struct grecs_value *val); 44void argot_value_free(struct argot_value *val);
45void grecs_value_free_content(struct grecs_value *val); 45void argot_value_free_content(struct argot_value *val);
46grecs_value_t *grecs_value_ptr_from_static(grecs_value_t *input); 46argot_value_t *argot_value_ptr_from_static(argot_value_t *input);
47 47
48int grecs_value_eq(struct grecs_value *a, struct grecs_value *b); 48int argot_value_eq(struct argot_value *a, struct argot_value *b);
49int grecs_value_match(struct grecs_value *pat, struct grecs_value *b, 49int argot_value_match(struct argot_value *pat, struct argot_value *b,
50 int flags); 50 int flags);
51 51
52#endif 52#endif
diff --git a/include/grecs/version.h b/include/argot/version.h
index f37adc6..bfbcd97 100644
--- a/include/grecs/version.h
+++ b/include/argot/version.h
@@ -1,4 +1,4 @@