-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from NordSecurity/callback_fix
Callback fix
- Loading branch information
Showing
13 changed files
with
235 additions
and
35 deletions.
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
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
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
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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
{%- let ffi_converter_name = typ|ffi_converter_name %} | ||
{%- let type_name = typ|type_name %} | ||
{%- let class_name = type_name|class_name %} | ||
struct {{ ffi_converter_name|class_name }} { | ||
static std::shared_ptr<{{ class_name }}> lift(uint64_t); | ||
static uint64_t lower(std::shared_ptr<{{ class_name }}>); | ||
static std::shared_ptr<{{ class_name }}> read(RustStream &); | ||
static void write(RustStream &, uint64_t); | ||
static int32_t allocation_size(const {{ class_name }} &); | ||
|
||
{%- let canonical_type_name = typ|canonical_name %} | ||
struct {{ typ|ffi_converter_name }} { | ||
static {{ type_name }} lift(uint64_t); | ||
static uint64_t lower(const {{ type_name }} &); | ||
static {{ type_name }} read(RustStream &); | ||
static void write(RustStream &, const {{ type_name }} &); | ||
static int32_t allocation_size(const {{ type_name }} &); | ||
private: | ||
static int callback_stub(uint64_t, uint32_t, uint8_t *, int32_t, RustBuffer *); | ||
|
||
static std::once_flag once; | ||
static HandleMap<{{ class_name }}> callbacks; | ||
}; | ||
static HandleMap<{{ canonical_type_name }}> callbacks; | ||
}; |
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
Oops, something went wrong.