jdk/make/java/nio/genCoder.sh
author xuelei
Fri, 11 Apr 2008 03:50:37 -0400
changeset 475 b8b79ef97ac8
parent 2 90ce3da70b43
child 898 1c4e95595472
permissions -rw-r--r--
6571950: SSLSocket(raddr, rport, laddr, lport) allows null as laddr that spec doesn't reflect Summary: add the description that while the local address parameter is null, anyLocalAddress will be used instead. Reviewed-by: weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#! /bin/sh
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
# Copyright 2000-2001 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# Generate charset coder and decoder classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# Environment variables required from make: SED SPP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
what=$1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
SRC=$2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
DST=$3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
if [ x$what = xdecoder ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
  echo '  '$SRC '--('$what')-->' $DST
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
  $SPP <$SRC >$DST \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    -K$what \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    -DA='A' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    -Da='a' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    -DCode='Decode' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    -Dcode='decode' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    -DitypesPhrase='bytes in a specific charset' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    -DotypesPhrase='sixteen-bit Unicode characters' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    -Ditype='byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    -Dotype='character' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    -DItype='Byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    -DOtype='Char' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    -Dcoder='decoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    -DCoder='Decoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    -Dcoding='decoding' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    -DOtherCoder='Encoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    -DreplTypeName='string' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    -DdefaultRepl='"\\\\uFFFD"' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    -DdefaultReplName='<tt>"\\\&#92;uFFFD"<\/tt>' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    -DreplType='String' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    -DreplFQType='java.lang.String' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    -DreplLength='length()' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    -DItypesPerOtype='CharsPerByte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    -DnotLegal='not legal for this charset' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    -Dotypes-per-itype='chars-per-byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    -DoutSequence='Unicode character'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
elif [ x$what = xencoder ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
  echo '  '$SRC '--('$what')-->' $DST
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
  $SPP <$SRC >$DST \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    -K$what \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    -DA='An' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    -Da='an' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    -DCode='Encode' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    -Dcode='encode' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    -DitypesPhrase='sixteen-bit Unicode characters' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    -DotypesPhrase='bytes in a specific charset' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    -Ditype='character' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    -Dotype='byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    -DItype='Char' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    -DOtype='Byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    -Dcoder='encoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    -DCoder='Encoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    -Dcoding='encoding' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    -DOtherCoder='Decoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    -DreplTypeName='byte array' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    -DdefaultReplName='<tt>{<\/tt>\\\&nbsp;<tt>(byte)'"'"\\?"'"'<\/tt>\\\&nbsp;<tt>}<\/tt>' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    -DreplType='byte[]' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    -DreplFQType='byte[]' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    -DreplLength='length' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    -DItypesPerOtype='BytesPerChar' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    -DnotLegal='not a legal sixteen-bit Unicode sequence' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    -Dotypes-per-itype='bytes-per-char' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    -DoutSequence='byte sequence in the given charset'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  echo Illegal coder type: $what
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
fi