~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to cmd-line-utils/libedit/makelist.sh

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh -
2
 
#       $NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $
 
2
#       $NetBSD: makelist,v 1.16 2010/04/18 21:17:05 christos Exp $
3
3
#
4
4
# Copyright (c) 1992, 1993
5
5
#       The Regents of the University of California.  All rights reserved.
36
36
# makelist.sh: Automatically generate header files...
37
37
 
38
38
AWK=@AWK@
39
 
USAGE="Usage: $0 -h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
 
39
USAGE="Usage: $0 -n|-h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
40
40
 
41
41
if [ "x$1" = "x" ]
42
42
then
53
53
 
54
54
#       generate foo.h file from foo.c
55
55
#
 
56
-n)
 
57
    cat << _EOF
 
58
#undef WIDECHAR
 
59
#define NARROWCHAR
 
60
#include "${FILES}"
 
61
_EOF
 
62
    ;;
 
63
    
56
64
-h)
57
65
    set - `echo $FILES | sed -e 's/\\./_/g'`
58
66
    hdr="_h_`basename $1`"
70
78
# XXX:  need a space between name and prototype so that -fc and -fh
71
79
#       parsing is much easier
72
80
#
73
 
                printf("protected el_action_t\t%s (EditLine *, int);\n", name);
 
81
                printf("protected el_action_t\t%s (EditLine *, Int);\n", name);
74
82
            }
75
83
        }
76
84
        END {
85
93
        BEGIN {
86
94
            printf("/* Automatically generated file, do not edit */\n");
87
95
            printf("#include \"config.h\"\n#include \"el.h\"\n");
 
96
            printf("#include \"chartype.h\"\n");
88
97
            printf("private const struct el_bindings_t el_func_help[] = {\n");
89
98
            low = "abcdefghijklmnopqrstuvwxyz_";
90
99
            high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
106
115
                    fname = fname s;
107
116
                }
108
117
 
109
 
                printf("    { %-30.30s %-30.30s\n","\"" fname "\",", uname ",");
 
118
                printf("    { %-30.30s %-30.30s\n","STR(\"" fname "\"),", uname ",");
110
119
                ok = 1;
111
120
            }
112
121
        }
113
122
        /^ \*/ {
114
123
            if (ok) {
115
 
                printf("      \"");
 
124
                printf("      STR(\"");
116
125
                for (i = 2; i < NF; i++)
117
126
                    printf("%s ", $i);
118
 
                # XXXMYSQL: support CRLF
 
127
        # XXXMYSQL: support CRLF
119
128
                sub("\r", "", $i);
120
 
                printf("%s\" },\n", $i);
 
129
                printf("%s\") },\n", $i);
121
130
                ok = 0;
122
131
            }
123
132
        }
157
166
        END {
158
167
            printf("#define\t%-30.30s\t%3d\n", "EL_NUM_FCNS", count);
159
168
 
160
 
            printf("typedef el_action_t (*el_func_t)(EditLine *, int);");
 
169
            printf("typedef el_action_t (*el_func_t)(EditLine *, Int);");
161
170
            printf("\nprotected const el_func_t* func__get(void);\n");
162
171
            printf("#endif /* _h_fcns_c */\n");
163
172
        }'