head	1.12;
access;
symbols
	RELENG_8_4:1.12.0.2
	RELENG_9_1_0_RELEASE:1.10.16.1.4.2
	RELENG_9_1:1.10.16.1.0.4
	RELENG_9_1_BP:1.10.16.1
	RELENG_8_3_0_RELEASE:1.10.10.1.8.1
	RELENG_8_3:1.10.10.1.0.8
	RELENG_8_3_BP:1.10.10.1
	RELENG_9_0_0_RELEASE:1.10.16.1.2.1
	RELENG_9_0:1.10.16.1.0.2
	RELENG_9_0_BP:1.10.16.1
	RELENG_9:1.10.0.16
	RELENG_9_BP:1.10
	RELENG_7_4_0_RELEASE:1.10.14.1
	RELENG_8_2_0_RELEASE:1.10.10.1.6.1
	RELENG_7_4:1.10.0.14
	RELENG_7_4_BP:1.10
	RELENG_8_2:1.10.10.1.0.6
	RELENG_8_2_BP:1.10.10.1
	RELENG_8_1_0_RELEASE:1.10.10.1.4.1
	RELENG_8_1:1.10.10.1.0.4
	RELENG_8_1_BP:1.10.10.1
	RELENG_7_3_0_RELEASE:1.10.12.1
	RELENG_7_3:1.10.0.12
	RELENG_7_3_BP:1.10
	RELENG_8_0_0_RELEASE:1.10.10.1.2.1
	RELENG_8_0:1.10.10.1.0.2
	RELENG_8_0_BP:1.10.10.1
	RELENG_8:1.10.0.10
	RELENG_8_BP:1.10
	RELENG_7_2_0_RELEASE:1.10.8.1
	RELENG_7_2:1.10.0.8
	RELENG_7_2_BP:1.10
	RELENG_7_1_0_RELEASE:1.10.6.1
	RELENG_6_4_0_RELEASE:1.8.10.1.10.1
	RELENG_7_1:1.10.0.6
	RELENG_7_1_BP:1.10
	RELENG_6_4:1.8.10.1.0.10
	RELENG_6_4_BP:1.8.10.1
	RELENG_7_0_0_RELEASE:1.10
	RELENG_6_3_0_RELEASE:1.8.10.1
	RELENG_7_0:1.10.0.4
	RELENG_7_0_BP:1.10
	RELENG_6_3:1.8.10.1.0.8
	RELENG_6_3_BP:1.8.10.1
	RELENG_7:1.10.0.2
	RELENG_7_BP:1.10
	RELENG_6_2_0_RELEASE:1.8.10.1
	RELENG_6_2:1.8.10.1.0.6
	RELENG_6_2_BP:1.8.10.1
	RELENG_5_5_0_RELEASE:1.8.4.1
	RELENG_5_5:1.8.4.1.0.2
	RELENG_5_5_BP:1.8.4.1
	RELENG_6_1_0_RELEASE:1.8.10.1
	RELENG_6_1:1.8.10.1.0.4
	RELENG_6_1_BP:1.8.10.1
	RELENG_6_0_0_RELEASE:1.8.10.1
	RELENG_6_0:1.8.10.1.0.2
	RELENG_6_0_BP:1.8.10.1
	RELENG_6:1.8.0.10
	RELENG_6_BP:1.8
	RELENG_5_4_0_RELEASE:1.8
	RELENG_5_4:1.8.0.8
	RELENG_5_4_BP:1.8
	RELENG_4_11_0_RELEASE:1.3
	RELENG_4_11:1.3.0.24
	RELENG_4_11_BP:1.3
	RELENG_5_3_0_RELEASE:1.8
	RELENG_5_3:1.8.0.6
	RELENG_5_3_BP:1.8
	RELENG_5:1.8.0.4
	RELENG_5_BP:1.8
	RELENG_4_10_0_RELEASE:1.3
	RELENG_4_10:1.3.0.22
	RELENG_4_10_BP:1.3
	RELENG_5_2_1_RELEASE:1.8
	RELENG_5_2_0_RELEASE:1.8
	RELENG_5_2:1.8.0.2
	RELENG_5_2_BP:1.8
	RELENG_4_9_0_RELEASE:1.3
	RELENG_4_9:1.3.0.20
	RELENG_4_9_BP:1.3
	RELENG_5_1_0_RELEASE:1.5
	RELENG_5_1:1.5.0.4
	RELENG_5_1_BP:1.5
	RELENG_4_8_0_RELEASE:1.3
	RELENG_4_8:1.3.0.18
	RELENG_4_8_BP:1.3
	RELENG_5_0_0_RELEASE:1.5
	RELENG_5_0:1.5.0.2
	RELENG_5_0_BP:1.5
	RELENG_4_7_0_RELEASE:1.3
	RELENG_4_7:1.3.0.16
	RELENG_4_7_BP:1.3
	RELENG_4_6_2_RELEASE:1.3
	RELENG_4_6_1_RELEASE:1.3
	RELENG_4_6_0_RELEASE:1.3
	RELENG_4_6:1.3.0.14
	RELENG_4_6_BP:1.3
	RELENG_4_5_0_RELEASE:1.3
	RELENG_4_5:1.3.0.12
	RELENG_4_5_BP:1.3
	RELENG_4_4_0_RELEASE:1.3
	RELENG_4_4:1.3.0.10
	RELENG_4_4_BP:1.3
	RELENG_4_3_0_RELEASE:1.3
	RELENG_4_3:1.3.0.8
	RELENG_4_3_BP:1.3
	RELENG_4_2_0_RELEASE:1.3
	RELENG_4_1_1_RELEASE:1.3
	PRE_SMPNG:1.3
	RELENG_4_1_0_RELEASE:1.3
	RELENG_3_5_0_RELEASE:1.3
	RELENG_4_0_0_RELEASE:1.3
	RELENG_4:1.3.0.6
	RELENG_4_BP:1.3
	RELENG_3_4_0_RELEASE:1.3
	RELENG_3_3_0_RELEASE:1.3
	RELENG_3_2_PAO:1.3.0.4
	RELENG_3_2_PAO_BP:1.3
	RELENG_3_2_0_RELEASE:1.3
	RELENG_3_1_0_RELEASE:1.3
	RELENG_3:1.3.0.2
	RELENG_3_BP:1.3
	RELENG_2_2_8_RELEASE:1.1.1.1.8.2
	RELENG_3_0_0_RELEASE:1.3
	RELENG_2_2_7_RELEASE:1.1.1.1.8.2
	RELENG_2_2_6_RELEASE:1.1.1.1.8.1
	RELENG_2_2_5_RELEASE:1.1.1.1
	bsd_44_lite_2:1.1.1.1
	RELENG_2_2_2_RELEASE:1.1.1.1
	RELENG_2_2_1_RELEASE:1.1.1.1
	RELENG_2_2_0_RELEASE:1.1.1.1
	RELENG_2_1_7_RELEASE:1.1.1.1
	RELENG_2_1_6_1_RELEASE:1.1.1.1
	RELENG_2_1_6_RELEASE:1.1.1.1
	RELENG_2_2:1.1.1.1.0.8
	RELENG_2_2_BP:1.1.1.1
	RELENG_2_1_5_RELEASE:1.1.1.1
	RELENG_2_1_0_RELEASE:1.1.1.1
	RELENG_2_1_0:1.1.1.1.0.6
	RELENG_2_1_0_BP:1.1.1.1
	RELENG_2_0_5_RELEASE:1.1.1.1
	RELENG_2_0_5:1.1.1.1.0.4
	RELENG_2_0_5_BP:1.1.1.1
	RELENG_2_0_5_ALPHA:1.1.1.1
	RELEASE_2_0:1.1.1.1
	BETA_2_0:1.1.1.1
	ALPHA_2_0:1.1.1.1.0.2
	bsd_44_lite:1.1.1.1
	CSRG:1.1.1;
