blob: ce7d14cb7a4f886df24c14cf10efcd5e158f9c6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#!/bin/sh
# $OpenBSD: MKfallback.sh,v 1.3 2001/01/22 18:01:50 millert Exp $
# $From: MKfallback.sh,v 1.10 2000/12/10 00:14:39 tom Exp $
#
# MKfallback.sh -- create fallback table for entry reads
#
# This script generates source code for a custom version of read_entry.c
# that (instead of reading capabilities for an argument terminal type
# from an on-disk terminfo tree) tries to match the type with one of a
# specified list of types generated in.
#
cat <<EOF
/*
* DO NOT EDIT THIS FILE BY HAND! It is generated by MKfallback.sh.
*/
#include <curses.priv.h>
#include <term.h>
EOF
if [ "$*" ]
then
cat <<EOF
#include <tic.h>
/* fallback entries for: $* */
EOF
for x in $*
do
echo "/* $x */"
infocmp -E $x
done
cat <<EOF
static const TERMTYPE fallbacks[$#] =
{
EOF
comma=""
for x in $*
do
echo "$comma /* $x */"
infocmp -e $x
comma=","
done
cat <<EOF
};
EOF
fi
cat <<EOF
NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *name GCC_UNUSED)
{
EOF
if [ "$*" ]
then
cat <<EOF
const TERMTYPE *tp;
for (tp = fallbacks;
tp < fallbacks + sizeof(fallbacks)/sizeof(TERMTYPE);
tp++)
if (_nc_name_match(tp->term_names, name, "|"))
return(tp);
EOF
else
echo " /* the fallback list is empty */";
fi
cat <<EOF
return((TERMTYPE *)0);
}
EOF
|