Skip to content

Commit c46d58a

Browse files
committed
Remove underscore prefix
1 parent 587bbdc commit c46d58a

File tree

5 files changed

+187
-187
lines changed

5 files changed

+187
-187
lines changed

src/MATLAB.jl

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -54,87 +54,87 @@ function __init__()
5454

5555
# load libraries
5656

57-
_libmx[] = Libdl.dlopen(joinpath(lib_path, "libmx"), Libdl.RTLD_GLOBAL)
58-
_libmat[] = Libdl.dlopen(joinpath(lib_path, "libmat"), Libdl.RTLD_GLOBAL)
59-
_libeng[] = Libdl.dlopen(joinpath(lib_path, "libeng"), Libdl.RTLD_GLOBAL)
57+
libmx[] = Libdl.dlopen(joinpath(lib_path, "libmx"), Libdl.RTLD_GLOBAL)
58+
libmat[] = Libdl.dlopen(joinpath(lib_path, "libmat"), Libdl.RTLD_GLOBAL)
59+
libeng[] = Libdl.dlopen(joinpath(lib_path, "libeng"), Libdl.RTLD_GLOBAL)
6060

6161

6262
# load functions to access mxArray
6363

64-
_mx_free[] = mxfunc(:mxFree)
65-
66-
_mx_get_classid[] = mxfunc(:mxGetClassID)
67-
_mx_get_m[] = mxfunc(:mxGetM)
68-
_mx_get_n[] = mxfunc(:mxGetN)
69-
_mx_get_nelems[] = mxfunc(:mxGetNumberOfElements)
70-
_mx_get_ndims[] = mxfunc(:mxGetNumberOfDimensions_730)
71-
_mx_get_elemsize[] = mxfunc(:mxGetElementSize)
72-
_mx_get_data[] = mxfunc(:mxGetData)
73-
_mx_get_dims[] = mxfunc(:mxGetDimensions_730)
74-
_mx_get_nfields[] = mxfunc(:mxGetNumberOfFields)
75-
_mx_get_pr[] = mxfunc(:mxGetPr)
76-
_mx_get_pi[] = mxfunc(:mxGetPi)
77-
_mx_get_ir[] = mxfunc(:mxGetIr_730)
78-
_mx_get_jc[] = mxfunc(:mxGetJc_730)
79-
80-
_mx_is_double[] = mxfunc(:mxIsDouble)
81-
_mx_is_single[] = mxfunc(:mxIsSingle)
82-
_mx_is_int64[] = mxfunc(:mxIsInt64)
83-
_mx_is_uint64[] = mxfunc(:mxIsUint64)
84-
_mx_is_int32[] = mxfunc(:mxIsInt32)
85-
_mx_is_uint32[] = mxfunc(:mxIsUint32)
86-
_mx_is_int16[] = mxfunc(:mxIsInt16)
87-
_mx_is_uint16[] = mxfunc(:mxIsUint16)
88-
_mx_is_int8[] = mxfunc(:mxIsInt8)
89-
_mx_is_uint8[] = mxfunc(:mxIsUint8)
90-
_mx_is_char[] = mxfunc(:mxIsChar)
91-
92-
_mx_is_numeric[] = mxfunc(:mxIsNumeric)
93-
_mx_is_logical[] = mxfunc(:mxIsLogical)
94-
_mx_is_complex[] = mxfunc(:mxIsComplex)
95-
_mx_is_sparse[] = mxfunc(:mxIsSparse)
96-
_mx_is_empty[] = mxfunc(:mxIsEmpty)
97-
_mx_is_struct[] = mxfunc(:mxIsStruct)
98-
_mx_is_cell[] = mxfunc(:mxIsCell)
64+
mx_free[] = mxfunc(:mxFree)
65+
66+
mx_get_classid[] = mxfunc(:mxGetClassID)
67+
mx_get_m[] = mxfunc(:mxGetM)
68+
mx_get_n[] = mxfunc(:mxGetN)
69+
mx_get_nelems[] = mxfunc(:mxGetNumberOfElements)
70+
mx_get_ndims[] = mxfunc(:mxGetNumberOfDimensions_730)
71+
mx_get_elemsize[] = mxfunc(:mxGetElementSize)
72+
mx_get_data[] = mxfunc(:mxGetData)
73+
mx_get_dims[] = mxfunc(:mxGetDimensions_730)
74+
mx_get_nfields[] = mxfunc(:mxGetNumberOfFields)
75+
mx_get_pr[] = mxfunc(:mxGetPr)
76+
mx_get_pi[] = mxfunc(:mxGetPi)
77+
mx_get_ir[] = mxfunc(:mxGetIr_730)
78+
mx_get_jc[] = mxfunc(:mxGetJc_730)
79+
80+
mx_is_double[] = mxfunc(:mxIsDouble)
81+
mx_is_single[] = mxfunc(:mxIsSingle)
82+
mx_is_int64[] = mxfunc(:mxIsInt64)
83+
mx_is_uint64[] = mxfunc(:mxIsUint64)
84+
mx_is_int32[] = mxfunc(:mxIsInt32)
85+
mx_is_uint32[] = mxfunc(:mxIsUint32)
86+
mx_is_int16[] = mxfunc(:mxIsInt16)
87+
mx_is_uint16[] = mxfunc(:mxIsUint16)
88+
mx_is_int8[] = mxfunc(:mxIsInt8)
89+
mx_is_uint8[] = mxfunc(:mxIsUint8)
90+
mx_is_char[] = mxfunc(:mxIsChar)
91+
92+
mx_is_numeric[] = mxfunc(:mxIsNumeric)
93+
mx_is_logical[] = mxfunc(:mxIsLogical)
94+
mx_is_complex[] = mxfunc(:mxIsComplex)
95+
mx_is_sparse[] = mxfunc(:mxIsSparse)
96+
mx_is_empty[] = mxfunc(:mxIsEmpty)
97+
mx_is_struct[] = mxfunc(:mxIsStruct)
98+
mx_is_cell[] = mxfunc(:mxIsCell)
9999