locks; strict;
comment	@# @;


1.12
date	2012.11.17.01.49.49;	author svnexp;	state Exp;
branches
	1.12.2.1;
next	1.11;

1.11
date	2012.07.19.19.15.47;	author pfg;	state Exp;
branches;
next	1.10;

1.10
date	2005.10.04.21.59.29;	author stefanf;	state Exp;
branches
	1.10.2.1
	1.10.6.1
	1.10.8.1
	1.10.10.1
	1.10.12.1
	1.10.14.1
	1.10.16.1;
next	1.9;

1.9
date	2005.08.07.20.51.52;	author stefanf;	state Exp;
branches;
next	1.8;

1.8
date	2003.08.04.21.31.51;	author ache;	state Exp;
branches
	1.8.4.1
	1.8.10.1;
next	1.7;

1.7
date	2003.08.04.15.24.06;	author ache;	state Exp;
branches;
next	1.6;

1.6
date	2003.08.04.14.10.33;	author ache;	state Exp;
branches;
next	1.5;

1.5
date	2002.04.22.13.44.24;	author des;	state Exp;
branches;
next	1.4;

1.4
date	2001.10.01.08.41.25;	author obrien;	state Exp;
branches;
next	1.3;

1.3
date	98.05.27.07.39.05;	author jkh;	state Exp;
branches;
next	1.2;

