aboutsummaryrefslogtreecommitdiff
path: root/lib/libedit/makelist
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libedit/makelist')
-rw-r--r--lib/libedit/makelist34
1 files changed, 22 insertions, 12 deletions
diff --git a/lib/libedit/makelist b/lib/libedit/makelist
index 6bb2476b779b..ec3292fa53bc 100644
--- a/lib/libedit/makelist
+++ b/lib/libedit/makelist
@@ -1,6 +1,6 @@
#!/bin/sh -
-# $NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $
# $FreeBSD$
+# $NetBSD: makelist,v 1.18 2012/03/21 05:34:54 matt Exp $
#
# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
@@ -37,7 +37,7 @@
# makelist.sh: Automatically generate header files...
AWK=awk
-USAGE="usage: $0 -h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
+USAGE="Usage: $0 -n|-h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
if [ "x$1" = "x" ]
then
@@ -54,6 +54,15 @@ case $FLAG in
# generate foo.h file from foo.c
#
+-n)
+ cat << _EOF
+#include "config.h"
+#undef WIDECHAR
+#define NARROWCHAR
+#include "${FILES}"
+_EOF
+ ;;
+
-h)
set - `echo $FILES | sed -e 's/\\./_/g'`
hdr="_h_`basename $1`"
@@ -70,7 +79,7 @@ case $FLAG in
# XXX: need a space between name and prototype so that -fc and -fh
# parsing is much easier
#
- printf("protected el_action_t\t%s (EditLine *, int);\n", name);
+ printf("protected el_action_t\t%s (EditLine *, Int);\n", name);
}
}
END {
@@ -84,7 +93,8 @@ case $FLAG in
cat $FILES | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"sys.h\"\n#include \"el.h\"\n");
+ printf("#include \"config.h\"\n#include \"el.h\"\n");
+ printf("#include \"chartype.h\"\n");
printf("private const struct el_bindings_t el_func_help[] = {\n");
low = "abcdefghijklmnopqrstuvwxyz_";
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
@@ -105,22 +115,22 @@ case $FLAG in
fname = fname s;
}
- printf(" { %-30.30s %-30.30s\n","\"" fname "\",", uname ",");
+ printf(" { %-30.30s %-30.30s\n","STR(\"" fname "\"),", uname ",");
ok = 1;
}
}
/^ \*/ {
if (ok) {
- printf(" \"");
+ printf(" STR(\"");
for (i = 2; i < NF; i++)
printf("%s ", $i);
- printf("%s\" },\n", $i);
+ printf("%s\") },\n", $i);
ok = 0;
}
}
END {
printf("};\n");
- printf("\nprotected const el_bindings_t* help__get()");
+ printf("\nprotected const el_bindings_t* help__get(void)");
printf("{ return el_func_help; }\n");
}'
;;
@@ -141,7 +151,7 @@ case $FLAG in
#
-fh)
cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
- sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK '
+ sort | tr '[:lower:]' '[:upper:]' | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n");
@@ -153,7 +163,7 @@ case $FLAG in
END {
printf("#define\t%-30.30s\t%3d\n", "EL_NUM_FCNS", count);
- printf("typedef el_action_t (*el_func_t)(EditLine *, int);");
+ printf("typedef el_action_t (*el_func_t)(EditLine *, Int);");
printf("\nprotected const el_func_t* func__get(void);\n");
printf("#endif /* _h_fcns_c */\n");
}'
@@ -165,7 +175,7 @@ case $FLAG in
cat $FILES | $AWK '/el_action_t/ { print $3 }' | sort | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"sys.h\"\n#include \"el.h\"\n");
+ printf("#include \"config.h\"\n#include \"el.h\"\n");
printf("private const el_func_t el_func[] = {");
maxlen = 80;
needn = 1;
@@ -186,7 +196,7 @@ case $FLAG in
}
END {
printf("\n};\n");
- printf("\nprotected const el_func_t* func__get() { return el_func; }\n");
+ printf("\nprotected const el_func_t* func__get(void) { return el_func; }\n");
}'
;;