0N/A/*
2362N/A * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
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
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
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 *
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 *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#include <ctype.h>
0N/A
0N/A#include "bool.h"
0N/A#include "utf.h"
0N/A
0N/A $$Tables
0N/A
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 TRUE.
0N/A *
0N/A * Return a pointer to just past the fieldname. Return NULL if no fieldname
0N/A * at all was found, or in the case of slash_okay being true, we saw
0N/A * consecutive slashes (meaning we were looking for a qualified path but
0N/A * found something that was badly-formed).
0N/A */
0N/A
0N/A#define bool_t int
0N/A
0N/Achar *
0N/Askip_over_fieldname(char *name, bool_t slash_okay)
0N/A{
0N/A char *p = name;
0N/A char *last_p;
0N/A unicode ch;
0N/A unicode last_ch = 0;
0N/A
0N/A ch = *p;
0N/A if (ch == (ch & 0x7F))
0N/A ++p;
0N/A else
0N/A ch = next_utf2unicode(&p);
0N/A if (($$Lookup(ch) & $$bitJavaStart) == 0)
0N/A return 0;
0N/A for (;;) {
0N/A last_p = p;
0N/A last_ch = ch;
0N/A ch = *p;
0N/A if (ch == (ch & 0x7F))
0N/A ++p;
0N/A else
0N/A ch = next_utf2unicode(&p);
0N/A if (($$Lookup(ch) & $$bitJavaPart) == 0) {
0N/A if (ch == '/' && slash_okay) {
0N/A if (last_ch == '/')
0N/A return 0;
0N/A }
0N/A else {
0N/A return last_p;
0N/A }
0N/A }
0N/A }
0N/A}
0N/A
0N/Avoid main() {
0N/A int j;
0N/A for (j = 0; j < (1 << 16); j++) {
0N/A int q = $$Lookup(j);
0N/A printf("%04x%s%s\n", j,
0N/A (q & $$bitJavaStart ? " Start" : ""),
0N/A (q & $$bitJavaPart ? " Part" : ""));
0N/A }
0N/A}