1.2
date	97.07.23.18.23.42;	author msmith;	state Exp;
branches;
next	1.1;

1.1
date	94.05.27.04.58.50;	author rgrimes;	state Exp;
branches
	1.1.1.1;
next	;

1.12.2.1
date	2012.11.17.01.49.49;	author svnexp;	state dead;
branches;
next	1.12.2.2;

1.12.2.2
date	2013.03.28.13.03.14;	author svnexp;	state Exp;
branches;
next	;

1.10.2.1
date	2012.11.17.08.02.41;	author svnexp;	state Exp;
branches;
next	;

1.10.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.10.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.10.10.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.10.10.1.2.1
	1.10.10.1.4.1
	1.10.10.1.6.1
	1.10.10.1.8.1;
next	1.10.10.2;

1.10.10.2
date	2012.08.22.20.07.10;	author pfg;	state Exp;
branches;
next	1.10.10.3;

1.10.10.3
date	2012.11.17.10.36.07;	author svnexp;	state Exp;
branches;
next	;

1.10.10.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.10.10.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.10.10.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.10.10.1.8.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.10.10.1.8.2;

1.10.10.1.8.2
date	2012.11.17.08.24.48;	author svnexp;	state Exp;
branches;
next	;

1.10.12.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.10.14.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.10.14.2;

1.10.14.2
date	2012.11.17.08.16.47;	author svnexp;	state Exp;
branches;
next	;

1.10.16.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.10.16.1.2.1
	1.10.16.1.4.1;
next	1.10.16.2;

1.10.16.2
date	2012.08.22.20.06.59;	author pfg;	state Exp;
branches;
next	1.10.16.3;

1.10.16.3
date	2012.11.17.11.36.23;	author svnexp;	state Exp;
branches;
next	;

1.10.16.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.10.16.1.2.2;

1.10.16.1.2.2
date	2012.11.17.08.36.23;	author svnexp;	state Exp;
branches;
next	;

1.10.16.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.10.16.1.4.2;

1.10.16.1.4.2
date	2012.11.17.08.47.12;	author svnexp;	state Exp;
branches;
next	;

1.8.4.1
date	2006.01.09.18.02.39;	author stefanf;	state Exp;
branches;
next	;

1.8.10.1
date	2005.10.09.03.44.01;	author delphij;	state Exp;
branches
	1.8.10.1.10.1;
next	1.8.10.2;

1.8.10.2
date	2012.11.17.07.40.23;	author svnexp;	state Exp;
branches;
next	;

1.8.10.1.10.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.1.1.1
date	94.05.27.04.58.51;	author rgrimes;	state Exp;
branches
	1.1.1.1.8.1;
next	;