100100

101101
# load functions to create & delete MATLAB array
102102

103-
_mx_create_numeric_mat[] = mxfunc(:mxCreateNumericMatrix_730)
104-
_mx_create_numeric_arr[] = mxfunc(:mxCreateNumericArray_730)
103+
mx_create_numeric_mat[] = mxfunc(:mxCreateNumericMatrix_730)
104+
mx_create_numeric_arr[] = mxfunc(:mxCreateNumericArray_730)
105105

106-
_mx_create_double_scalar[] = mxfunc(:mxCreateDoubleScalar)
107-
_mx_create_logical_scalar[] = mxfunc(:mxCreateLogicalScalar)
106+
mx_create_double_scalar[] = mxfunc(:mxCreateDoubleScalar)
107+
mx_create_logical_scalar[] = mxfunc(:mxCreateLogicalScalar)
108108

109-
_mx_create_sparse[] = mxfunc(:mxCreateSparse_730)
110-
_mx_create_sparse_logical[] = mxfunc(:mxCreateSparseLogicalMatrix_730)
109+
mx_create_sparse[] = mxfunc(:mxCreateSparse_730)
110+
mx_create_sparse_logical[] = mxfunc(:mxCreateSparseLogicalMatrix_730)
111111

112-
_mx_create_string[] = mxfunc(:mxCreateString)
113-
_mx_create_char_array[] = mxfunc(:mxCreateCharArray_730)
112+
mx_create_string[] = mxfunc(:mxCreateString)
113+
mx_create_char_array[] = mxfunc(:mxCreateCharArray_730)
114114

115-
_mx_create_cell_array[] = mxfunc(:mxCreateCellArray_730)
115+
mx_create_cell_array[] = mxfunc(:mxCreateCellArray_730)
116116

117-
_mx_create_struct_matrix[] = mxfunc(:mxCreateStructMatrix_730)
118-
_mx_create_struct_array[] = mxfunc(:mxCreateStructArray_730)
117+
mx_create_struct_matrix[] = mxfunc(:mxCreateStructMatrix_730)
118+
mx_create_struct_array[] = mxfunc(:mxCreateStructArray_730)
119119

120-
_mx_get_cell[] = mxfunc(:mxGetCell_730)
121-
_mx_set_cell[] = mxfunc(:mxSetCell_730)
120+
mx_get_cell[] = mxfunc(:mxGetCell_730)
121+
mx_set_cell[] = mxfunc(:mxSetCell_730)
122122

