annotate src/share/bin/jli_util.h @ 4338:9b8c96f96a0f

Added tag jdk7-b147 for changeset f097ca2434b1
author schien
date Mon, 27 Jun 2011 13:21:34 -0700
parents d3fa95d0710c
children
rev   line source
duke@0 1 /*
ksrini@3986 2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
ohair@2362 7 * published by the Free Software Foundation. Oracle designates this
duke@0 8 * particular file as subject to the "Classpath" exception as provided
ohair@2362 9 * by Oracle in the LICENSE file that accompanied this code.
duke@0 10 *
duke@0 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 15 * accompanied this code).
duke@0 16 *
duke@0 17 * You should have received a copy of the GNU General Public License version
duke@0 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 20 *
ohair@2362 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@2362 22 * or visit www.oracle.com if you need additional information or have any
ohair@2362 23 * questions.
duke@0 24 */
duke@0 25
duke@0 26 #ifndef _JLI_UTIL_H
duke@0 27 #define _JLI_UTIL_H
duke@0 28
duke@0 29 #include <stdlib.h>
duke@0 30 #include <jni.h>
duke@0 31
duke@0 32 void *JLI_MemAlloc(size_t size);
duke@0 33 void *JLI_MemRealloc(void *ptr, size_t size);
duke@0 34 char *JLI_StringDup(const char *s1);
duke@0 35 void JLI_MemFree(void *ptr);
duke@0 36 int JLI_StrCCmp(const char *s1, const char* s2);
duke@0 37
duke@0 38 #define JLI_StrLen(p1) strlen((p1))
duke@0 39 #define JLI_StrChr(p1, p2) strchr((p1), (p2))
duke@0 40 #define JLI_StrRChr(p1, p2) strrchr((p1), (p2))
duke@0 41 #define JLI_StrCmp(p1, p2) strcmp((p1), (p2))
duke@0 42 #define JLI_StrNCmp(p1, p2, p3) strncmp((p1), (p2), (p3))
duke@0 43 #define JLI_StrCat(p1, p2) strcat((p1), (p2))
duke@0 44 #define JLI_StrCpy(p1, p2) strcpy((p1), (p2))
duke@0 45 #define JLI_StrNCpy(p1, p2, p3) strncpy((p1), (p2), (p3))
duke@0 46 #define JLI_StrStr(p1, p2) strstr((p1), (p2))
duke@0 47 #define JLI_StrSpn(p1, p2) strspn((p1), (p2))
duke@0 48 #define JLI_StrCSpn(p1, p2) strcspn((p1), (p2))
duke@0 49 #define JLI_StrPBrk(p1, p2) strpbrk((p1), (p2))
ksrini@3986 50 #define JLI_StrTok(p1, p2) strtok((p1), (p2))
duke@0 51
duke@0 52 /* On Windows lseek() is in io.h rather than the location dictated by POSIX. */
duke@0 53 #ifdef _WIN32
duke@0 54 #include <windows.h>
duke@0 55 #include <io.h>
duke@0 56 #define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2))
duke@0 57 #define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3))
ksrini@2581 58 #define JLI_Snprintf _snprintf
duke@0 59 #else
duke@0 60 #include <unistd.h>
duke@0 61 #define JLI_StrCaseCmp(p1, p2) strcasecmp((p1), (p2))
duke@0 62 #define JLI_StrNCaseCmp(p1, p2, p3) strncasecmp((p1), (p2), (p3))
ksrini@2581 63 #define JLI_Snprintf snprintf
duke@0 64 #endif /* _WIN32 */
duke@0 65
duke@0 66 /*
duke@0 67 * Make launcher spit debug output.
duke@0 68 */
duke@0 69 void JLI_TraceLauncher(const char* fmt, ...);
duke@0 70 void JLI_SetTraceLauncher();
duke@0 71 jboolean JLI_IsTraceLauncher();
duke@0 72
duke@0 73 #endif /* _JLI_UTIL_H */