1.1.1.1.8.1
date	98.01.28.02.13.00;	author msmith;	state Exp;
branches;
next	1.1.1.1.8.2;

1.1.1.1.8.2
date	98.05.30.16.22.24;	author jhay;	state Exp;
branches;
next	;


desc
@@


1.12
log
@Switching exporter and resync
@
text
@#!/bin/sh -
#	$NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $
# $FreeBSD: head/lib/libedit/makelist 238624 2012-07-19 19:15:47Z pfg $
#
# Copyright (c) 1992, 1993
#	The Regents of the University of California.  All rights reserved.
#
# This code is derived from software contributed to Berkeley by
# Christos Zoulas of Cornell University.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#	@@(#)makelist	5.3 (Berkeley) 6/4/93

# makelist.sh: Automatically generate header files...

AWK=awk
USAGE="usage: $0 -h|-e|-fc|-fh|-bc|-bh|-m <filenames>"

if [ "x$1" = "x" ]
then
    echo $USAGE 1>&2
    exit 1
fi

FLAG="$1"
shift

FILES="$@@"

case $FLAG in

#	generate foo.h file from foo.c
#
-h)
    set - `echo $FILES | sed -e 's/\\./_/g'`
    hdr="_h_`basename $1`"
    cat $FILES | $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#ifndef %s\n#define %s\n", "'$hdr'", "'$hdr'");
	}
	/\(\):/ {
	    pr = substr($2, 1, 2);
	    if (pr == "vi" || pr == "em" || pr == "ed") {
		name = substr($2, 1, length($2) - 3);
#
# 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);
	    }
	}
	END {
	    printf("#endif /* %s */\n", "'$hdr'");
	}'
	;;

#	generate help.c from various .c files
#
-bc)
    cat $FILES | $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#include \"sys.h\"\n#include \"el.h\"\n");
	    printf("private const struct el_bindings_t el_func_help[] = {\n");
	    low = "abcdefghijklmnopqrstuvwxyz_";
	    high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
	    for (i = 1; i <= length(low); i++)
		tr[substr(low, i, 1)] = substr(high, i, 1);
	}
	/\(\):/ {
	    pr = substr($2, 1, 2);
	    if (pr == "vi" || pr == "em" || pr == "ed") {
		name = substr($2, 1, length($2) - 3);
		uname = "";
		fname = "";
		for (i = 1; i <= length(name); i++) {
		    s = substr(name, i, 1);
		    uname = uname tr[s];
		    if (s == "_")
			s = "-";
		    fname = fname s;
		}

		printf("    { %-30.30s %-30.30s\n","\"" fname "\",", uname ",");
		ok = 1;
	    }
	}
	/^ \*/ {
	    if (ok) {
		printf("      \"");
		for (i = 2; i < NF; i++)
		    printf("%s ", $i);
		printf("%s\" },\n", $i);
		ok = 0;
	    }
	}
	END {
	    printf("};\n");
	    printf("\nprotected const el_bindings_t* help__get()");
	    printf("{ return el_func_help; }\n");
	}'
	;;

#	generate help.h from various .c files
#
-bh)
    $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#ifndef _h_help_c\n#define _h_help_c\n");
	    printf("protected const el_bindings_t *help__get(void);\n");
	    printf("#endif /* _h_help_c */\n");
	}' /dev/null
	;;

#	generate fcns.h from various .h files
#
-fh)
    cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
    sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n");
	    count = 0;
	}
	{
	    printf("#define\t%-30.30s\t%3d\n", $1, count++);
	}
	END {
	    printf("#define\t%-30.30s\t%3d\n", "EL_NUM_FCNS", count);

	    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");
	}'
	;;

#	generate fcns.c from various .h files
#
-fc)
    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("private const el_func_t el_func[] = {");
	    maxlen = 80;
	    needn = 1;
	    len = 0;
	}
	{
	    clen = 25 + 2;
	    len += clen;
	    if (len >= maxlen)
		needn = 1;
	    if (needn) {
		printf("\n    ");
		needn = 0;
		len = 4 + clen;
	    }
	    s = $1 ",";
	    printf("%-26.26s ", s);
	}
	END {
	    printf("\n};\n");
	    printf("\nprotected const el_func_t* func__get() { return el_func; }\n");
	}'
	;;