123-
_mx_get_field[] = mxfunc(:mxGetField_730)
124-
_mx_set_field[] = mxfunc(:mxSetField_730)
125-
_mx_get_field_bynum[] = mxfunc(:mxGetFieldByNumber_730)
126-
_mx_get_fieldname[] = mxfunc(:mxGetFieldNameByNumber)
123+
mx_get_field[] = mxfunc(:mxGetField_730)
124+
mx_set_field[] = mxfunc(:mxSetField_730)
125+
mx_get_field_bynum[] = mxfunc(:mxGetFieldByNumber_730)
126+
mx_get_fieldname[] = mxfunc(:mxGetFieldNameByNumber)
127127

128-
_mx_get_string[] = mxfunc(:mxGetString_730)
128+
mx_get_string[] = mxfunc(:mxGetString_730)
129129

130130

131131
# load I/O mat functions
132132

133-
_mat_open[] = matfunc(:matOpen)
134-
_mat_close[] = matfunc(:matClose)
135-
_mat_get_variable[] = matfunc(:matGetVariable)
136-
_mat_put_variable[] = matfunc(:matPutVariable)
137-
_mat_get_dir[] = matfunc(:matGetDir)
133+
mat_open[] = matfunc(:matOpen)
134+
mat_close[] = matfunc(:matClose)
135+
mat_get_variable[] = matfunc(:matGetVariable)
136+
mat_put_variable[] = matfunc(:matPutVariable)
137+
mat_get_dir[] = matfunc(:matGetDir)
138138

139139

140140
if is_windows()

src/init.jl

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
11
# libraries
22

3-
const _libeng = Ref{Ptr{Void}}()
4-
const _libmx = Ref{Ptr{Void}}()
5-
const _libmat = Ref{Ptr{Void}}()
3+
const libeng = Ref{Ptr{Void}}()
4+
const libmx = Ref{Ptr{Void}}()
5+
const libmat = Ref{Ptr{Void}}()
66

77
# functions to access mxArray
88

9-
const _mx_free = Ref{Ptr{Void}}()
10-
11-
const _mx_get_classid = Ref{Ptr{Void}}()
12-
const _mx_get_m = Ref{Ptr{Void}}()
13-
const _mx_get_n = Ref{Ptr{Void}}()
14-
const _mx_get_nelems = Ref{Ptr{Void}}()
15-
const _mx_get_ndims = Ref{Ptr{Void}}()
16-
const _mx_get_elemsize = Ref{Ptr{Void}}()
17-
const _mx_get_data = Ref{Ptr{Void}}()
18-
const _mx_get_dims = Ref{Ptr{Void}}()
19-
const _mx_get_nfields = Ref{Ptr{Void}}()
20-
const _mx_get_pr = Ref{Ptr{Void}}()
21-
const _mx_get_pi = Ref{Ptr{Void}}()
22-
const _mx_get_ir = Ref{Ptr{Void}}()
23-
const _mx_get_jc = Ref{Ptr{Void}}()
24-
25-
const _mx_is_double = Ref{Ptr{Void}}()
26-
const _mx_is_single = Ref{Ptr{Void}}()
27-
const _mx_is_int64 = Ref{Ptr{Void}}()
28-
const _mx_is_uint64 = Ref{Ptr{Void}}()
29-
const _mx_is_int32 = Ref{Ptr{Void}}()
30-
const _mx_is_uint32 = Ref{Ptr{Void}}()
31-
const _mx_is_int16 = Ref{Ptr{Void}}()
32-
const _mx_is_uint16 = Ref{Ptr{Void}}()
33-
const _mx_is_int8 = Ref{Ptr{Void}}()
34-
const _mx_is_uint8 = Ref{Ptr{Void}}()
35-
const _mx_is_char = Ref{Ptr{Void}}()
36-
37-
const _mx_is_numeric = Ref{Ptr{Void}}()
38-
const _mx_is_logical = Ref{Ptr{Void}}()
39-
const _mx_is_complex = Ref{Ptr{Void}}()
40-
const _mx_is_sparse = Ref{Ptr{Void}}()
41-
const _mx_is_empty = Ref{Ptr{Void}}()
42-
const _mx_is_struct = Ref{Ptr{Void}}()
43-
const _mx_is_cell = Ref{Ptr{Void}}()
9+
const mx_free = Ref{Ptr{Void}}()
10+
11+
const mx_get_classid = Ref{Ptr{Void}}()
12+
const mx_get_m = Ref{Ptr{Void}}()
13+
const mx_get_n = Ref{Ptr{Void}}()
14+
const mx_get_nelems = Ref{Ptr{Void}}()
15+
const mx_get_ndims = Ref{Ptr{Void}}()
16+
const mx_get_elemsize = Ref{Ptr{Void}}()
17+
const mx_get_data = Ref{Ptr{Void}}()
18+
const mx_get_dims = Ref{Ptr{Void}}()
19+
const mx_get_nfields = Ref{Ptr{Void}}()
20+
const mx_get_pr = Ref{Ptr{Void}}()
21+
const mx_get_pi = Ref{Ptr{Void}}()
22+
const mx_get_ir = Ref{Ptr{Void}}()
23+
const mx_get_jc = Ref{Ptr{Void}}()
24+
25+
const mx_is_double = Ref{Ptr{Void}}()
26+
const mx_is_single = Ref{Ptr{Void}}()
27+
const mx_is_int64 = Ref{Ptr{Void}}()
28+
const mx_is_uint64 = Ref{Ptr{Void}}()
29+
const mx_is_int32 = Ref{Ptr{Void}}()
30+
const mx_is_uint32 = Ref{Ptr{Void}}()
31+
const mx_is_int16 = Ref{Ptr{Void}}()
32+
const mx_is_uint16 = Ref{Ptr{Void}}()
33+
const mx_is_int8 = Ref{Ptr{Void}}()
34+
const mx_is_uint8 = Ref{Ptr{Void}}()
35+
const mx_is_char = Ref{Ptr{Void}}()
36+
37+
const mx_is_numeric = Ref{Ptr{Void}}()
38+
const mx_is_logical = Ref{Ptr{Void}}()
39+
const mx_is_complex = Ref{Ptr{Void}}()
40+
const mx_is_sparse = Ref{Ptr{Void}}()
41+
const mx_is_empty = Ref{Ptr{Void}}()
42+
const mx_is_struct = Ref{Ptr{Void}}()
43+
const mx_is_cell = Ref{Ptr{Void}}()
4444

