genBuffer.sh revision 2005
0N/A# Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. 0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A# This code is free software; you can redistribute it and/or modify it 0N/A# under the terms of the GNU General Public License version 2 only, as 0N/A# published by the Free Software Foundation. Sun designates this 0N/A# particular file as subject to the "Classpath" exception as provided 0N/A# by Sun in the LICENSE file that accompanied this code. 0N/A# This code is distributed in the hope that it will be useful, but WITHOUT 0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A# version 2 for more details (a copy is included in the LICENSE file that 0N/A# accompanied this code). 0N/A# You should have received a copy of the GNU General Public License version 0N/A# 2 along with this work; if not, write to the Free Software Foundation, 0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A# CA 95054 USA or visit www.sun.com if you need additional information or 0N/A# have any questions. 0N/A# Generate concrete buffer classes 0N/A# Required environment variables 0N/A# NAWK SED SPP To invoke tools 0N/A# TYPE Primitive type 0N/A# DST Destination file 0N/A# Optional environment variables 0N/A# RW Mutability: R(ead only), W(ritable) 0N/A# BO Byte order: B(ig), L(ittle), S(wapped), U(nswapped) 0N/A# BIN Defined => generate binary-data access methods 0N/A | $NAWK '{ type = $1; fulltype = $2; memtype = $3; swaptype = $4; 0N/A x = substr(type, 1, 1); 0N/A Type = toupper(x) substr(type, 2); 0N/A Fulltype = toupper(x) substr(fulltype, 2); 0N/A Memtype = toupper(substr(memtype, 1, 1)) substr(memtype, 2); 0N/A Swaptype = toupper(substr(swaptype, 1, 1)) substr(swaptype, 2); 0N/A printf("Type=%s x=%s Fulltype=%s Memtype=%s Swaptype=%s ", 0N/A Type, x, Fulltype, Memtype, Swaptype); }' 0N/Aa=
`if [ $type = int ]; then echo an; else echo a; fi` 0N/AA=
`if [ $type = int ]; then echo An; else echo A; fi` 0N/A Type=`echo $1 | $NAWK '{ print toupper(substr($1, 1, 1)) substr($1, 2) }'` 0N/A a=`if [ $type = int ]; then echo an; else echo a; fi`