#	generate editline.c from various .c files
#
-e)
	echo "$FILES" | tr ' ' '\012' | $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#define protected static\n");
	    printf("#define SCCSID\n");
	}
	{
	    printf("#include \"%s\"\n", $1);
	}'
	;;

#	generate man page fragment from various .c files
#
-m)
    cat $FILES | $AWK '
	BEGIN {
	    printf(".\\\" Section automatically generated with makelist\n");
	    printf(".Bl -tag -width 4n\n");
	}
	/\(\):/ {
	    pr = substr($2, 1, 2);
	    if (pr == "vi" || pr == "em" || pr == "ed") {
		name = substr($2, 1, length($2) - 3);
		fname = "";
		for (i = 1; i <= length(name); i++) {
		    s = substr(name, i, 1);
		    if (s == "_")
			s = "-";
		    fname = fname s;
		}

		printf(".It Ic %s\n", fname);
		ok = 1;
	    }
	}
	/^ \*/ {
	    if (ok) {
		for (i = 2; i < NF; i++)
		    printf("%s ", $i);
		printf("%s.\n", $i);
		ok = 0;
	    }
	}
	END {
	    printf(".El\n");
	    printf(".\\\" End of section automatically generated with makelist\n");
	}'
	;;

*)
    echo $USAGE 1>&2
    exit 1
    ;;

esac
@


1.12.2.1
log
@file makelist was added on branch RELENG_8_4 on 2013-03-28 13:03:14 +0000
@
text
@d1 250
@


1.12.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 250
#!/bin/sh -
#	$NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $
# $FreeBSD: releng/8.4/lib/libedit/makelist 239590 2012-08-22 20:07:10Z pfg $
#
# Copyright (c) 1992, 1993
#	The Regents of the University of California.  All rights reserved.
#
# This code is derived from software contributed to Berkeley by
# Christos Zoulas of Cornell University.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#	@@(#)makelist	5.3 (Berkeley) 6/4/93

# makelist.sh: Automatically generate header files...

AWK=awk
USAGE="usage: $0 -h|-e|-fc|-fh|-bc|-bh|-m <filenames>"

if [ "x$1" = "x" ]
then
    echo $USAGE 1>&2
    exit 1
fi

FLAG="$1"
shift

FILES="$@@"

case $FLAG in

#	generate foo.h file from foo.c
#
-h)
    set - `echo $FILES | sed -e 's/\\./_/g'`
    hdr="_h_`basename $1`"
    cat $FILES | $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#ifndef %s\n#define %s\n", "'$hdr'", "'$hdr'");
	}
	/\(\):/ {
	    pr = substr($2, 1, 2);
	    if (pr == "vi" || pr == "em" || pr == "ed") {
		name = substr($2, 1, length($2) - 3);
#
# 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);
	    }
	}
	END {
	    printf("#endif /* %s */\n", "'$hdr'");
	}'
	;;

#	generate help.c from various .c files
#
-bc)
    cat $FILES | $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#include \"sys.h\"\n#include \"el.h\"\n");
	    printf("private const struct el_bindings_t el_func_help[] = {\n");
	    low = "abcdefghijklmnopqrstuvwxyz_";
	    high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
	    for (i = 1; i <= length(low); i++)
		tr[substr(low, i, 1)] = substr(high, i, 1);
	}
	/\(\):/ {
	    pr = substr($2, 1, 2);
	    if (pr == "vi" || pr == "em" || pr == "ed") {
		name = substr($2, 1, length($2) - 3);
		uname = "";
		fname = "";
		for (i = 1; i <= length(name); i++) {
		    s = substr(name, i, 1);
		    uname = uname tr[s];
		    if (s == "_")
			s = "-";
		    fname = fname s;
		}

		printf("    { %-30.30s %-30.30s\n","\"" fname "\",", uname ",");
		ok = 1;
	    }
	}
	/^ \*/ {
	    if (ok) {
		printf("      \"");
		for (i = 2; i < NF; i++)
		    printf("%s ", $i);
		printf("%s\" },\n", $i);
		ok = 0;
	    }
	}
	END {
	    printf("};\n");
	    printf("\nprotected const el_bindings_t* help__get()");
	    printf("{ return el_func_help; }\n");
	}'
	;;