4545
# functions to create & delete MATLAB arrays
4646

47-
const _mx_create_numeric_mat = Ref{Ptr{Void}}()
48-
const _mx_create_numeric_arr = Ref{Ptr{Void}}()
47+
const mx_create_numeric_mat = Ref{Ptr{Void}}()
48+
const mx_create_numeric_arr = Ref{Ptr{Void}}()
4949

50-
const _mx_create_double_scalar = Ref{Ptr{Void}}()
51-
const _mx_create_logical_scalar = Ref{Ptr{Void}}()
50+
const mx_create_double_scalar = Ref{Ptr{Void}}()
51+
const mx_create_logical_scalar = Ref{Ptr{Void}}()
5252

53-
const _mx_create_sparse = Ref{Ptr{Void}}()
54-
const _mx_create_sparse_logical = Ref{Ptr{Void}}()
53+
const mx_create_sparse = Ref{Ptr{Void}}()
54+
const mx_create_sparse_logical = Ref{Ptr{Void}}()
5555

56-
const _mx_create_string = Ref{Ptr{Void}}()
57-
const _mx_create_char_array = Ref{Ptr{Void}}()
56+
const mx_create_string = Ref{Ptr{Void}}()
57+
const mx_create_char_array = Ref{Ptr{Void}}()
5858

59-
const _mx_create_cell_array = Ref{Ptr{Void}}()
59+
const mx_create_cell_array = Ref{Ptr{Void}}()
6060

61-
const _mx_create_struct_matrix = Ref{Ptr{Void}}()
62-
const _mx_create_struct_array = Ref{Ptr{Void}}()
61+
const mx_create_struct_matrix = Ref{Ptr{Void}}()
62+
const mx_create_struct_array = Ref{Ptr{Void}}()
6363

64-
const _mx_get_cell = Ref{Ptr{Void}}()
65-
const _mx_set_cell = Ref{Ptr{Void}}()
64+
const mx_get_cell = Ref{Ptr{Void}}()
65+
const mx_set_cell = Ref{Ptr{Void}}()
6666

