public const int MTYOFILE = 6; /* output 1!:2[2 */ #endregion #region - Constructor - static JSession() // static constructor is always safe thread-wise { if (JSession.IsJeLoaded()) { return; } if (null == (JSession.JeFullName = Environment.GetEnvironmentVariable("JEPATH"))) { JSession.JeFullName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), JSession.JeName); } JSession.JeLibrary = new UnmanagedLibrary(JSession.JeFullName); JSession.JInit = JSession.JeLibrary.GetUnmanagedFunction <JInitType>("JInit"); JSession.JSM = JSession.JeLibrary.GetUnmanagedFunction <JSMType>("JSM"); JSession.JDo = JSession.JeLibrary.GetUnmanagedFunction <JDoType>("JDo"); JSession.JGetLocale = JSession.JeLibrary.GetUnmanagedFunction <JGetLocaleType>("JGetLocale"); JSession.Jga = JSession.JeLibrary.GetUnmanagedFunction <JgaType>("Jga"); JSession.JFree = JSession.JeLibrary.GetUnmanagedFunction <JFreeType>("JFree"); }
/// <summary> /// Release handle /// </summary> protected override bool ReleaseHandle() { return(0 == JSession.Free(handle)); }
private static int Free(IntPtr jt) { return((null == JSession.JFree) ? 0 : JSession.JFree(jt)); }
public string GetLocale() { IntPtr locale = JSession.JGetLocale(this._jt); return(Encoding.UTF8.GetString(this.BytesFromPtr(locale))); }
public int Do(string sentence) { this.LastSentence = sentence; return(null == sentence ? 0 : JSession.JDo(this._jt, Encoding.UTF8.GetBytes(sentence))); }
public void ApplyCallbacks() { JSession.JSM(this._jt, this._callbacks); }