#	generate help.h from various .c files
#
-bh)
    $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#ifndef _h_help_c\n#define _h_help_c\n");
	    printf("protected const el_bindings_t *help__get(void);\n");
	    printf("#endif /* _h_help_c */\n");
	}' /dev/null
	;;

#	generate fcns.h from various .h files
#
-fh)
    cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
    sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n");
	    count = 0;
	}
	{
	    printf("#define\t%-30.30s\t%3d\n", $1, count++);
	}
	END {
	    printf("#define\t%-30.30s\t%3d\n", "EL_NUM_FCNS", count);

	    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");
	}'
	;;

#	generate fcns.c from various .h files
#
-fc)
    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("private const el_func_t el_func[] = {");
	    maxlen = 80;
	    needn = 1;
	    len = 0;
	}
	{
	    clen = 25 + 2;
	    len += clen;
	    if (len >= maxlen)
		needn = 1;
	    if (needn) {
		printf("\n    ");
		needn = 0;
		len = 4 + clen;
	    }
	    s = $1 ",";
	    printf("%-26.26s ", s);
	}
	END {
	    printf("\n};\n");
	    printf("\nprotected const el_func_t* func__get() { return el_func; }\n");
	}'
	;;

#	generate editline.c from various .c files
#
-e)
	echo "$FILES" | tr ' ' '\012' | $AWK '
	BEGIN {
	    printf("/* Automatically generated file, do not edit */\n");
	    printf("#define protected static\n");
	    printf("#define SCCSID\n");
	}
	{
	    printf("#include \"%s\"\n", $1);
	}'
	;;

#	generate man page fragment from various .c files
#
-m)
    cat $FILES | $AWK '
	BEGIN {
	    printf(".\\\" Section automatically generated with makelist\n");
	    printf(".Bl -tag -width 4n\n");
	}
	/\(\):/ {
	    pr = substr($2, 1, 2);
	    if (pr == "vi" || pr == "em" || pr == "ed") {
		name = substr($2, 1, length($2) - 3);
		fname = "";
		for (i = 1; i <= length(name); i++) {
		    s = substr(name, i, 1);
		    if (s == "_")
			s = "-";
		    fname = fname s;
		}

		printf(".It Ic %s\n", fname);
		ok = 1;
	    }
	}
	/^ \*/ {
	    if (ok) {
		for (i = 2; i < NF; i++)
		    printf("%s ", $i);
		printf("%s.\n", $i);
		ok = 0;
	    }
	}
	END {
	    printf(".El\n");
	    printf(".\\\" End of section automatically generated with makelist\n");
	}'
	;;

*)
    echo $USAGE 1>&2
    exit 1
    ;;

esac
@


1.11
log
@SVN rev 238624 on 2012-07-19 19:15:47Z by pfg

Merge more cosmetical changes from NetBSD's libedit.

makelist:
change tr '[a-z]' '[A-Z]' to tr '[:lower:]' '[:upper:]' so that POSIX
systems work proerly regardsless of environment variable settings.

tokenizer.c:
pass lint on _LP64

Obtained from:	NetBSD
MFC after:	2 weeks
@
text
@d3 1
a3 1
# $FreeBSD$
@


1.10
log
@Merge makelist rev 1.10 and map.c rev 1.22 from NetBSD.  They just patch the
bug fixed in the last commit to map.c in a different way.  Follow NetBSD to
facilitate future merges.
@
text
@d2 1
a2 1
#	$NetBSD: makelist,v 1.10 2005/08/08 14:04:49 christos Exp $
d144 1
a144 1
    sort | LC_ALL=C tr 'a-z' 'A-Z' | $AWK '
