1 /* 2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Copyright (C) 2008 - INRIA 4 * 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * 7 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * This file was originally licensed under the terms of the CeCILL v2.1, 10 * and continues to be available under such terms. 11 * For more information, see the COPYING file which you should have received 12 * along with this program. 13 * 14 */ 15 16 /* InterpreterManagement.i */ 17 /** 18 * Windows: swig -java -package org.scilab.modules.action_binding -outdir ../java/org/scilab/modules/action_binding/ InterpreterManagement.i 19 * Other: Use the option --enable-build-swig to the configure 20 */ 21 %module InterpreterManagement 22 %{ 23 #include "../c/InterpreterManagement.h" 24 %} 25 26 %include "../../../jvm/src/jni/scilab_typemaps.i" 27 28 /* JavaDoc for InterpreterManagementJNI class */ 29 %pragma(java) jniclassclassmodifiers=%{ 30 /* It is generated code. Disable checkstyle */ 31 //CHECKSTYLE:OFF 32 /** 33 * All Scilab interpreter management used in Java console 34 * @author Vincent COUVERT 35 * @copyright INRIA 36 */ 37 class%} 38 39 /* Constructor for InterpreterManagementJNI class */ 40 %pragma(java) jniclasscode=" 41 /** 42 * Constructor 43 */ 44 protected InterpreterManagementJNI() { 45 throw new UnsupportedOperationException(); 46 }"; 47 48 /* static load of library */ 49 %pragma(java) jniclasscode=%{ 50 static { 51 try { 52 System.loadLibrary("sciaction_binding"); catch(SecurityException e)53 } catch (SecurityException e) { 54 System.err.println("A security manager exists and does not allow the loading of the specified dynamic library."); 55 System.err.println(e.getLocalizedMessage()); 56 e.printStackTrace(System.err); 57 } catch (UnsatisfiedLinkError e) { 58 System.err.println("The native library sciaction_binding does not exist or cannot be found."); 59 System.err.println(e.getLocalizedMessage()); 60 e.printStackTrace(System.err); 61 } 62 } 63 %} 64 65 /* JavaDoc for InterpreterManagement class */ 66 %pragma(java) moduleclassmodifiers=" 67 /** 68 * All Scilab interpreter management used in Java console 69 * @author Vincent COUVERT 70 * @copyright INRIA 71 */ 72 public class"; 73 74 /* Constructor for InterpreterManagement class */ 75 %pragma(java) modulecode=" 76 /** 77 * Constructor 78 */ 79 protected InterpreterManagement() { 80 throw new UnsupportedOperationException(); 81 }"; 82 83 /* JavaDoc */ 84 %javamethodmodifiers putCommandInScilabQueue(char *command) " 85 /** 86 * Put a command in Scilab command queue so that Scilab executes it 87 * The command is displayed in Scilab Window 88 * 89 * @param command the command to execute 90 * @return execution status 91 */ 92 public "; 93 int putCommandInScilabQueue(char *command); 94 95 /* JavaDoc */ 96 %javamethodmodifiers requestScilabExec(char *command) " 97 /** 98 * Put a command in Scilab command queue so that Scilab executes it 99 * The command is executed as soon as possible and may not be interrupted by another one. 100 * WARNING : if the command is taking some time, scilab will not do anything else 101 * before the command returns. 102 * 103 * @param command the command to execute 104 * @return execution status 105 */ 106 public "; 107 int requestScilabExec(char *command); 108 109 /* JavaDoc */ 110 %javamethodmodifiers interruptScilab(void) " 111 /** 112 * Stop Scilab current work 113 * @return execution status 114 */ 115 public "; 116 int interruptScilab(void); 117