X-Git-Url: http://git.maemo.org/git/?p=samba;a=blobdiff_plain;f=source%2Fscript%2Fgen-8bit-gap.sh.in;fp=source%2Fscript%2Fgen-8bit-gap.sh.in;h=bcf64a4464f52f576d9cf5ce2b023208a8d32930;hp=0000000000000000000000000000000000000000;hb=6bca4ca307d55b6dc888e56cee47aebcddbce786;hpb=7fd70fa738b636089bcc6c961aa3eaa02f20dda2 diff --git a/source/script/gen-8bit-gap.sh.in b/source/script/gen-8bit-gap.sh.in new file mode 100755 index 0000000..bcf64a4 --- /dev/null +++ b/source/script/gen-8bit-gap.sh.in @@ -0,0 +1,49 @@ +#!/bin/sh +if test $# -ne 2 ; then + echo "Usage: $0 " + 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 2 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, write to the Free Software " +echo " * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. " +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/^[[: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