@


1.10.2.1
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: stable/7/lib/libedit/makelist 150947 2005-10-04 21:59:29Z stefanf $
@


1.10.16.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.10.16.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.10.16.1.4.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/9.1/lib/libedit/makelist 150947 2005-10-04 21:59:29Z stefanf $
@


1.10.16.2
log
@SVN rev 239589 on 2012-08-22 20:06:59Z by pfg

MFC	r238178, 238624, 238810:

Re-merge a couple of changes from NetBSD libedit.

bin/sh has been taught about el_gets setting the count to -1
on error, so now we can partially revert r238173 to reduce
differences with NetBSD's implementation.

Also fix some warnings to be more in sync with NetBSD.

Obtained from:	NetBSD
@
text
@d2 1
a2 1
#	$NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $
d144 1
a144 1
    sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK '
@


1.10.16.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d3 1
a3 1
# $FreeBSD: stable/9/lib/libedit/makelist 239589 2012-08-22 20:06:59Z pfg $
@


1.10.16.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.10.16.1.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/9.0/lib/libedit/makelist 150947 2005-10-04 21:59:29Z stefanf $
@


1.10.14.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.10.14.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/7.4/lib/libedit/makelist 150947 2005-10-04 21:59:29Z stefanf $
@


1.10.12.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.10.10.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.10.10.2
log
@SVN rev 239590 on 2012-08-22 20:07:10Z by pfg

MFC     r238178, 238624, 238810:

Re-merge a couple of changes from NetBSD libedit.

bin/sh has been taught about el_gets setting the count to -1
on error, so now we can partially revert r238173 to reduce
differences with NetBSD's implementation.

Also fix some warnings to be more in sync with NetBSD.

Obtained from:	NetBSD
@
text
@d2 1
a2 1
#	$NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $
d144 1
a144 1
    sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK '
@


1.10.10.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d3 1
a3 1
# $FreeBSD: stable/8/lib/libedit/makelist 239590 2012-08-22 20:07:10Z pfg $
@


1.10.10.1.8.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.10.10.1.8.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/8.3/lib/libedit/makelist 150947 2005-10-04 21:59:29Z stefanf $
@


1.10.10.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.10.10.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.10.10.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.10.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.10.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.9
log
@Sync libedit with recent NetBSD developments.  Including improvements to the
vi-mode, removal of clause 3, cleanups and the export of the tokenization
functions.

Not included: config.h, filecomplete.{c,h}
@
text
@d2 1
a2 1
#	$NetBSD: makelist,v 1.9 2005/05/16 13:14:43 lukem Exp $
a121 1
	    printf("    { NULL, 0, NULL }\n");
@


1.8
log
@LANG->LC_ALL

Pointed by:     ru
@
text
@d2 1
a2 1
#	$NetBSD: makelist,v 1.6 2000/09/04 23:45:18 lukem Exp $
d19 1
a19 5
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#	This product includes software developed by the University of
#	California, Berkeley and its contributors.
# 4. Neither the name of the University nor the names of its contributors
d39 1
a39 1
AWK=/usr/bin/awk
@


1.8.4.1
log
@MFC a small part of the big NetBSD merge that fixes a few bugs and should be
safe for RELENG_5.

el.c:
	Check term_init() and strdup() failure.
history.c and tokenizer.c:
	Check malloc() failure.
makelist and map.c:
	Respect list sentinel.
refresh.c:
	Refresh bug.
@
text
@d126 1
@


1.8.10.1
log
@MFC stefanf's work on libedit.  This includes a sync with NetBSD/OpenBSD
and some bugfixes.

Approved by:	re (scottl)
@
text
@d2 1
a2 1
#	$NetBSD: makelist,v 1.10 2005/08/08 14:04:49 christos Exp $
d19 5
a23 1
# 3. Neither the name of the University nor the names of its contributors
d43 1
a43 1
AWK=awk
d126 1
@


