0N/A/*
5563N/A * Copyright (c) 2005, 2012, 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#ifndef _JLI_UTIL_H
0N/A#define _JLI_UTIL_H
0N/A
0N/A#include <stdlib.h>
5563N/A#include <string.h>
5563N/A#include <stdio.h>
0N/A#include <jni.h>
5563N/A#define JLDEBUG_ENV_ENTRY "_JAVA_LAUNCHER_DEBUG"
0N/A
0N/Avoid *JLI_MemAlloc(size_t size);
0N/Avoid *JLI_MemRealloc(void *ptr, size_t size);
0N/Achar *JLI_StringDup(const char *s1);
0N/Avoid JLI_MemFree(void *ptr);
0N/Aint JLI_StrCCmp(const char *s1, const char* s2);
0N/A
5563N/Atypedef struct {
5563N/A char *arg;
5563N/A jboolean has_wildcard;
5563N/A} StdArg;
5563N/A
5563N/AStdArg *JLI_GetStdArgs();
5563N/Aint JLI_GetStdArgc();
5563N/A
0N/A#define JLI_StrLen(p1) strlen((p1))
0N/A#define JLI_StrChr(p1, p2) strchr((p1), (p2))
0N/A#define JLI_StrRChr(p1, p2) strrchr((p1), (p2))
0N/A#define JLI_StrCmp(p1, p2) strcmp((p1), (p2))
0N/A#define JLI_StrNCmp(p1, p2, p3) strncmp((p1), (p2), (p3))
0N/A#define JLI_StrCat(p1, p2) strcat((p1), (p2))
0N/A#define JLI_StrCpy(p1, p2) strcpy((p1), (p2))
0N/A#define JLI_StrNCpy(p1, p2, p3) strncpy((p1), (p2), (p3))
0N/A#define JLI_StrStr(p1, p2) strstr((p1), (p2))
0N/A#define JLI_StrSpn(p1, p2) strspn((p1), (p2))
0N/A#define JLI_StrCSpn(p1, p2) strcspn((p1), (p2))
0N/A#define JLI_StrPBrk(p1, p2) strpbrk((p1), (p2))
3986N/A#define JLI_StrTok(p1, p2) strtok((p1), (p2))
0N/A
0N/A/* On Windows lseek() is in io.h rather than the location dictated by POSIX. */
0N/A#ifdef _WIN32
0N/A#include <windows.h>
0N/A#include <io.h>
0N/A#define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2))
0N/A#define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3))
5700N/Aint JLI_Snprintf(char *buffer, size_t size, const char *format, ...);
5563N/Avoid JLI_CmdToArgs(char *cmdline);
0N/A#else
0N/A#include <unistd.h>
5563N/A#include <strings.h>
0N/A#define JLI_StrCaseCmp(p1, p2) strcasecmp((p1), (p2))
0N/A#define JLI_StrNCaseCmp(p1, p2, p3) strncasecmp((p1), (p2), (p3))
2581N/A#define JLI_Snprintf snprintf
0N/A#endif /* _WIN32 */
0N/A
0N/A/*
0N/A * Make launcher spit debug output.
0N/A */
0N/Avoid JLI_TraceLauncher(const char* fmt, ...);
0N/Avoid JLI_SetTraceLauncher();
0N/Ajboolean JLI_IsTraceLauncher();
0N/A
0N/A#endif /* _JLI_UTIL_H */