2019-10-03 02:58:05 +00:00
|
|
|
/*
|
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
|
|
|
* 02.10.2019
|
|
|
|
*
|
|
|
|
* System API definition program.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
2019-10-03 23:00:31 +00:00
|
|
|
#include "4ed_api_definition_main.cpp"
|
2019-10-03 02:58:05 +00:00
|
|
|
|
|
|
|
function API_Definition*
|
|
|
|
define_api(Arena *arena){
|
|
|
|
API_Definition *api = begin_api(arena, "system");
|
|
|
|
|
2019-10-03 17:57:44 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "get_path", "String_Const_u8");
|
|
|
|
api_param(arena, call, "Arena*", "arena");
|
|
|
|
api_param(arena, call, "System_Path_Code", "path_code");
|
|
|
|
}
|
|
|
|
|
2019-10-03 02:58:05 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "get_canonical", "String_Const_u8");
|
|
|
|
api_param(arena, call, "Arena*", "arena");
|
|
|
|
api_param(arena, call, "String_Const_u8", "name");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "get_file_list", "File_List");
|
|
|
|
api_param(arena, call, "Arena*", "arena");
|
|
|
|
api_param(arena, call, "String_Const_u8", "directory");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "quick_file_attributes", "File_Attributes");
|
|
|
|
api_param(arena, call, "Arena*", "scratch");
|
|
|
|
api_param(arena, call, "String_Const_u8", "file_name");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "load_handle", "b32");
|
|
|
|
api_param(arena, call, "Arena*", "scratch");
|
|
|
|
api_param(arena, call, "char*", "file_name");
|
|
|
|
api_param(arena, call, "Plat_Handle*", "out");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "load_attributes", "File_Attributes");
|
|
|
|
api_param(arena, call, "Plat_Handle", "handle");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "load_file", "b32");
|
|
|
|
api_param(arena, call, "Plat_Handle", "handle");
|
|
|
|
api_param(arena, call, "char*", "buffer");
|
|
|
|
api_param(arena, call, "u32", "size");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "load_close", "b32");
|
|
|
|
api_param(arena, call, "Plat_Handle", "handle");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "save_file", "File_Attributes");
|
|
|
|
api_param(arena, call, "Arena*", "scratch");
|
|
|
|
api_param(arena, call, "char*", "file_name");
|
|
|
|
api_param(arena, call, "String_Const_u8", "data");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "load_library", "b32");
|
|
|
|
api_param(arena, call, "Arena*", "scratch");
|
|
|
|
api_param(arena, call, "String_Const_u8", "file_name");
|
|
|
|
api_param(arena, call, "System_Library*", "out");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "release_library", "b32");
|
|
|
|
api_param(arena, call, "System_Library", "handle");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-10-03 17:57:44 +00:00
|
|
|
API_Call *call = api_call(arena, api, "get_proc", "Void_Func*");
|
2019-10-03 02:58:05 +00:00
|
|
|
api_param(arena, call, "System_Library", "handle");
|
|
|
|
api_param(arena, call, "char*", "proc_name");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-12-13 00:03:21 +00:00
|
|
|
api_call(arena, api, "now_time", "u64");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
2020-03-11 10:33:54 +00:00
|
|
|
{
|
|
|
|
api_call(arena, api, "now_date_time_universal", "Date_Time");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "local_date_time_from_universal", "Date_Time");
|
|
|
|
api_param(arena, call, "Date_Time*", "date_time");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "universal_date_time_from_local", "Date_Time");
|
|
|
|
api_param(arena, call, "Date_Time*", "date_time");
|
|
|
|
}
|
|
|
|
|
2019-10-03 02:58:05 +00:00
|
|
|
{
|
2019-12-13 00:03:21 +00:00
|
|
|
api_call(arena, api, "wake_up_timer_create", "Plat_Handle");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "wake_up_timer_release", "void");
|
|
|
|
api_param(arena, call, "Plat_Handle", "handle");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "wake_up_timer_set", "void");
|
|
|
|
api_param(arena, call, "Plat_Handle", "handle");
|
|
|
|
api_param(arena, call, "u32", "time_milliseconds");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "signal_step", "void");
|
|
|
|
api_param(arena, call, "u32", "code");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "sleep", "void");
|
|
|
|
api_param(arena, call, "u64", "microseconds");
|
|
|
|
}
|
|
|
|
|
2020-02-08 00:50:35 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "get_clipboard", "String_Const_u8");
|
|
|
|
api_param(arena, call, "Arena*", "arena");
|
2020-02-09 01:34:35 +00:00
|
|
|
api_param(arena, call, "i32", "index");
|
2020-02-08 00:50:35 +00:00
|
|
|
}
|
2019-10-03 02:58:05 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "post_clipboard", "void");
|
|
|
|
api_param(arena, call, "String_Const_u8", "str");
|
2020-02-09 01:34:35 +00:00
|
|
|
api_param(arena, call, "i32", "index");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
2020-02-08 00:50:35 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "set_clipboard_catch_all", "void");
|
|
|
|
api_param(arena, call, "b32", "enabled");
|
|
|
|
}
|
|
|
|
{
|
|
|
|
api_call(arena, api, "get_clipboard_catch_all", "b32");
|
|
|
|
}
|
|
|
|
|
2019-10-03 02:58:05 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "cli_call", "b32");
|
|
|
|
api_param(arena, call, "Arena*", "scratch");
|
|
|
|
api_param(arena, call, "char*", "path");
|
|
|
|
api_param(arena, call, "char*", "script");
|
|
|
|
api_param(arena, call, "CLI_Handles*", "cli_out");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "cli_begin_update", "void");
|
|
|
|
api_param(arena, call, "CLI_Handles*", "cli");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "cli_update_step", "b32");
|
|
|
|
api_param(arena, call, "CLI_Handles*", "cli");
|
|
|
|
api_param(arena, call, "char*", "dest");
|
|
|
|
api_param(arena, call, "u32", "max");
|
|
|
|
api_param(arena, call, "u32*", "amount");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "cli_end_update", "b32");
|
|
|
|
api_param(arena, call, "CLI_Handles*", "cli");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "open_color_picker", "void");
|
|
|
|
api_param(arena, call, "Color_Picker*", "picker");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-12-13 00:03:21 +00:00
|
|
|
api_call(arena, api, "get_screen_scale_factor", "f32");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "thread_launch", "System_Thread");
|
|
|
|
api_param(arena, call, "Thread_Function*", "proc");
|
|
|
|
api_param(arena, call, "void*", "ptr");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "thread_join", "void");
|
|
|
|
api_param(arena, call, "System_Thread", "thread");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "thread_free", "void");
|
|
|
|
api_param(arena, call, "System_Thread", "thread");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2020-02-08 00:50:35 +00:00
|
|
|
api_call(arena, api, "thread_get_id", "i32");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
2019-10-21 02:02:58 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "acquire_global_frame_mutex", "void");
|
|
|
|
api_param(arena, call, "Thread_Context*", "tctx");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "release_global_frame_mutex", "void");
|
|
|
|
api_param(arena, call, "Thread_Context*", "tctx");
|
|
|
|
}
|
|
|
|
|
2019-10-03 02:58:05 +00:00
|
|
|
{
|
2020-02-08 00:50:35 +00:00
|
|
|
api_call(arena, api, "mutex_make", "System_Mutex");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "mutex_acquire", "void");
|
|
|
|
api_param(arena, call, "System_Mutex", "mutex");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "mutex_release", "void");
|
|
|
|
api_param(arena, call, "System_Mutex", "mutex");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "mutex_free", "void");
|
|
|
|
api_param(arena, call, "System_Mutex", "mutex");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2020-02-08 00:50:35 +00:00
|
|
|
api_call(arena, api, "condition_variable_make",
|
|
|
|
"System_Condition_Variable");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "condition_variable_wait", "void");
|
|
|
|
api_param(arena, call, "System_Condition_Variable", "cv");
|
|
|
|
api_param(arena, call, "System_Mutex", "mutex");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "condition_variable_signal", "void");
|
|
|
|
api_param(arena, call, "System_Condition_Variable", "cv");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "condition_variable_free", "void");
|
|
|
|
api_param(arena, call, "System_Condition_Variable", "cv");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "memory_allocate", "void*");
|
2019-12-18 03:38:08 +00:00
|
|
|
api_param(arena, call, "u64", "size");
|
2019-11-22 05:37:11 +00:00
|
|
|
api_param(arena, call, "String_Const_u8", "location");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "memory_set_protection", "b32");
|
|
|
|
api_param(arena, call, "void*", "ptr");
|
2019-12-18 03:38:08 +00:00
|
|
|
api_param(arena, call, "u64", "size");
|
2019-10-03 02:58:05 +00:00
|
|
|
api_param(arena, call, "u32", "flags");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "memory_free", "void");
|
|
|
|
api_param(arena, call, "void*", "ptr");
|
2019-12-18 03:38:08 +00:00
|
|
|
api_param(arena, call, "u64", "size");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
2019-11-22 05:37:11 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "memory_annotation", "Memory_Annotation");
|
|
|
|
api_param(arena, call, "Arena*", "arena");
|
|
|
|
}
|
|
|
|
|
2019-10-03 02:58:05 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "show_mouse_cursor", "void");
|
|
|
|
api_param(arena, call, "i32", "show");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "set_fullscreen", "b32");
|
|
|
|
api_param(arena, call, "b32", "full_screen");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2020-02-08 00:50:35 +00:00
|
|
|
api_call(arena, api, "is_fullscreen", "b32");
|
2019-10-03 02:58:05 +00:00
|
|
|
}
|
|
|
|
|
2019-10-10 00:07:38 +00:00
|
|
|
{
|
2019-10-11 01:40:10 +00:00
|
|
|
API_Call *call = api_call(arena, api, "get_keyboard_modifiers", "Input_Modifier_Set");
|
|
|
|
api_param(arena, call, "Arena*", "arena");
|
2019-10-10 00:07:38 +00:00
|
|
|
}
|
|
|
|
|
2020-05-09 15:03:10 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "set_key_mode", "void");
|
|
|
|
api_param(arena, call, "Key_Mode", "mode");
|
|
|
|
}
|
|
|
|
|
2020-11-23 21:46:01 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "play_clip", "void");
|
|
|
|
api_param(arena, call, "Audio_Clip", "clip");
|
|
|
|
api_param(arena, call, "Audio_Control*", "control");
|
|
|
|
}
|
|
|
|
|
2020-11-24 01:45:04 +00:00
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "audio_is_playing", "b32");
|
|
|
|
api_param(arena, call, "Audio_Control*", "control");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
API_Call *call = api_call(arena, api, "audio_stop", "void");
|
|
|
|
api_param(arena, call, "Audio_Control*", "control");
|
|
|
|
}
|
|
|
|
|
2019-10-03 02:58:05 +00:00
|
|
|
return(api);
|
|
|
|
}
|
|
|
|
|
2019-10-08 01:11:40 +00:00
|
|
|
function Generated_Group
|
|
|
|
get_api_group(void){
|
|
|
|
return(GeneratedGroup_Custom);
|
|
|
|
}
|
|
|
|
|
2019-10-03 02:58:05 +00:00
|
|
|
// BOTTOM
|
|
|
|
|