diff --git a/Project.toml b/Project.toml index eb0f214..8d8f45e 100644 --- a/Project.toml +++ b/Project.toml @@ -18,6 +18,7 @@ StaticArrays = "1.5" Unitful = "1" UnitfulAtomic = "1" julia = "1" +extxyz_jll = "0.1.3" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/fileio.jl b/src/fileio.jl index 76e1f6c..5fd6452 100644 --- a/src/fileio.jl +++ b/src/fileio.jl @@ -199,15 +199,16 @@ function convert(::Type{Ptr{DictEntry}}, dict::Dict{String}{Any}; ordered_keys=n return c_dict_ptr end -function read_frame_dicts(fp::Ptr{Cvoid}; verbose=false) +function read_frame_dicts(fp::Ptr{Cvoid}; verbose=false, comment=nothing) nat = Ref{Cint}(0) info = Ref{Ptr{DictEntry}}() arrays = Ref{Ptr{DictEntry}}() failed = false + (comment === nothing) && (comment = C_NULL) try res = ccall((:extxyz_read_ll, libextxyz), - Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ref{Cint}, Ptr{Ptr{DictEntry}}, Ptr{Ptr{DictEntry}}), - _kv_grammar[], fp, nat, info, arrays) + Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ref{Cint}, Ptr{Ptr{DictEntry}}, Ptr{Ptr{DictEntry}}, Cstring), + _kv_grammar[], fp, nat, info, arrays, comment) if res != 1 failed = true throw(EOFError())