1 /*
2 * Copyright 1999-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 1999-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 * The implementation for finding classes from the bootstrap
1831 * class loader, refer to java.h
1832 */
1833 static FindClassFromBootLoader_t *findBootClass = NULL;
1834
1835 jclass
1836 FindBootStrapClass(JNIEnv *env, const char* classname)
1837 {
1838 if (findBootClass == NULL) {
1839 findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT,
1840 "JVM_FindClassFromBootLoader");
1841 if (findBootClass == NULL) {
1842 fprintf(stderr, "Error: could load method JVM_FindClassFromBootLoader");
1843 return NULL;
1844 }
1845 }
1846 return findBootClass(env, classname, JNI_FALSE);
1847 }
1848
|