]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/zwgc/substitute.h
5c0bb554d87a936a050605eeede69dc97c91ea91
[1ts-debian.git] / zephyr / zwgc / substitute.h
1 /* This file is part of the Project Athena Zephyr Notification System.
2  * It is one of the source files comprising zwgc, the Zephyr WindowGram
3  * client.
4  *
5  *      Created by:     Marc Horowitz <marc@athena.mit.edu>
6  *
7  *      $Id$
8  *
9  *      Copyright (c) 1989 by the Massachusetts Institute of Technology.
10  *      For copying and distribution information, see the file
11  *      "mit-copyright.h".
12  */
13
14
15 #include <zephyr/mit-copyright.h>
16
17 #ifndef substitute_MODULE
18 #define substitute_MODULE
19
20 #include "new_string.h"
21
22 /*
23  *    string substitute(string (*lookup)(string); string text)
24  *        Effects: returns the result of expanding all variable
25  *                 references in text using lookup.  Example:
26  *                 "test $foo.$bar baz" would be translated to
27  *                 "text <foo>.<bar> baz" where "<foo>" is the value of
28  *                 lookup("foo") and "<bar>" is the value of lookup("bar").
29  *                 Variables are case sensitive and have the form
30  *                 {identifier_char}+ where identifier_char is defined
31  *                 in lexer.h by is_identifier_char.  $(foo) and
32  *                 ${foo} are alternate forms for $foo.  In particular,
33  *                 ${foo}bar is a reference to foo followed by "bar" while
34  *                 $foobar is a reference to foobar.  Incomplete variable
35  *                 references like $(foo bar are displayed as if they
36  *                 were not variable references.  To allow quoting, "$$"
37  *                 is translated to "$".  Only the first
38  *                 MAX_IDENTIFIER_LENGTH characters of an identifier are
39  *                 significant.  The strings returned by lookup are not
40  *                 modified in any way or freed.
41  */
42
43 extern string substitute();
44
45 #endif