1 /*
2 * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
1809 /* name not found but still a success */
1810 return (0);
1811 }
1812 /* squeeze up one entry */
1813 do {
1814 environ[idx] = environ[idx+1];
1815 } while (environ[++idx] != NULL);
1816
1817 return (0);
1818 }
1819 /* --- End of "borrowed" code --- */
1820
1821 /*
1822 * Wrapper for unsetenv() function.
1823 */
1824 int
1825 UnsetEnv(char *name)
1826 {
1827 return(borrowed_unsetenv(name));
1828 }
|
1 /*
2 * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
1809 /* name not found but still a success */
1810 return (0);
1811 }
1812 /* squeeze up one entry */
1813 do {
1814 environ[idx] = environ[idx+1];
1815 } while (environ[++idx] != NULL);
1816
1817 return (0);
1818 }
1819 /* --- End of "borrowed" code --- */
1820
1821 /*
1822 * Wrapper for unsetenv() function.
1823 */
1824 int
1825 UnsetEnv(char *name)
1826 {
1827 return(borrowed_unsetenv(name));
1828 }
1829
1830 /*
1831 * The implementation for finding classes from the bootstrap
1832 * class loader, refer to java.h
1833 */
1834 static FindClassFromBootLoader_t *findBootClass = NULL;
1835
1836 jclass
1837 FindBootStrapClass(JNIEnv *env, const char* classname)
1838 {
1839 if (findBootClass == NULL) {
1840 findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT,
1841 "JVM_FindClassFromBootLoader");
1842 if (findBootClass == NULL) {
1843 fprintf(stderr, "Error: could not load method JVM_FindClassFromBootLoader");
1844 return NULL;
1845 }
1846 }
1847 return findBootClass(env, classname, JNI_FALSE);
1848 }
1849
|