File: gen-8bit-gap.sh.in

package info (click to toggle)
samba 2%3A3.6.6-6%2Bdeb7u7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 160,976 kB
  • sloc: ansic: 1,764,536; xml: 114,867; python: 78,119; perl: 27,633; sh: 13,802; makefile: 4,704; asm: 3,281; cpp: 2,281; yacc: 1,949; exp: 1,784; ada: 1,681; pascal: 1,089; cs: 879; awk: 756; lex: 566; csh: 58; sed: 45; php: 6
file content (48 lines) | stat: -rwxr-xr-x 1,677 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
if test $# -ne 2 ; then
	echo "Usage: $0 <charmap file> <CHARSET NAME>"
	exit 1
fi

CHARMAP=$1
CHARSETNAME=$2

echo "/* "
echo " * Conversion table for $CHARSETNAME charset "
echo " * "
echo " * Conversion tables are generated using $CHARMAP table "
echo " * and source/script/gen-8bit-gap.sh script "
echo " * "
echo " * This program is free software; you can redistribute it and/or modify "
echo " * it under the terms of the GNU General Public License as published by "
echo " * the Free Software Foundation; either version 3 of the License, or "
echo " * (at your option) any later version. "
echo " *  "
echo " * This program is distributed in the hope that it will be useful,"
echo " * but WITHOUT ANY WARRANTY; without even the implied warranty of "
echo " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
echo " * GNU General Public License for more details. "
echo " *  "
echo " * You should have received a copy of the GNU General Public License "
echo " * along with this program; if not, see <http://www.gnu.org/licenses/>."
echo " */"

echo '#include "includes.h"'
echo
echo "static const uint16 to_ucs2[256] = {"
cat "$CHARMAP" | @AWK@ -f @srcdir@/script/gen-8bit-gap.awk
echo "};"
echo
echo "static const struct charset_gap_table from_idx[] = {"
sed -ne 's/^<U\(....\).*/\1/p' \
    "$CHARMAP" | sort -u | @AWK@ -f @srcdir@/script/gap.awk
echo "  { 0xffff, 0xffff, 0 }"
echo "};"
echo
echo "static const unsigned char from_ucs2[] = {"
sed -ne 's/^<U\(....\)>[[:space:]]*.x\(..\).*/\1 \2/p' \
    "$CHARMAP" | sort -u | @AWK@ -f @srcdir@/script/gaptab.awk
echo "};"
echo 
echo "SMB_GENERATE_CHARSET_MODULE_8_BIT_GAP($CHARSETNAME)"
echo