aboutsummaryrefslogtreecommitdiff
path: root/julia/CrystFEL/src/reflists.jl
blob: 3931e40ca0b01f610afb6236159334ba33c30286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module RefLists

using ..Symmetry

export RefList, Reflection, loadreflist, savereflections

mutable struct InternalRefList end

mutable struct RefList
    internalptr::Ptr{InternalRefList}
    symmetry::SymOpList
end

function loadreflist(filename::AbstractString)

    psym = Ptr{InternalSymOpList}()
    out = ccall((:read_reflections_2, :libcrystfel),
                Ptr{InternalRefList}, (Cstring,Ptr{InternalSymOpList}),
                filename, psym)
    if out == C_NULL
        throw(OutOfMemoryError())
    end

    return RefList(out, SymOpList(psym))

end

end  # of module