@@ -16,15 +16,15 @@ type MSession
1616 bufptr:: Ptr{UInt8}
1717
1818 function MSession (bufsize:: Integer = default_output_buffer_size)
19- ep = ccall (engfunc ( :engOpen ) , Ptr{Void}, (Ptr{UInt8},), default_startcmd)
19+ ep = ccall (eng_open[] , Ptr{Void}, (Ptr{UInt8},), default_startcmd)
2020 ep == C_NULL && throw (MEngineError (" failed to open a MATLAB engine session" ))
2121 # hide the MATLAB command window on Windows
22- is_windows () && ccall (engfunc ( :engSetVisible ) , Cint, (Ptr{Void}, Cint), ep, 0 )
22+ is_windows () && ccall (eng_set_visible[] , Cint, (Ptr{Void}, Cint), ep, 0 )
2323
2424 buf = Array (UInt8, bufsize)
2525 if bufsize > 0
2626 bufptr = pointer (buf)
27- ccall (engfunc ( :engOutputBuffer ) , Cint, (Ptr{Void}, Ptr{UInt8}, Cint),
27+ ccall (eng_output_buffer[] , Cint, (Ptr{Void}, Ptr{UInt8}, Cint),
2828 ep, bufptr, bufsize)
2929 else
3030 bufptr = convert (Ptr{UInt8}, C_NULL )
4545function release (session:: MSession )
4646 ptr = session. ptr
4747 if ptr != C_NULL
48- ccall (engfunc ( :engClose ) , Cint, (Ptr{Void},), ptr)
48+ ccall (eng_close[] , Cint, (Ptr{Void},), ptr)
4949 end
5050 session. ptr = C_NULL
5151 return nothing
5252end
5353
5454function close (session:: MSession )
5555 # close a MATLAB Engine session
56- ret = ccall (engfunc ( :engClose ) , Cint, (Ptr{Void},), session)
56+ ret = ccall (eng_close[] , Cint, (Ptr{Void},), session)
5757 ret != 0 && throw (MEngineError (" failed to close a MATLAB engine session (err = $ret )" ))
5858 session. ptr = C_NULL
5959 return nothing
@@ -91,13 +91,13 @@ function close_default_msession()
9191end
9292
9393function show_msession (m:: MSession = get_default_msession ())
94- ret = ccall (engfunc ( :engSetVisible ) , Cint, (Ptr{Void}, Cint), m, 1 )
94+ ret = ccall (eng_set_visible[] , Cint, (Ptr{Void}, Cint), m, 1 )
9595 ret != 0 && throw (MEngineError (" failed to show MATLAB engine session (err = $ret )" ))
9696 return nothing
9797end
9898
9999function hide_msession (m:: MSession = get_default_msession ())
100- ret = ccall (engfunc ( :engSetVisible ) , Cint, (Ptr{Void}, Cint), m, 0 )
100+ ret = ccall (eng_set_visible[] , Cint, (Ptr{Void}, Cint), m, 0 )
101101 ret != 0 && throw (MEngineError (" failed to hide MATLAB engine session (err = $ret )" ))
102102 return nothing
103103end
111111
112112function eval_string (session:: MSession , stmt:: String )
113113 # evaluate a MATLAB statement in a given MATLAB session
114- ret = ccall (engfunc ( :engEvalString ) , Cint, (Ptr{Void}, Ptr{UInt8}), session, stmt)
114+ ret = ccall (eng_eval_string[] , Cint, (Ptr{Void}, Ptr{UInt8}), session, stmt)
115115 ret != 0 && throw (MEngineError (" invalid engine session (err = $ret )" ))
116116
117117 bufptr = session. bufptr
@@ -129,7 +129,7 @@ eval_string(stmt::String) = eval_string(get_default_msession(), stmt)
129129
130130function put_variable (session:: MSession , name:: Symbol , v:: MxArray )
131131 # put a variable into a MATLAB engine session
132- ret = ccall (engfunc ( :engPutVariable ) , Cint, (Ptr{Void}, Ptr{UInt8}, Ptr{Void}), session, string (name), v)
132+ ret = ccall (eng_put_variable[] , Cint, (Ptr{Void}, Ptr{UInt8}, Ptr{Void}), session, string (name), v)
133133 ret != 0 && throw (MEngineError (" failed to put the variable $(name) into a MATLAB session (err = $ret )" ))
134134 return nothing
135135end
@@ -140,7 +140,7 @@ put_variable(name::Symbol, v) = put_variable(get_default_msession(), name, v)
140140
141141
142142function get_mvariable (session:: MSession , name:: Symbol )
143- pv = ccall (engfunc ( :engGetVariable ) , Ptr{Void}, (Ptr{Void}, Ptr{UInt8}), session, string (name))
143+ pv = ccall (eng_get_variable[] , Ptr{Void}, (Ptr{Void}, Ptr{UInt8}), session, string (name))
144144 pv == C_NULL && throw (MEngineError (" failed to get the variable $(name) from a MATLAB session" ))
145145 return MxArray (pv)
146146end
0 commit comments