1799 FreeKnownVMs() 1800 { 1801 int i; 1802 for (i = 0; i < knownVMsCount; i++) { 1803 JLI_MemFree(knownVMs[i].name); 1804 knownVMs[i].name = NULL; 1805 } 1806 JLI_MemFree(knownVMs); 1807 } 1808 1809 /* 1810 * Displays the splash screen according to the jar file name 1811 * and image file names stored in environment variables 1812 */ 1813 void 1814 ShowSplashScreen() 1815 { 1816 const char *jar_name = getenv(SPLASH_JAR_ENV_ENTRY); 1817 const char *file_name = getenv(SPLASH_FILE_ENV_ENTRY); 1818 int data_size; 1819 void *image_data; 1820 if (jar_name) { 1821 image_data = JLI_JarUnpackFile(jar_name, file_name, &data_size); 1822 if (image_data) { 1823 DoSplashInit(); 1824 DoSplashLoadMemory(image_data, data_size); 1825 JLI_MemFree(image_data); 1826 } 1827 } else if (file_name) { 1828 DoSplashInit(); 1829 DoSplashLoadFile(file_name); 1830 } else { 1831 return; 1832 } 1833 DoSplashSetFileJarName(file_name, jar_name); 1834 1835 /* 1836 * Done with all command line processing and potential re-execs so 1837 * clean up the environment. 1838 */ 1839 (void)UnsetEnv(ENV_ENTRY); 1840 (void)UnsetEnv(SPLASH_FILE_ENV_ENTRY); 1841 (void)UnsetEnv(SPLASH_JAR_ENV_ENTRY); 1842 1843 JLI_MemFree(splash_jar_entry); 1844 JLI_MemFree(splash_file_entry); 1845 1846 } 1847 1848 const char* 1849 GetDotVersion() 1850 { 1851 return _dVersion; 1852 } | 1799 FreeKnownVMs() 1800 { 1801 int i; 1802 for (i = 0; i < knownVMsCount; i++) { 1803 JLI_MemFree(knownVMs[i].name); 1804 knownVMs[i].name = NULL; 1805 } 1806 JLI_MemFree(knownVMs); 1807 } 1808 1809 /* 1810 * Displays the splash screen according to the jar file name 1811 * and image file names stored in environment variables 1812 */ 1813 void 1814 ShowSplashScreen() 1815 { 1816 const char *jar_name = getenv(SPLASH_JAR_ENV_ENTRY); 1817 const char *file_name = getenv(SPLASH_FILE_ENV_ENTRY); 1818 int data_size; 1819 void *image_data = NULL; 1820 float scale_factor = 1; 1821 char *scaled_splash_name = NULL; 1822 1823 if (file_name == NULL){ 1824 return; 1825 } 1826 1827 scaled_splash_name = DoSplashGetScaledImageName( 1828 jar_name, file_name, &scale_factor); 1829 if (jar_name) { 1830 1831 if (scaled_splash_name) { 1832 image_data = JLI_JarUnpackFile( 1833 jar_name, scaled_splash_name, &data_size); 1834 } 1835 1836 if (!image_data) { 1837 scale_factor = 1; 1838 image_data = JLI_JarUnpackFile( 1839 jar_name, file_name, &data_size); 1840 } 1841 if (image_data) { 1842 DoSplashInit(); 1843 DoSplashSetScaleFactor(scale_factor); 1844 DoSplashLoadMemory(image_data, data_size); 1845 JLI_MemFree(image_data); 1846 } 1847 } else { 1848 DoSplashInit(); 1849 if (scaled_splash_name) { 1850 DoSplashSetScaleFactor(scale_factor); 1851 DoSplashLoadFile(scaled_splash_name); 1852 } else { 1853 DoSplashLoadFile(file_name); 1854 } 1855 } 1856 1857 if (scaled_splash_name) { 1858 JLI_MemFree(scaled_splash_name); 1859 } 1860 1861 DoSplashSetFileJarName(file_name, jar_name); 1862 1863 /* 1864 * Done with all command line processing and potential re-execs so 1865 * clean up the environment. 1866 */ 1867 (void)UnsetEnv(ENV_ENTRY); 1868 (void)UnsetEnv(SPLASH_FILE_ENV_ENTRY); 1869 (void)UnsetEnv(SPLASH_JAR_ENV_ENTRY); 1870 1871 JLI_MemFree(splash_jar_entry); 1872 JLI_MemFree(splash_file_entry); 1873 1874 } 1875 1876 const char* 1877 GetDotVersion() 1878 { 1879 return _dVersion; 1880 } |