1.8.10.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: stable/6/lib/libedit/makelist 151131 2005-10-09 03:44:01Z delphij $
@


1.8.10.1.10.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.7
log
@Fix problem differently, use
LANG=C tr 'a-z' 'A-Z'
for hypotetical case that script may generate non-ascii characters
@
text
@d149 1
a149 1
    sort | LANG=C tr 'a-z' 'A-Z' | $AWK '
@


1.6
log
@Fix double-wrong tr usage: tr '[a-z]' '[A-Z]'

First of all, it should be written as: tr 'a-z' 'A-Z'
ranges not encolosed in [] according to POSIX, so [] just included
in the replacement.
Second, it should be written: tr '[:lower:]' '[:upper:]'
since a-z and A-Z may have different length in some locales.
@
text
@d149 1
a149 1
    sort | tr '[:lower:]' '[:upper:]' | $AWK '
@


1.5
log
@Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
@
text
@d149 1
a149 1
    sort | tr '[a-z]' '[A-Z]' | $AWK '
@


1.4
log
@+ Sync with NetBSD, bringing in feature enhancements.
+ Convert to ANSI-C function definitions
+ style(9)

Submitted by:	kris
@
text
@d44 1
a44 1
USAGE="Usage: $0 -h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
@


1.3
log
@Don't use absolute path.
Submitted by:	jhay
@
text
@d2 2
d43 2
a44 2
AWK=awk
USAGE="Usage: $0 -h|-e|-fc|-fh|-bc|-bh <filenames>" 
d58 3
d62 2
a63 6
    fn=`basename $FILES`
    OIFS="$IFS"
    IFS=".$IFS"
    set - $fn
    IFS="$OIFS"
    hdr="_h_$1_$2"
d73 5
a77 1
		printf("protected el_action_t\t%-25.25s __P((EditLine *, int));\n", name);
d82 5
a86 1
	}';;
d92 1
a92 1
	    printf("private struct el_bindings_t el_func_help[] = {\n");
d111 1
a111 1
		     
d113 1
a113 1
		ok = 1; 
d128 1
a128 1
	    printf("\nprotected el_bindings_t* help__get()");
d130 5
a134 1
	}';;
d137 1
a137 1
	BEGIN { 
d140 1
a140 1
	    printf("protected el_bindings_t *help__get\t__P((void));\n");
d142 5
a146 1
	}' /dev/null;;
d150 1
a150 1
	BEGIN { 
d153 1
a153 1
	    count = 0; 
d155 1
a155 1
	{ 
d161 2
a162 2
	    printf("typedef el_action_t (*el_func_t) __P((EditLine *, int));");
	    printf("\nprotected el_func_t* func__get __P((void));\n");
d164 5
a168 1
	}';;
d174 1
a174 1
	    printf("private el_func_t el_func[] = {");
d182 1
a182 1
	    if (len >= maxlen) 
d194 6
a199 2
	    printf("\nprotected el_func_t* func__get() { return el_func; }\n");
	}';;
d209 41
a249 1
	}';;
d252 3
a254 1
    exit 1;;
@


1.2
log
@Reorder decomposition of the filename argument for the '-h' flag to
avoid misprocessing in the case where the filename argument contains
more than one period.

Submitted by:	micke@@dynas.se (Mikael Hybsch)
@
text
@d41 1
a41 1
AWK=/usr/bin/awk
@


1.1
log
@Initial revision
@
text
@d57 1
d60 1
a60 1
    set - $FILES
d62 1
a62 1
    hdr="_h_`basename $1`_$2"
@


1.1.1.1
log
@BSD 4.4 Lite Lib Sources
@
text
@@


1.1.1.1.8.1
log
@MFC: Libedit updates from NetBSD, local fixes, etc.
Required by new ftp(1).
@
text
@a56 1
    fn=`basename $FILES`
d59 1
a59 1
    set - $fn
d61 1
a61 1
    hdr="_h_$1_$2"
@


1.1.1.1.8.2
log
@MFC: Don't use absolute path.
@
text
@d41 1
a41 1
AWK=awk
@
