-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enums and docs update #77
Conversation
pages/creating_unifex_natives.md
Outdated
Elixir type | Native type | ||
--- | --- | ||
`atom` | `char *` | ||
`bool` | `int` | ||
`float` | `double` | ||
`int` | `int` | ||
`int64` | `int64_t` | ||
`payload` | `UnifexPayload` | ||
`pid` | `UnifexPid` | ||
`state` | `UnifexState *` | ||
`string` | `char *` | ||
`uint64` | `uint64_t` | ||
`unsigned` | `unsigned int` | ||
`[int]` | `int *`, `unsigned int` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this list should rather be a part of documentation, not the tutorial
pages/creating_unifex_natives.md
Outdated
@@ -80,12 +80,100 @@ UNIFEX_TERM foo(UnifexEnv* env, int num) { | |||
return foo_result_ok(env, num); | |||
} | |||
``` | |||
You can see, that we used function `foo_result_ok` in the implementation above. For every tuple, that might be returned from our Unifex function (in this case, it is `foo`), there will be generated implementation of result function named `[orginal_function_name]_result_[label]`, where `label` is atom with type `label` in returned tuple. Type of the first argument of this function will be `UnifexEnv*`, number and types of the rest of the arguments will depend on number and types of rest of elements in the returned tuple (see the table below). | |||
|
|||
It is a very simple C code that always returns the same number it gets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you put a paragraph above, that sentence sounds weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems not fixed
pages/creating_unifex_natives.md
Outdated
@@ -80,12 +80,100 @@ UNIFEX_TERM foo(UnifexEnv* env, int num) { | |||
return foo_result_ok(env, num); | |||
} | |||
``` | |||
You can see, that we used function `foo_result_ok` in the implementation above. For every tuple, that might be returned from our Unifex function (in this case, it is `foo`), there will be generated implementation of result function named `[orginal_function_name]_result_[label]`, where `label` is atom with type `label` in returned tuple. Type of the first argument of this function will be `UnifexEnv*`, number and types of the rest of the arguments will depend on number and types of rest of elements in the returned tuple (see the table below). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see, that we used function `foo_result_ok` in the implementation above. For every tuple, that might be returned from our Unifex function (in this case, it is `foo`), there will be generated implementation of result function named `[orginal_function_name]_result_[label]`, where `label` is atom with type `label` in returned tuple. Type of the first argument of this function will be `UnifexEnv*`, number and types of the rest of the arguments will depend on number and types of rest of elements in the returned tuple (see the table below). | |
As you can see, we used function `foo_result_ok` in the implementation above. For every tuple, that might be returned from our Unifex function (in this case, it is `foo`), there will be generated implementation of result function named `[orginal_function_name]_result_[label]`, where `label` is an atom with type `label` in returned tuple. The type of the first argument of this function will be `UnifexEnv*`, number and types of the rest of the arguments will depend on the number and types of rest of elements in the returned tuple (see the table below). |
Please use Grammarly to verify English.
efe59ab
to
04c64cc
Compare
No description provided.