-
Notifications
You must be signed in to change notification settings - Fork 1
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 #509 from evo-lua/automated-cdef-synchronization
Enable automated synchronization of cdefs for the FFI bindings
- Loading branch information
Showing
45 changed files
with
5,286 additions
and
3,456 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
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,37 @@ | ||
typedef struct kdf_parameters_t { | ||
const char* kdf; | ||
uint32_t version; | ||
uint32_t kilobytes; | ||
uint32_t threads; | ||
uint32_t lanes; | ||
size_t size; | ||
uint32_t iterations; | ||
} kdf_parameters_t; | ||
|
||
typedef struct kdf_input_t { | ||
const char* password; | ||
size_t pw_length; | ||
const char* salt; | ||
size_t salt_length; | ||
} kdf_input_t; | ||
|
||
typedef struct kdf_result_t { | ||
bool success; | ||
unsigned char* hash; | ||
char* message; | ||
} kdf_result_t; | ||
|
||
struct static_crypto_exports_table { | ||
// OpenSSL (libcrypto) metadata | ||
const char* (*version_text)(void); | ||
long int (*version_number)(void); | ||
|
||
// Argon2 MCF utilities | ||
size_t (*openssl_to_base64)(unsigned char* dst, size_t dst_len, const unsigned char* src, size_t src_len); | ||
size_t (*openssl_from_base64)(unsigned char* dst, size_t dst_len, const unsigned char* src, size_t src_len); | ||
size_t (*argon2_to_base64)(unsigned char* dst, size_t dst_len, const unsigned char* src, size_t src_len); | ||
size_t (*argon2_from_base64)(unsigned char* dst, size_t dst_len, const char* src); | ||
void (*openssl_kdf_derive)(kdf_input_t inputs, kdf_parameters_t parameters, kdf_result_t* result); | ||
|
||
int (*openssl_crypto_memcmp)(const void* a, const void* b, size_t len); | ||
}; |
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,22 @@ | ||
typedef struct GLFWimage { | ||
int width; | ||
int height; | ||
unsigned char* pixels; | ||
} GLFWimage; | ||
|
||
typedef struct GLFWvidmode { | ||
int width; | ||
int height; | ||
int redBits; | ||
int greenBits; | ||
int blueBits; | ||
int refreshRate; | ||
} GLFWvidmode; | ||
|
||
typedef struct GLFWcursor GLFWcursor; | ||
typedef struct GLFWwindow GLFWwindow; | ||
typedef struct GLFWmonitor GLFWmonitor; | ||
typedef void* deferred_event_queue_t; // Duplicated in the interop aliases (fix later) | ||
|
||
typedef void* WGPUSurface; | ||
typedef void* WGPUInstance; |
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,40 @@ | ||
struct static_glfw_exports_table { | ||
const char* (*glfw_version)(void); | ||
int (*glfw_find_constant)(const char* name); | ||
|
||
WGPUSurface (*glfw_get_wgpu_surface)(WGPUInstance instance, GLFWwindow* window); | ||
|
||
int (*glfw_init)(void); | ||
void (*glfw_terminate)(void); | ||
void (*glfw_poll_events)(void); | ||
|
||
GLFWwindow* (*glfw_create_window)(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share); | ||
void (*glfw_destroy_window)(GLFWwindow* window); | ||
int (*glfw_window_should_close)(GLFWwindow* window); | ||
void (*glfw_window_hint)(int hint, int value); | ||
void (*glfw_set_window_pos)(GLFWwindow* window, int xpos, int ypos); | ||
void (*glfw_get_framebuffer_size)(GLFWwindow* window, int* width, int* height); | ||
void (*glfw_get_window_size)(GLFWwindow* window, int* width, int* height); | ||
void (*glfw_maximize_window)(GLFWwindow* window); | ||
void (*glfw_restore_window)(GLFWwindow* window); | ||
void (*glfw_hide_window)(GLFWwindow* window); | ||
void (*glfw_show_window)(GLFWwindow* window); | ||
int (*glfw_get_window_attrib)(GLFWwindow* window, int attrib); | ||
void (*glfw_set_window_icon)(GLFWwindow* window, int count, const GLFWimage* images); | ||
|
||
void (*glfw_register_events)(GLFWwindow* window, deferred_event_queue_t queue); | ||
|
||
GLFWmonitor* (*glfw_get_primary_monitor)(void); | ||
GLFWmonitor** (*glfw_get_monitors)(int* count); | ||
GLFWmonitor* (*glfw_get_window_monitor)(GLFWwindow* window); | ||
void (*glfw_set_window_monitor)(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); | ||
const GLFWvidmode* (*glfw_get_video_mode)(GLFWmonitor* monitor); | ||
|
||
void (*glfw_get_cursor_pos)(GLFWwindow* window, double* xpos, double* ypos); | ||
GLFWcursor* (*glfw_create_cursor)(const GLFWimage* image, int xhot, int yhot); | ||
void (*glfw_destroy_cursor)(GLFWcursor* cursor); | ||
void (*glfw_set_cursor)(GLFWwindow* window, GLFWcursor* cursor); | ||
|
||
int (*glfw_get_key)(GLFWwindow* window, int key); | ||
int (*glfw_get_mouse_button)(GLFWwindow* window, int button); | ||
}; |
Oops, something went wrong.