1 /* 2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Copyright (C) 2021 - Stépahen Mottelet 4 * 5 * This file is hereby licensed under the terms of the GNU GPL v3.0, 6 * For more information, see the COPYING file which you should have received 7 * along with this program. 8 * 9 */ 10 11 12 /* AdvCLIManagement.i */ 13 /** 14 * Windows: swig -java -package org.scilab.modules.console -outdir ../java/org/scilab/modules/console/ AdvCLIManagement.i 15 * Other: Use the option --enable-build-swig to the configure 16 */ 17 %module AdvCLIManagement 18 %{ 19 extern char * GetCurrentPrompt(); 20 %} 21 22 /* static load of library */ 23 %pragma(java) jniclasscode=%{ 24 static { 25 try { 26 System.loadLibrary("sciconsole"); catch(SecurityException e)27 } catch (SecurityException e) { 28 System.err.println("A security manager exists and does not allow the loading of the specified dynamic library."); 29 System.err.println(e.getLocalizedMessage()); 30 System.exit(-1); 31 } catch (UnsatisfiedLinkError e) { 32 System.err.println("The native library sciconsole does not exist or cannot be found."); 33 if (System.getenv("CONTINUE_ON_JNI_ERROR") == null) { 34 System.err.println(e.getLocalizedMessage()); 35 System.err.println("Current java.library.path is : "+System.getProperty("java.library.path")); 36 System.exit(-1); 37 }else{ 38 System.err.println("Continuing anyway because of CONTINUE_ON_JNI_ERROR"); 39 } 40 } 41 } 42 %} 43 44 extern char * GetCurrentPrompt(); 45 46 47 48