239N/A * Copyright (c) 1997, 2008, Oracle and/or its affiliates. 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 157N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 157N/A * by Oracle 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. 157N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A * Return non-zero if the character is a valid in JVM class name, zero 0N/A * otherwise. The only characters currently disallowed from JVM class 193N/A * names are given in the table below: 0N/A * Character Hex Decimal 0N/A * (Method names have further restrictions dealing with the '<' and 110N/A return 1;
/* Lowercase ASCII letters are > 91 */ 110N/A else {
/* 46 <= ch <= 91 */ 110N/A return 1;
/* Uppercase ASCII recognized here */ 110N/A }
else {
/* ch == 91 || 46 <= ch <= 59 */ 0N/A case 0x8:
case 0x9:
case 0xA:
case 0xB:
case 0xF:
0N/A /* Shouldn't happen. */ 0N/A /* 110xxxxx 10xxxxxx */ 0N/A /* 1110xxxx 10xxxxxx 10xxxxxx */ 0N/A }
/* end of switch */ 0N/A/* Take pointer to a string. Skip over the longest part of the string that 0N/A * could be taken as a fieldname. Allow '/' if slash_okay is JNI_TRUE. 51N/A * Return a pointer to just past the fieldname. Return NULL if no fieldname 51N/A * at all was found, or in the case of slash_okay being true, we saw 99N/A * consecutive slashes (meaning we were looking for a qualified path but 110N/A * found something that was badly-formed). 0N/A /* last_ch == 0 implies we are looking at the first char. */ 0N/A return 0;
/* Don't permit consecutive slashes */ 0N/A }
else if (
ch ==
'_' ||
ch ==
'$') {
0N/A/* Take pointer to a string. Skip over the longest part of the string that 0N/A * could be taken as a field signature. Allow "void" if void_okay. 0N/A * Return a pointer to just past the signature. Return NULL if no legal 0N/A * signature is found. 110N/A /* Skip over the classname, if one is there. */ 0N/A /* The next character better be a semicolon. */ 0N/A if (p && p -
name -
1 > 0 && p[0] ==
';')
0N/A /* JVMS 2nd ed. 4.10 */ 0N/A /* The number of dimensions in an array is limited to 255 ... */ /* The rest of what's there better be a legal signature. */ /* Determine if the specified name is legal * UTF name for a classname. * Note that this routine expects the internal form of qualified classes: * the dots should have been replaced by slashes. /* Everything that's left better be a field signature */ /* skip over the fieldname. Slashes are okay */ * Translates '.' to '/'. Returns JNI_TRUE is any / were present. while (
valid != 0 && *p !=
'\0') {