-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
460 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,7 @@ thistle_tea-*.tar | |
# Temporary files, for example, from tests. | ||
/tmp/ | ||
|
||
# rustler nif | ||
/priv/ | ||
|
||
*.sqlite* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
defmodule ThistleTea.Namigator do | ||
use Rustler, otp_app: :thistle_tea, crate: "thistletea_namigator" | ||
|
||
def build(_wow_dir, _out_dir), do: :erlang.nif_error(:nif_not_loaded) | ||
def get_map(_map_name), do: :erlang.nif_error(:nif_not_loaded) | ||
def get_zone_and_area(_map_name, _x, _y, _z), do: :erlang.nif_error(:nif_not_loaded) | ||
|
||
def find_random_point_around_circle(_map_name, _x, _y, _z, _radius), | ||
do: :erlang.nif_error(:nif_not_loaded) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[target.'cfg(target_os = "macos")'] | ||
rustflags = [ | ||
"-C", "link-arg=-undefined", | ||
"-C", "link-arg=dynamic_lookup", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "thistletea_namigator" | ||
version = "0.1.0" | ||
authors = [] | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "thistletea_namigator" | ||
path = "src/lib.rs" | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
rustler = "0.34.0" | ||
once_cell = "1.19.0" | ||
namigator = { git="https://github.com/gtker/namigator-rs.git", rev = "6ba7b71f86204cc1d626e1454589dd8eed4a0fb8", features = ["vanilla"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# NIF for Elixir.ThistleTea.Namigator | ||
|
||
## To build the NIF module: | ||
|
||
- Your NIF will now build along with your project. | ||
|
||
## To load the NIF: | ||
|
||
```elixir | ||
defmodule ThistleTea.Namigator do | ||
use Rustler, otp_app: :thistle_tea, crate: "thistletea_namigator" | ||
|
||
# When your NIF is loaded, it will override this function. | ||
def add(_a, _b), do: :erlang.nif_error(:nif_not_loaded) | ||
end | ||
``` | ||
|
||
## Examples | ||
|
||
[This](https://github.com/rusterlium/NifIo) is a complete example of a NIF written in Rust. |
Oops, something went wrong.