diff --git a/src/d.jl b/src/d.jl index 291a5fd..ee8145a 100644 --- a/src/d.jl +++ b/src/d.jl @@ -11,7 +11,6 @@ export dafgda, dafgh, dafgn, - dafgs!, dafgs, dafgsr, dafopr, @@ -348,13 +347,13 @@ function dafgn(lenout=128) end """ - dafgs!(sum) + dafgs(lenout=125) -Return (get) the summary for the current array in the current DAF and write it to `sum`. +Return (get) the summary for the current array in the current DAF. ### Arguments ### -- `sum`: An empty `Vector{Float64}` with the expected length +- `lenout`: The maximum length of the summary array ### Output ### @@ -364,14 +363,13 @@ Returns the summary for the current array. - [NAIF Documentation](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafgs_c.html) """ -function dafgs!(array) +function dafgs(lenout=125) + array = zeros(125) ccall((:dafgs_c, libcspice), Cvoid, (Ref{SpiceDouble},), array) handleerror() - array + array[1:lenout] end -@deprecate dafgs dafgs! - """ Read a portion of the contents of a summary record in a DAF file. diff --git a/test/d.jl b/test/d.jl index 3f1a2b8..67968f9 100644 --- a/test/d.jl +++ b/test/d.jl @@ -80,8 +80,7 @@ dafbfs(handle) found = daffna() @test found - out = zeros(2) - dafgs!(out) + out = dafgs(2) @test out ≈ [-9.46511378160646408796e+07, 3.15662463183953464031e+08] outname = dafgn(100) @test outname == "DE-405" @@ -139,8 +138,7 @@ dafbfs(handle) found = daffna() @test found - out = zeros(124) - dafgs!(out) + out = dafgs(124) dc, ic = dafus(out, 2, 6) ic[1] = -1999 ic[2] = -2999 @@ -153,8 +151,7 @@ dafbfs(handle) found = daffna() @test found - out = zeros(124) - dafgs!(out) + out = dafgs(124) dc, ic = dafus(out, 2, 6) @test ic[1] == -1999 @test ic[2] == -2999