Skip to content

Commit

Permalink
reverse to 1.6 ccall convention and mark ^1.6 as the compatibility …
Browse files Browse the repository at this point in the history
…option for julia version
  • Loading branch information
Suavesito-Olimpiada committed Dec 1, 2021
1 parent cdb0201 commit e67c696
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name = "NativeFileDialog"
uuid = "e1fe445b-aa65-4df4-81c1-2041507f0fd4"
authors = ["José Joaquín Zubieta Rico <jose.zubieta@cimat.mx> and contributors"]
version = "0.2.0"
version = "0.2.1"

[deps]
FilePathsBase = "48062228-2e41-5def-b9a4-89aafe57970f"
NativeFileDialog_jll = "94d9ae2c-efc7-56f8-9a02-54c47b797961"

[compat]
FilePathsBase = "0.9"
julia = "1.3"
julia = "^1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
14 changes: 7 additions & 7 deletions src/wrapper.jl
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
function OpenDialog(filterlist::Cstring, defaultpath::Cstring)
outpath = Ref(Ptr{UInt8}())
status = ccall((:NFD_OpenDialog, libnfd), NFDResult, (Cstring, Cstring, Ref{Ptr{UInt8}}), filterlist, defaultpath, outpath)
status = @ccall libnfd.NFD_OpenDialog(filterlist::Cstring, defaultpath::Cstring, outpath::Ref{Ptr{UInt8}})::NFDResult
return status, outpath[]
end

function OpenDialogMultiple(filterlist::Cstring, defaultpath::Cstring)
outpathset = Ref(NFDPathSet(C_NULL, C_NULL, 0))
status = ccall((:NFD_OpenDialogMultiple, libnfd), NFDResult, (Cstring, Cstring, Ref{NFDPathSet}), filterlist, defaultpath, outpathset)
status = @ccall libnfd.NFD_OpenDialogMultiple(filterlist::Cstring, defaultpath::Cstring, outpathset::Ref{NFDPathSet})::NFDResult
return status, outpathset[]
end

function SaveDialog(filterlist::Cstring, defaultpath::Cstring)
outpath = Ref(Ptr{UInt8}())
status = ccall((:NFD_SaveDialog, libnfd), NFDResult, (Cstring, Cstring, Ref{Ptr{UInt8}}), filterlist, defaultpath, outpath)
status = @ccall libnfd.NFD_SaveDialog(filterlist::Cstring, defaultpath::Cstring, outpath::Ref{Ptr{UInt8}})::NFDResult
return status, outpath[]
end

function PickFolder(defaultpath::Cstring)
outpath = Ref(Ptr{UInt8}())
status = ccall((:NFD_PickFolder, libnfd), NFDResult, (Cstring, Ref{Ptr{UInt8}}), defaultpath, outpath)
status = @ccall libnfd.NFD_PickFolder(defaultpath::Cstring, outpath::Ref{Ptr{UInt8}})::NFDResult
return status, outpath[]
end

function GetError()
ccall((:NFD_GetError, libnfd), Cstring, ())
@ccall libnfd.NFD_GetError()::Cstring
end

function PathSetFree(pathset::NFDPathSet)
refpathset = Ref(pathset)
ccall((:NFD_PathSet_Free, libnfd), Cvoid, (Ref{NFDPathSet},), refpathset)
@ccall libnfd.NFD_PathSet_Free(refpathset::Ref{NFDPathSet})::Cvoid
end

function Free(ptr)
ccall((:NFD_Free, libnfd), Cvoid, (Ptr{Cvoid},), ptr)
@ccall libnfd.NFD_Free(ptr::Ptr{Cvoid})::Cvoid
end

2 comments on commit e67c696

@Suavesito-Olimpiada
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/49813

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" e67c696ea012b13473b2fcb69220c8adaac3c07d
git push origin v0.2.1

Please # to comment.