3 # Copyright (c) 1992, 1993
4 # The Regents of the University of California. All rights reserved.
6 # This code is derived from software contributed to Berkeley by
7 # Christos Zoulas of Cornell University.
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
12 # 1. Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # 2. Redistributions in binary form must reproduce the above copyright
15 # notice, this list of conditions and the following disclaimer in the
16 # documentation and/or other materials provided with the distribution.
17 # 3. All advertising materials mentioning features or use of this software
18 # must display the following acknowledgement:
19 # This product includes software developed by the University of
20 # California, Berkeley and its contributors.
21 # 4. Neither the name of the University nor the names of its contributors
22 # may be used to endorse or promote products derived from this software
23 # without specific prior written permission.
25 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 # @(#)makelist 5.3 (Berkeley) 6/4/93
39 # makelist.sh: Automatically generate header files...
42 USAGE="Usage: $0 -h|-e|-fc|-fh|-bc|-bh <filenames>"
65 printf("/* Automatically generated file, do not edit */\n");
66 printf("#ifndef %s\n#define %s\n", "'$hdr'", "'$hdr'");
69 pr = substr($2, 1, 2);
70 if (pr == "vi" || pr == "em" || pr == "ed") {
71 name = substr($2, 1, length($2) - 3);
72 printf("protected el_action_t\t%-25.25s __P((EditLine *, int));\n", name);
76 printf("#endif /* %s */\n", "'$hdr'");
81 printf("/* Automatically generated file, do not edit */\n");
82 printf("#include \"sys.h\"\n#include \"el.h\"\n");
83 printf("private struct el_bindings_t el_func_help[] = {\n");
84 low = "abcdefghijklmnopqrstuvwxyz_";
85 high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
86 for (i = 1; i <= length(low); i++)
87 tr[substr(low, i, 1)] = substr(high, i, 1);
90 pr = substr($2, 1, 2);
91 if (pr == "vi" || pr == "em" || pr == "ed") {
92 name = substr($2, 1, length($2) - 3);
95 for (i = 1; i <= length(name); i++) {
96 s = substr(name, i, 1);
103 printf(" { %-30.30s %-30.30s\n","\"" fname "\",", uname ",");
110 for (i = 2; i < NF; i++)
112 printf("%s\" },\n", $i);
117 printf(" { NULL, 0, NULL }\n");
119 printf("\nprotected el_bindings_t* help__get()");
120 printf("{ return el_func_help; }\n");
125 printf("/* Automatically generated file, do not edit */\n");
126 printf("#ifndef _h_help_c\n#define _h_help_c\n");
127 printf("protected el_bindings_t *help__get\t__P((void));\n");
128 printf("#endif /* _h_help_c */\n");
131 cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
132 sort | tr '[a-z]' '[A-Z]' | $AWK '
134 printf("/* Automatically generated file, do not edit */\n");
135 printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n");
139 printf("#define\t%-30.30s\t%3d\n", $1, count++);
142 printf("#define\t%-30.30s\t%3d\n", "EL_NUM_FCNS", count);
144 printf("typedef el_action_t (*el_func_t) __P((EditLine *, int));");
145 printf("\nprotected el_func_t* func__get __P((void));\n");
146 printf("#endif /* _h_fcns_c */\n");
149 cat $FILES | $AWK '/el_action_t/ { print $3 }' | sort | $AWK '
151 printf("/* Automatically generated file, do not edit */\n");
152 printf("#include \"sys.h\"\n#include \"el.h\"\n");
153 printf("private el_func_t el_func[] = {");
169 printf("%-26.26s ", s);
173 printf("\nprotected el_func_t* func__get() { return el_func; }\n");
176 echo "$FILES" | tr ' ' '\012' | $AWK '
178 printf("/* Automatically generated file, do not edit */\n");
179 printf("#define protected static\n");
180 printf("#define SCCSID\n");
183 printf("#include \"%s\"\n", $1);