aboutsummaryrefslogtreecommitdiff
path: root/src/pp-setup
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-04-20 14:48:39 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-04-20 14:48:39 +0300
commit0f081a2643ba0a7f7a5dcfb6a5977d9da1d2b6db (patch)
treeb62e9404cd5dfdfa471ec1202e183f9ca92187e5 /src/pp-setup
parent0983c9ab7a6ea5b3592a297e029a935cc0e4bebc (diff)
downloadgrecs-0f081a2643ba0a7f7a5dcfb6a5977d9da1d2b6db.tar.gz
grecs-0f081a2643ba0a7f7a5dcfb6a5977d9da1d2b6db.tar.bz2
Diverge from Wydawca gconf/ subdirectory into a separate project
Diffstat (limited to 'src/pp-setup')
-rw-r--r--src/pp-setup106
1 files changed, 106 insertions, 0 deletions
diff --git a/src/pp-setup b/src/pp-setup
new file mode 100644
index 0000000..bf4fb7d
--- /dev/null
+++ b/src/pp-setup
@@ -0,0 +1,106 @@
1divert(-1) dnl -*- m4 -*-
2# This file is part of grecs - Gray's Extensible Configuration System
3# Copyright (C) 2007, 2009 Sergey Poznyakoff
4#
5# Grex is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3, or (at your option)
8# any later version.
9#
10# Grex is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with Grex. If not, see <http://www.gnu.org/licenses/>.
17
18changecom(/*,*/)
19
20/* ------------------------------
21 * Simulate --prefix-builtins.
22 * Borrowed from Autoconf
23 * ------------------------------- */
24
25define(`m4_define', defn(`define'))
26define(`m4_defn', defn(`defn'))
27define(`m4_undefine', defn(`undefine'))
28
29m4_undefine(`define')
30m4_undefine(`defn')
31m4_undefine(`undefine')
32
33/* m4_copy(SRC, DST)
34 * -----------------
35 * Define DST as the definition of SRC.
36 * What's the difference between:
37 * 1. m4_copy(`from', `to')
38 * 2. m4_define(`to', `from($@)')
39 * Well, obviously 1 is more expensive in space. Maybe 2 is more expensive
40 * in time, but because of the space cost of 1, it's not that obvious.
41 * Nevertheless, one huge difference is the handling of `$0'. If `from'
42 * uses `$0', then with 1, `to''s `$0' is `to', while it is `from' in 2.
43 * The user will certainly prefer to see `to'.
44 */
45m4_define(`m4_copy',
46`m4_define(`$2', m4_defn(`$1'))')
47
48/* m4_rename(SRC, DST)
49 * -------------------
50 * Rename the macro SRC as DST.
51 */
52m4_define(`m4_rename',
53`m4_copy(`$1', `$2')m4_undefine(`$1')')
54
55/* m4_rename_m4(MACRO-NAME)
56 * ------------------------
57 * Rename MACRO-NAME as m4_MACRO-NAME.
58 */
59m4_define(`m4_rename_m4',
60`m4_rename(`$1', `m4_$1')')
61
62/* Some m4 internals have names colliding with tokens we might use.
63 * Rename them a` la `m4 --prefix-builtins'.
64 */
65m4_rename_m4(`builtin')
66m4_rename_m4(`changecom')
67m4_rename_m4(`changequote')
68m4_rename_m4(`debugfile')
69m4_rename_m4(`debugmode')
70m4_rename_m4(`decr')
71m4_rename_m4(`divert')
72m4_rename_m4(`divnum')
73m4_rename_m4(`dumpdef')
74m4_rename_m4(`errprint')
75m4_rename_m4(`esyscmd')
76m4_rename_m4(`eval')
77m4_rename_m4(`format')
78m4_rename_m4(`ifdef')
79m4_rename_m4(`ifelse')
80m4_rename_m4(`include')
81m4_rename_m4(`incr')
82m4_rename_m4(`index')
83m4_rename_m4(`indir')
84m4_rename_m4(`len')
85m4_rename(`m4exit', `m4_exit')
86m4_rename(`m4wrap', `m4_wrap')
87m4_rename_m4(`maketemp')
88m4_rename_m4(`patsubst')
89m4_rename_m4(`popdef')
90m4_rename_m4(`pushdef')
91m4_rename_m4(`regexp')
92m4_rename_m4(`shift')
93m4_rename_m4(`sinclude')
94m4_rename_m4(`substr')
95m4_rename_m4(`symbols')
96m4_rename_m4(`syscmd')
97m4_rename_m4(`sysval')
98m4_rename_m4(`traceoff')
99m4_rename_m4(`traceon')
100m4_rename_m4(`translit')
101m4_rename_m4(`undivert')
102m4_rename_m4(`dnl')
103m4_rename_m4(`__line__')
104m4_rename_m4(`__file__')
105
106m4_divert(0)m4_dnl

Return to:

Send suggestions and report system problems to the System administrator.