src/share/bin/java.c

Print this page




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()




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) {
1824         scaled_splash_name = DoSplashGetScaledImageName(
1825                            jar_name, file_name, &scale_factor);
1826         if (jar_name) {
1827             
1828             if (scaled_splash_name) {
1829                 image_data = JLI_JarUnpackFile(
1830                             jar_name, scaled_splash_name, &data_size);
1831             }
1832             
1833             if (!image_data) {
1834                 scale_factor = 1;
1835                 image_data = JLI_JarUnpackFile(
1836                             jar_name, file_name, &data_size);
1837             }
1838             if (image_data) {
1839                 DoSplashInit();
1840                 DoSplashSetScaleFactor(scale_factor);
1841                 DoSplashLoadMemory(image_data, data_size);
1842                 JLI_MemFree(image_data);
1843             }
1844         } else {
1845             DoSplashInit();
1846             if(scaled_splash_name){
1847                 DoSplashSetScaleFactor(scale_factor);
1848                 DoSplashLoadFile(scaled_splash_name);
1849             } else {
1850                 DoSplashLoadFile(file_name);
1851             }
1852         }
1853         if(scaled_splash_name){
1854             JLI_MemFree(scaled_splash_name);
1855         }
1856     } else {
1857         return;
1858     }
1859     DoSplashSetFileJarName(file_name, jar_name);
1860 
1861     /*
1862      * Done with all command line processing and potential re-execs so
1863      * clean up the environment.
1864      */
1865     (void)UnsetEnv(ENV_ENTRY);
1866     (void)UnsetEnv(SPLASH_FILE_ENV_ENTRY);
1867     (void)UnsetEnv(SPLASH_JAR_ENV_ENTRY);
1868 
1869     JLI_MemFree(splash_jar_entry);
1870     JLI_MemFree(splash_file_entry);
1871 
1872 }
1873 
1874 const char*
1875 GetDotVersion()