67-
const _mx_get_field = Ref{Ptr{Void}}()
68-
const _mx_set_field = Ref{Ptr{Void}}()
69-
const _mx_get_field_bynum = Ref{Ptr{Void}}()
70-
const _mx_get_fieldname = Ref{Ptr{Void}}()
67+
const mx_get_field = Ref{Ptr{Void}}()
68+
const mx_set_field = Ref{Ptr{Void}}()
69+
const mx_get_field_bynum = Ref{Ptr{Void}}()
70+
const mx_get_fieldname = Ref{Ptr{Void}}()
7171

72-
const _mx_get_string = Ref{Ptr{Void}}(0)
72+
const mx_get_string = Ref{Ptr{Void}}(0)
7373

7474
# load I/O mat functions
7575

76-
const _mat_open = Ref{Ptr{Void}}()
77-
const _mat_close = Ref{Ptr{Void}}()
78-
const _mat_get_variable = Ref{Ptr{Void}}()
79-
const _mat_put_variable = Ref{Ptr{Void}}()
80-
const _mat_get_dir = Ref{Ptr{Void}}()
76+
const mat_open = Ref{Ptr{Void}}()
77+
const mat_close = Ref{Ptr{Void}}()
78+
const mat_get_variable = Ref{Ptr{Void}}()
79+
const mat_put_variable = Ref{Ptr{Void}}()
80+
const mat_get_dir = Ref{Ptr{Void}}()

src/matfile.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type MatFile
55
filename::String
66

77
function MatFile(filename::String, mode::String)
8-
p = ccall(_mat_open[], Ptr{Void}, (Ptr{Cchar}, Ptr{Cchar}),
8+
p = ccall(mat_open[], Ptr{Void}, (Ptr{Cchar}, Ptr{Cchar}),
99
filename, mode)
1010
new(p, filename)
1111
end
@@ -14,7 +14,7 @@ MatFile(filename::String) = MatFile(filename, "r")
1414

1515
function close(f::MatFile)
1616
if f.ptr != C_NULL
17-
ret = ccall(_mat_close[], Cint, (Ptr{Void},), f.ptr)
17+
ret = ccall(mat_close[], Cint, (Ptr{Void},), f.ptr)
1818
ret == 0 || error("Failed to close file.")
1919
end
2020
end
@@ -23,7 +23,7 @@ end
2323

2424
function get_mvariable(f::MatFile, name::String)
2525
f.ptr != C_NULL || error("Cannot get variable from a null file.")
26-
pm = ccall(_mat_get_variable[], Ptr{Void}, (Ptr{Void}, Ptr{Cchar}),
26+
pm = ccall(mat_get_variable[], Ptr{Void}, (Ptr{Void}, Ptr{Cchar}),
2727
f.ptr, name)
2828
pm != C_NULL || error("Attempt to get variable $(name) failed.")
2929
MxArray(pm)
@@ -37,7 +37,7 @@ get_variable(f::MatFile, name::Symbol) = jvalue(get_mvariable(f, name))
3737
function put_variable(f::MatFile, name::String, v::MxArray)
3838
f.ptr != C_NULL || error("Cannot put variable to a null file.")
3939
v.ptr != C_NULL || error("Cannot put an null variable.")
40-
ret = ccall(_mat_put_variable[], Cint, (Ptr{Void}, Ptr{Cchar}, Ptr{Void}),
40+
ret = ccall(mat_put_variable[], Cint, (Ptr{Void}, Ptr{Cchar}, Ptr{Void}),
4141
f.ptr, name, v.ptr)
4242
ret == 0 || error("Attempt to put variable $(name) failed.")
4343
end
@@ -67,14 +67,14 @@ end
6767
function variable_names(f::MatFile)
6868
# get a list of all variable names
6969
_n = Cint[0]
70-
_a = ccall(_mat_get_dir[], Ptr{Ptr{Cchar}}, (Ptr{Void}, Ptr{Cint}),
70+
_a = ccall(mat_get_dir[], Ptr{Ptr{Cchar}}, (Ptr{Void}, Ptr{Cint}),
7171
f.ptr, _n)
7272

7373
n = Int(_n[1])
7474
a = unsafe_wrap(Array, _a, (n,))
7575

7676
names = String[unsafe_string(s) for s in a]
77-
ccall(_mx_free[], Void, (Ptr{Void},), _a)
77+
ccall(mx_free[], Void, (Ptr{Void},), _a)
7878
return names
7979
end
8080

0 commit comments

Comments
 (0)