#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# Generate concrete buffer classes
# Required environment variables
# NAWK SED SPP To invoke tools
# TYPE Primitive type
# SRC Source file
# DST Destination file
#
# Optional environment variables
# RW Mutability: R(ead only), W(ritable)
# BO Byte order: B(ig), L(ittle), S(wapped), U(nswapped)
# BIN Defined => generate binary-data access methods
type=$TYPE
int) fulltype=integer;;
esac
int | float) LBPV=2;;
long | double) LBPV=3;;
esac
float|double) floatingPointOrIntegralType=floatingPointType;;
esac
float) memtype=int
swaptype=int
fi;;
double) memtype=long
swaptype=long
fi;;
esac
| $NAWK '{ type = $1; fulltype = $2; memtype = $3; swaptype = $4;
x = substr(type, 1, 1);
Type = toupper(x) substr(type, 2);
Fulltype = toupper(x) substr(fulltype, 2);
Memtype = toupper(substr(memtype, 1, 1)) substr(memtype, 2);
Swaptype = toupper(substr(swaptype, 1, 1)) substr(swaptype, 2);
printf("Type=%s x=%s Fulltype=%s Memtype=%s Swaptype=%s ",
Type, x, Fulltype, Memtype, Swaptype); }'
}
eval `typesAndBits $type $BO`
set -e
-K$type \
-Dx=$x \
-DBYTES_PER_VALUE="(1 << $LBPV)" \
-K$rwkey \
-Da=$a \
-DA=$A \
if [ $BIN ]; then
type="$1"
fulltype="$2"
LBPV="$3"
nbytes="$4"
nbytesButOne="$5"
src=$6
eval `typesAndBits $type`
-K$rwkey \
-Da=$a \
-be
}
echo '}' >>$DST
fi