More int32_t uint32_t changes

master
Allen Webster 2019-02-26 15:17:53 -08:00
parent 632e2bf9cd
commit 76f57e2a79
32 changed files with 627 additions and 629 deletions

View File

@ -48,7 +48,7 @@ enum{
key_f16 = 55296 + 45, key_f16 = 55296 + 45,
}; };
static char* static char*
global_key_name(uint32_t key_code, int32_t *size){ global_key_name(u32 key_code, i32 *size){
char *result = 0; char *result = 0;
switch(key_code){ switch(key_code){
case key_back: result = "key_back"; *size = sizeof("key_back")-1; break; case key_back: result = "key_back"; *size = sizeof("key_back")-1; break;

View File

@ -28,7 +28,7 @@ typedef b32 bool32;
static b32 static b32
exec_system_command(Application_Links *app, View_Summary *view, Buffer_Identifier buffer_id, exec_system_command(Application_Links *app, View_Summary *view, Buffer_Identifier buffer_id,
char *path, int32_t path_len, char *command, int32_t command_len, Command_Line_Interface_Flag flags){ char *path, int32_t path_len, char *command, i32 command_len, Command_Line_Interface_Flag flags){
b32 result = false; b32 result = false;
if (view != 0 && view->exists){ if (view != 0 && view->exists){
result = exec_system_command(app, view->view_id, buffer_id, make_string(path, path_len), make_string(command, command_len), flags); result = exec_system_command(app, view->view_id, buffer_id, make_string(path, path_len), make_string(command, command_len), flags);
@ -38,20 +38,20 @@ exec_system_command(Application_Links *app, View_Summary *view, Buffer_Identifie
} }
static b32 static b32
clipboard_post(Application_Links *app, int32_t clipboard_id, char *str, int32_t len){ clipboard_post(Application_Links *app, i32 clipboard_id, char *str, i32 len){
return(clipboard_post(app, clipboard_id, make_string(str, len))); return(clipboard_post(app, clipboard_id, make_string(str, len)));
} }
static int32_t static i32
clipboard_count(Application_Links *app, int32_t clipboard_id){ clipboard_count(Application_Links *app, i32 clipboard_id){
int32_t count = 0; i32 count = 0;
clipboard_count(app, clipboard_id, &count); clipboard_count(app, clipboard_id, &count);
return(count); return(count);
} }
static int32_t static i32
clipboard_index(Application_Links *app, int32_t clipboard_id, int32_t item_index, char *out, int32_t len){ clipboard_index(Application_Links *app, i32 clipboard_id, i32 item_index, char *out, i32 len){
int32_t required_size = 0; i32 required_size = 0;
String string = make_string_cap(out, 0, len); String string = make_string_cap(out, 0, len);
clipboard_index(app, clipboard_id, item_index, &string, &required_size); clipboard_index(app, clipboard_id, item_index, &string, &required_size);
return(required_size); return(required_size);
@ -88,7 +88,7 @@ get_buffer(Application_Links *app, Buffer_ID buffer_id, Access_Flag access){
} }
static Buffer_Summary static Buffer_Summary
get_buffer_by_name(Application_Links *app, char *name, int32_t len, Access_Flag access){ get_buffer_by_name(Application_Links *app, char *name, i32 len, Access_Flag access){
Buffer_ID id = 0; Buffer_ID id = 0;
Buffer_Summary buffer = {}; Buffer_Summary buffer = {};
if (get_buffer_by_name(app, make_string(name, len), access, &id)){ if (get_buffer_by_name(app, make_string(name, len), access, &id)){
@ -98,7 +98,7 @@ get_buffer_by_name(Application_Links *app, char *name, int32_t len, Access_Flag
} }
static Buffer_Summary static Buffer_Summary
get_buffer_by_file_name(Application_Links *app, char *name, int32_t len, Access_Flag access){ get_buffer_by_file_name(Application_Links *app, char *name, i32 len, Access_Flag access){
Buffer_ID id = 0; Buffer_ID id = 0;
Buffer_Summary buffer = {}; Buffer_Summary buffer = {};
if (get_buffer_by_file_name(app, make_string(name, len), access, &id)){ if (get_buffer_by_file_name(app, make_string(name, len), access, &id)){
@ -108,7 +108,7 @@ get_buffer_by_file_name(Application_Links *app, char *name, int32_t len, Access_
} }
static b32 static b32
buffer_read_range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t one_past_last, char *out){ buffer_read_range(Application_Links *app, Buffer_Summary *buffer, i32 start, i32 one_past_last, char *out){
b32 result = false; b32 result = false;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
result = buffer_read_range(app, buffer->buffer_id, start, one_past_last, out); result = buffer_read_range(app, buffer->buffer_id, start, one_past_last, out);
@ -118,7 +118,7 @@ buffer_read_range(Application_Links *app, Buffer_Summary *buffer, int32_t start,
} }
static b32 static b32
buffer_replace_range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t one_past_last, char *str, int32_t len){ buffer_replace_range(Application_Links *app, Buffer_Summary *buffer, i32 start, i32 one_past_last, char *str, i32 len){
b32 result = false; b32 result = false;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
result = buffer_replace_range(app, buffer->buffer_id, start, one_past_last, make_string(str, len)); result = buffer_replace_range(app, buffer->buffer_id, start, one_past_last, make_string(str, len));
@ -138,7 +138,7 @@ buffer_compute_cursor(Application_Links *app, Buffer_Summary *buffer, Buffer_See
} }
static b32 static b32
buffer_batch_edit(Application_Links *app, Buffer_Summary *buffer, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type){ buffer_batch_edit(Application_Links *app, Buffer_Summary *buffer, char *str, i32 str_len, Buffer_Edit *edits, i32 edit_count, Buffer_Batch_Edit_Type type){
b32 result = false; b32 result = false;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
result = buffer_batch_edit(app, buffer->buffer_id, str, str_len, edits, edit_count, type); result = buffer_batch_edit(app, buffer->buffer_id, str, str_len, edits, edit_count, type);
@ -148,7 +148,7 @@ buffer_batch_edit(Application_Links *app, Buffer_Summary *buffer, char *str, int
} }
static b32 static b32
buffer_get_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out){ buffer_get_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, i32 *value_out){
b32 result = false; b32 result = false;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
result = buffer_get_setting(app, buffer->buffer_id, setting, value_out); result = buffer_get_setting(app, buffer->buffer_id, setting, value_out);
@ -158,7 +158,7 @@ buffer_get_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Settin
} }
static b32 static b32
buffer_set_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value){ buffer_set_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, i32 value){
b32 result = false; b32 result = false;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
result = buffer_set_setting(app, buffer->buffer_id, setting, value); result = buffer_set_setting(app, buffer->buffer_id, setting, value);
@ -174,9 +174,9 @@ buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id){
return(scope); return(scope);
} }
static int32_t static i32
buffer_token_count(Application_Links *app, Buffer_Summary *buffer){ buffer_token_count(Application_Links *app, Buffer_Summary *buffer){
int32_t count = 0; i32 count = 0;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
buffer_token_count(app, buffer->buffer_id, &count); buffer_token_count(app, buffer->buffer_id, &count);
} }
@ -184,7 +184,7 @@ buffer_token_count(Application_Links *app, Buffer_Summary *buffer){
} }
static b32 static b32
buffer_read_tokens(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){ buffer_read_tokens(Application_Links *app, Buffer_Summary *buffer, i32 start_token, i32 end_token, Cpp_Token *tokens_out){
b32 result = false; b32 result = false;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
result = buffer_read_tokens(app, buffer->buffer_id, start_token, end_token, tokens_out); result = buffer_read_tokens(app, buffer->buffer_id, start_token, end_token, tokens_out);
@ -204,7 +204,7 @@ buffer_get_token_range(Application_Links *app, Buffer_Summary *buffer, Cpp_Token
} }
static b32 static b32
buffer_get_token_index(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result){ buffer_get_token_index(Application_Links *app, Buffer_Summary *buffer, i32 pos, Cpp_Get_Token_Result *get_result){
b32 result = false; b32 result = false;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
result = buffer_get_token_index(app, buffer->buffer_id, pos, get_result); result = buffer_get_token_index(app, buffer->buffer_id, pos, get_result);
@ -224,7 +224,7 @@ buffer_send_end_signal(Application_Links *app, Buffer_Summary *buffer){
} }
static Buffer_Summary static Buffer_Summary
create_buffer(Application_Links *app, char *filename, int32_t filename_len, Buffer_Create_Flag flags){ create_buffer(Application_Links *app, char *filename, i32 filename_len, Buffer_Create_Flag flags){
Buffer_Summary buffer = {}; Buffer_Summary buffer = {};
Buffer_ID buffer_id = 0; Buffer_ID buffer_id = 0;
if (create_buffer(app, make_string(filename, filename_len), flags, &buffer_id)){ if (create_buffer(app, make_string(filename, filename_len), flags, &buffer_id)){
@ -234,7 +234,7 @@ create_buffer(Application_Links *app, char *filename, int32_t filename_len, Buff
} }
static b32 static b32
save_buffer(Application_Links *app, Buffer_Summary *buffer, char *file_name, int32_t file_name_len, uint32_t flags){ save_buffer(Application_Links *app, Buffer_Summary *buffer, char *file_name, i32 file_name_len, u32 flags){
b32 result = false; b32 result = false;
if (buffer != 0 && buffer->exists){ if (buffer != 0 && buffer->exists){
result = buffer_save(app, buffer->buffer_id, make_string(file_name, file_name_len), flags); result = buffer_save(app, buffer->buffer_id, make_string(file_name, file_name_len), flags);
@ -349,7 +349,7 @@ set_active_view(Application_Links *app, View_Summary *view){
} }
static b32 static b32
view_get_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out){ view_get_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, i32 *value_out){
b32 result = false; b32 result = false;
if (view != 0 && view->exists){ if (view != 0 && view->exists){
result = view_get_setting(app, view->view_id, setting, value_out); result = view_get_setting(app, view->view_id, setting, value_out);
@ -359,7 +359,7 @@ view_get_setting(Application_Links *app, View_Summary *view, View_Setting_ID set
} }
static b32 static b32
view_set_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value){ view_set_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, i32 value){
b32 result = false; b32 result = false;
if (view != 0 && view->exists){ if (view != 0 && view->exists){
result = view_set_setting(app, view->view_id, setting, value); result = view_set_setting(app, view->view_id, setting, value);
@ -375,7 +375,7 @@ view_get_managed_scope(Application_Links *app, View_ID view_id){
return(scope); return(scope);
} }
typedef int32_t View_Split_Kind; typedef i32 View_Split_Kind;
enum{ enum{
ViewSplitKind_Ratio, ViewSplitKind_Ratio,
ViewSplitKind_FixedPixels, ViewSplitKind_FixedPixels,
@ -469,7 +469,7 @@ view_set_buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id,
} }
static b32 static b32
view_post_fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color){ view_post_fade(Application_Links *app, View_Summary *view, float seconds, i32 start, i32 end, int_color color){
b32 result = false; b32 result = false;
if (view != 0 && view->exists){ if (view != 0 && view->exists){
result = view_post_fade(app, view->view_id, seconds, start, end, color); result = view_post_fade(app, view->view_id, seconds, start, end, color);
@ -499,7 +499,7 @@ view_end_ui_mode(Application_Links *app, View_Summary *view){
} }
static b32 static b32
view_set_highlight(Application_Links *app, View_ID view_id, int32_t start, int32_t end, b32 turn_on){ view_set_highlight(Application_Links *app, View_ID view_id, i32 start, i32 end, b32 turn_on){
// NOTE(allen): this feature is completely removed, transition to using highlighted markers instead // NOTE(allen): this feature is completely removed, transition to using highlighted markers instead
return(false); return(false);
} }
@ -527,51 +527,51 @@ get_face_id(Application_Links *app, Buffer_Summary *buffer){
} }
static void static void
print_message(Application_Links *app, char *str, int32_t len){ print_message(Application_Links *app, char *str, i32 len){
print_message(app, make_string(str, len)); print_message(app, make_string(str, len));
} }
#if 0 #if 0
static void static void
create_theme(Application_Links *app, Theme *theme, char *name, int32_t len){ create_theme(Application_Links *app, Theme *theme, char *name, i32 len){
create_theme(app, theme, make_string(name, len)); create_theme(app, theme, make_string(name, len));
} }
static void static void
change_theme(Application_Links *app, char *name, int32_t len){ change_theme(Application_Links *app, char *name, i32 len){
change_theme(app, make_string(name, len)); change_theme(app, make_string(name, len));
} }
#endif #endif
static int32_t static i32
directory_get_hot(Application_Links *app, char *out, int32_t capacity){ directory_get_hot(Application_Links *app, char *out, i32 capacity){
int32_t required_size = 0; i32 required_size = 0;
String string = make_string_cap(out, 0, capacity); String string = make_string_cap(out, 0, capacity);
get_hot_directory(app, &string, &required_size); get_hot_directory(app, &string, &required_size);
return(required_size); return(required_size);
} }
static b32 static b32
directory_set_hot(Application_Links *app, char *str, int32_t len){ directory_set_hot(Application_Links *app, char *str, i32 len){
return(set_hot_directory(app, make_string(str, len))); return(set_hot_directory(app, make_string(str, len)));
} }
static File_List static File_List
get_file_list(Application_Links *app, char *dir, int32_t len){ get_file_list(Application_Links *app, char *dir, i32 len){
File_List list = {}; File_List list = {};
get_file_list(app, make_string(dir, len), &list); get_file_list(app, make_string(dir, len), &list);
return(list); return(list);
} }
static b32 static b32
file_exists(Application_Links *app, char *file_name, int32_t len){ file_exists(Application_Links *app, char *file_name, i32 len){
File_Attributes attributes = {}; File_Attributes attributes = {};
file_get_attributes(app, make_string(file_name, len), &attributes); file_get_attributes(app, make_string(file_name, len), &attributes);
return(attributes.last_write_time > 0); return(attributes.last_write_time > 0);
} }
static b32 static b32
directory_cd(Application_Links *app, char *dir, int32_t *len, int32_t capacity, char *rel_path, int32_t rel_len){ directory_cd(Application_Links *app, char *dir, i32 *len, i32 capacity, char *rel_path, i32 rel_len){
String directory = make_string_cap(dir, *len, capacity); String directory = make_string_cap(dir, *len, capacity);
String relative_path = make_string(rel_path, rel_len); String relative_path = make_string(rel_path, rel_len);
b32 result = directory_cd(app, &directory, relative_path); b32 result = directory_cd(app, &directory, relative_path);
@ -579,9 +579,9 @@ directory_cd(Application_Links *app, char *dir, int32_t *len, int32_t capacity,
return(result); return(result);
} }
static int32_t static i32
get_4ed_path(Application_Links *app, char *out, int32_t capacity){ get_4ed_path(Application_Links *app, char *out, i32 capacity){
int32_t required_size = 0; i32 required_size = 0;
String string = make_string_cap(out, 0, capacity); String string = make_string_cap(out, 0, capacity);
get_4ed_path(app, &string, &required_size); get_4ed_path(app, &string, &required_size);
return(required_size); return(required_size);

View File

@ -6,14 +6,14 @@ moving the cursor, which work even without the default 4coder framework.
// TOP // TOP
static void static void
write_character_parameter(Application_Links *app, uint8_t *character, uint32_t length){ write_character_parameter(Application_Links *app, uint8_t *character, u32 length){
if (length != 0){ if (length != 0){
View_Summary view = get_active_view(app, AccessOpen); View_Summary view = get_active_view(app, AccessOpen);
if_view_has_highlighted_range_delete_range(app, view.view_id); if_view_has_highlighted_range_delete_range(app, view.view_id);
view = get_view(app, view.view_id, AccessAll); view = get_view(app, view.view_id, AccessAll);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen);
int32_t pos = view.cursor.pos; i32 pos = view.cursor.pos;
// NOTE(allen): setup markers to figure out the new position of cursor after the insert // NOTE(allen): setup markers to figure out the new position of cursor after the insert
Marker next_cursor_marker = {}; Marker next_cursor_marker = {};
@ -30,7 +30,7 @@ write_character_parameter(Application_Links *app, uint8_t *character, uint32_t l
Record_Info record = get_single_record(app, buffer.buffer_id, first_index); Record_Info record = get_single_record(app, buffer.buffer_id, first_index);
if (record.error == RecordError_NoError && record.kind == RecordKind_Single){ if (record.error == RecordError_NoError && record.kind == RecordKind_Single){
String string = record.single.string_forward; String string = record.single.string_forward;
int32_t last_end = record.single.first + string.size; i32 last_end = record.single.first + string.size;
if (last_end == pos && string.size > 0){ if (last_end == pos && string.size > 0){
char c = string.str[string.size - 1]; char c = string.str[string.size - 1];
if (c != '\n'){ if (c != '\n'){
@ -69,7 +69,7 @@ CUSTOM_DOC("Inserts whatever character was used to trigger this command.")
{ {
User_Input in = get_command_input(app); User_Input in = get_command_input(app);
uint8_t character[4]; uint8_t character[4];
uint32_t length = to_writable_character(in, character); u32 length = to_writable_character(in, character);
write_character_parameter(app, character, length); write_character_parameter(app, character, length);
} }
@ -83,16 +83,16 @@ CUSTOM_DOC("Inserts an underscore.")
CUSTOM_COMMAND_SIG(delete_char) CUSTOM_COMMAND_SIG(delete_char)
CUSTOM_DOC("Deletes the character to the right of the cursor.") CUSTOM_DOC("Deletes the character to the right of the cursor.")
{ {
uint32_t access = AccessOpen; u32 access = AccessOpen;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
if (!if_view_has_highlighted_range_delete_range(app, view.view_id)){ if (!if_view_has_highlighted_range_delete_range(app, view.view_id)){
view = get_view(app, view.view_id, AccessAll); view = get_view(app, view.view_id, AccessAll);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); Buffer_Summary buffer = get_buffer(app, view.buffer_id, access);
int32_t start = view.cursor.pos; i32 start = view.cursor.pos;
if (0 <= start && start < buffer.size){ if (0 <= start && start < buffer.size){
Full_Cursor cursor = {}; Full_Cursor cursor = {};
view_compute_cursor(app, &view, seek_character_pos(view.cursor.character_pos + 1), &cursor); view_compute_cursor(app, &view, seek_character_pos(view.cursor.character_pos + 1), &cursor);
int32_t end = cursor.pos; i32 end = cursor.pos;
buffer_replace_range(app, &buffer, start, end, 0, 0); buffer_replace_range(app, &buffer, start, end, 0, 0);
} }
} }
@ -101,16 +101,16 @@ CUSTOM_DOC("Deletes the character to the right of the cursor.")
CUSTOM_COMMAND_SIG(backspace_char) CUSTOM_COMMAND_SIG(backspace_char)
CUSTOM_DOC("Deletes the character to the left of the cursor.") CUSTOM_DOC("Deletes the character to the left of the cursor.")
{ {
uint32_t access = AccessOpen; u32 access = AccessOpen;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
if (!if_view_has_highlighted_range_delete_range(app, view.view_id)){ if (!if_view_has_highlighted_range_delete_range(app, view.view_id)){
view = get_view(app, view.view_id, AccessAll); view = get_view(app, view.view_id, AccessAll);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); Buffer_Summary buffer = get_buffer(app, view.buffer_id, access);
int32_t end = view.cursor.pos; i32 end = view.cursor.pos;
if (0 < end && end <= buffer.size){ if (0 < end && end <= buffer.size){
Full_Cursor cursor = {}; Full_Cursor cursor = {};
view_compute_cursor(app, &view, seek_character_pos(view.cursor.character_pos - 1), &cursor); view_compute_cursor(app, &view, seek_character_pos(view.cursor.character_pos - 1), &cursor);
int32_t start = cursor.pos; i32 start = cursor.pos;
if (buffer_replace_range(app, &buffer, start, end, 0, 0)){ if (buffer_replace_range(app, &buffer, start, end, 0, 0)){
view_set_cursor(app, &view, seek_character_pos(view.cursor.character_pos - 1), true); view_set_cursor(app, &view, seek_character_pos(view.cursor.character_pos - 1), true);
} }
@ -130,8 +130,8 @@ CUSTOM_COMMAND_SIG(cursor_mark_swap)
CUSTOM_DOC("Swaps the position of the cursor and the mark.") CUSTOM_DOC("Swaps the position of the cursor and the mark.")
{ {
View_Summary view = get_active_view(app, AccessProtected); View_Summary view = get_active_view(app, AccessProtected);
int32_t cursor = view.cursor.pos; i32 cursor = view.cursor.pos;
int32_t mark = view.mark.pos; i32 mark = view.mark.pos;
view_set_cursor(app, &view, seek_pos(mark), true); view_set_cursor(app, &view, seek_pos(mark), true);
view_set_mark(app, &view, seek_pos(cursor)); view_set_mark(app, &view, seek_pos(cursor));
} }
@ -139,7 +139,7 @@ CUSTOM_DOC("Swaps the position of the cursor and the mark.")
CUSTOM_COMMAND_SIG(delete_range) CUSTOM_COMMAND_SIG(delete_range)
CUSTOM_DOC("Deletes the text in the range between the cursor and the mark.") CUSTOM_DOC("Deletes the text in the range between the cursor and the mark.")
{ {
uint32_t access = AccessOpen; u32 access = AccessOpen;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); Buffer_Summary buffer = get_buffer(app, view.buffer_id, access);
Range range = get_view_range(&view); Range range = get_view_range(&view);
@ -159,7 +159,7 @@ CUSTOM_DOC("Centers the view vertically on the line on which the cursor sits.")
float h = (float)(region.y1 - region.y0); float h = (float)(region.y1 - region.y0);
float y = get_view_y(&view); float y = get_view_y(&view);
y = y - h*.5f; y = y - h*.5f;
scroll.target_y = (int32_t)(y + .5f); scroll.target_y = (i32)(y + .5f);
view_set_scroll(app, &view, scroll); view_set_scroll(app, &view, scroll);
} }
@ -175,7 +175,7 @@ CUSTOM_DOC("Sets the left size of the view near the x position of the cursor.")
x = 0.f; x = 0.f;
} }
scroll.target_x = (int32_t)(x + .5f); scroll.target_x = (i32)(x + .5f);
view_set_scroll(app, &view, scroll); view_set_scroll(app, &view, scroll);
} }
@ -258,7 +258,7 @@ CUSTOM_DOC("Reads the scroll wheel value from the mouse state and scrolls accord
static void static void
move_vertical(Application_Links *app, float line_multiplier){ move_vertical(Application_Links *app, float line_multiplier){
uint32_t access = AccessProtected; u32 access = AccessProtected;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
float delta_y = line_multiplier*view.line_height; float delta_y = line_multiplier*view.line_height;
@ -269,11 +269,11 @@ move_vertical(Application_Links *app, float line_multiplier){
float actual_new_y = get_view_y(&view); float actual_new_y = get_view_y(&view);
if (actual_new_y < new_y){ if (actual_new_y < new_y){
i32_Rect file_region = view.file_region; i32_Rect file_region = view.file_region;
int32_t height = file_region.y1 - file_region.y0; i32 height = file_region.y1 - file_region.y0;
int32_t full_scroll_y = (int32_t)actual_new_y - height/2; i32 full_scroll_y = (i32)actual_new_y - height/2;
if (view.scroll_vars.target_y < full_scroll_y){ if (view.scroll_vars.target_y < full_scroll_y){
GUI_Scroll_Vars new_scroll_vars = view.scroll_vars; GUI_Scroll_Vars new_scroll_vars = view.scroll_vars;
new_scroll_vars.target_y += (int32_t)delta_y; new_scroll_vars.target_y += (i32)delta_y;
if (new_scroll_vars.target_y > full_scroll_y){ if (new_scroll_vars.target_y > full_scroll_y){
new_scroll_vars.target_y = full_scroll_y; new_scroll_vars.target_y = full_scroll_y;
} }
@ -289,9 +289,9 @@ get_page_jump(View_Summary *view){
i32_Rect region = view->file_region; i32_Rect region = view->file_region;
float page_jump = 1.f; float page_jump = 1.f;
if (view->line_height > 0.f){ if (view->line_height > 0.f){
int32_t height = region.y1 - region.y0; i32 height = region.y1 - region.y0;
float line_count = (float)(height)/view->line_height; float line_count = (float)(height)/view->line_height;
int32_t line_count_rounded = (int32_t)line_count; i32 line_count_rounded = (i32)line_count;
page_jump = (float)line_count_rounded - 3.f; page_jump = (float)line_count_rounded - 3.f;
if (page_jump <= 1.f){ if (page_jump <= 1.f){
page_jump = 1.f; page_jump = 1.f;
@ -331,14 +331,14 @@ CUSTOM_DOC("Moves down to the next line of actual text, regardless of line wrapp
if (!view.exists){ if (!view.exists){
return; return;
} }
int32_t next_line = view.cursor.line + 1; i32 next_line = view.cursor.line + 1;
view_set_cursor(app, &view, seek_line_char(next_line, 1), true); view_set_cursor(app, &view, seek_line_char(next_line, 1), true);
} }
CUSTOM_COMMAND_SIG(page_up) CUSTOM_COMMAND_SIG(page_up)
CUSTOM_DOC("Scrolls the view up one view height and moves the cursor up one view height.") CUSTOM_DOC("Scrolls the view up one view height and moves the cursor up one view height.")
{ {
uint32_t access = AccessProtected; u32 access = AccessProtected;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
float page_jump = get_page_jump(&view); float page_jump = get_page_jump(&view);
move_vertical(app, -page_jump); move_vertical(app, -page_jump);
@ -347,7 +347,7 @@ CUSTOM_DOC("Scrolls the view up one view height and moves the cursor up one view
CUSTOM_COMMAND_SIG(page_down) CUSTOM_COMMAND_SIG(page_down)
CUSTOM_DOC("Scrolls the view down one view height and moves the cursor down one view height.") CUSTOM_DOC("Scrolls the view down one view height and moves the cursor down one view height.")
{ {
uint32_t access = AccessProtected; u32 access = AccessProtected;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
float page_jump = get_page_jump(&view); float page_jump = get_page_jump(&view);
move_vertical(app, page_jump); move_vertical(app, page_jump);
@ -358,9 +358,9 @@ CUSTOM_DOC("Scrolls the view down one view height and moves the cursor down one
CUSTOM_COMMAND_SIG(move_left) CUSTOM_COMMAND_SIG(move_left)
CUSTOM_DOC("Moves the cursor one character to the left.") CUSTOM_DOC("Moves the cursor one character to the left.")
{ {
uint32_t access = AccessProtected; u32 access = AccessProtected;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
int32_t new_pos = view.cursor.character_pos - 1; i32 new_pos = view.cursor.character_pos - 1;
view_set_cursor(app, &view, seek_character_pos(new_pos), 1); view_set_cursor(app, &view, seek_character_pos(new_pos), 1);
no_mark_snap_to_cursor_if_shift(app, view.view_id); no_mark_snap_to_cursor_if_shift(app, view.view_id);
} }
@ -368,9 +368,9 @@ CUSTOM_DOC("Moves the cursor one character to the left.")
CUSTOM_COMMAND_SIG(move_right) CUSTOM_COMMAND_SIG(move_right)
CUSTOM_DOC("Moves the cursor one character to the right.") CUSTOM_DOC("Moves the cursor one character to the right.")
{ {
uint32_t access = AccessProtected; u32 access = AccessProtected;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
int32_t new_pos = view.cursor.character_pos + 1; i32 new_pos = view.cursor.character_pos + 1;
view_set_cursor(app, &view, seek_character_pos(new_pos), 1); view_set_cursor(app, &view, seek_character_pos(new_pos), 1);
no_mark_snap_to_cursor_if_shift(app, view.view_id); no_mark_snap_to_cursor_if_shift(app, view.view_id);
} }
@ -394,12 +394,12 @@ CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen);
Range range = get_view_range(&view); Range range = get_view_range(&view);
int32_t size = range.max - range.min; i32 size = range.max - range.min;
if (size <= app->memory_size){ if (size <= app->memory_size){
char *mem = (char*)app->memory; char *mem = (char*)app->memory;
buffer_read_range(app, &buffer, range.min, range.max, mem); buffer_read_range(app, &buffer, range.min, range.max, mem);
for (int32_t i = 0; i < size; ++i){ for (i32 i = 0; i < size; ++i){
mem[i] = char_to_upper(mem[i]); mem[i] = char_to_upper(mem[i]);
} }
buffer_replace_range(app, &buffer, range.min, range.max, mem, size); buffer_replace_range(app, &buffer, range.min, range.max, mem, size);
@ -414,12 +414,12 @@ CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen);
Range range = get_view_range(&view); Range range = get_view_range(&view);
int32_t size = range.max - range.min; i32 size = range.max - range.min;
if (size <= app->memory_size){ if (size <= app->memory_size){
char *mem = (char*)app->memory; char *mem = (char*)app->memory;
buffer_read_range(app, &buffer, range.min, range.max, mem); buffer_read_range(app, &buffer, range.min, range.max, mem);
for (int32_t i = 0; i < size; ++i){ for (i32 i = 0; i < size; ++i){
mem[i] = char_to_lower(mem[i]); mem[i] = char_to_lower(mem[i]);
} }
buffer_replace_range(app, &buffer, range.min, range.max, mem, size); buffer_replace_range(app, &buffer, range.min, range.max, mem, size);
@ -436,22 +436,22 @@ CUSTOM_DOC("Removes trailing whitespace from all lines in the current buffer.")
View_Summary view = get_active_view(app, AccessOpen); View_Summary view = get_active_view(app, AccessOpen);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen);
int32_t line_count = buffer.line_count; i32 line_count = buffer.line_count;
int32_t edit_max = line_count; i32 edit_max = line_count;
if (edit_max*(int32_t)sizeof(Buffer_Edit) < app->memory_size){ if (edit_max*(i32)sizeof(Buffer_Edit) < app->memory_size){
Buffer_Edit *edits = (Buffer_Edit*)app->memory; Buffer_Edit *edits = (Buffer_Edit*)app->memory;
char data[1024]; char data[1024];
Stream_Chunk chunk = {}; Stream_Chunk chunk = {};
int32_t i = 0; i32 i = 0;
if (init_stream_chunk(&chunk, app, &buffer, i, data, sizeof(data))){ if (init_stream_chunk(&chunk, app, &buffer, i, data, sizeof(data))){
Buffer_Edit *edit = edits; Buffer_Edit *edit = edits;
int32_t buffer_size = buffer.size; i32 buffer_size = buffer.size;
int32_t still_looping = true; i32 still_looping = true;
int32_t last_hard = buffer_size; i32 last_hard = buffer_size;
do{ do{
for (; i < chunk.end; ++i){ for (; i < chunk.end; ++i){
char at_pos = chunk.data[i]; char at_pos = chunk.data[i];
@ -484,7 +484,7 @@ CUSTOM_DOC("Removes trailing whitespace from all lines in the current buffer.")
++edit; ++edit;
} }
int32_t edit_count = (int32_t)(edit - edits); i32 edit_count = (i32)(edit - edits);
buffer_batch_edit(app, &buffer, 0, 0, edits, edit_count, BatchEdit_PreserveTokens); buffer_batch_edit(app, &buffer, 0, 0, edits, edit_count, BatchEdit_PreserveTokens);
} }
} }
@ -567,7 +567,7 @@ CUSTOM_DOC("Increases the current buffer's width for line wrapping.")
View_Summary view = get_active_view(app, AccessProtected); View_Summary view = get_active_view(app, AccessProtected);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected);
int32_t wrap = 0; i32 wrap = 0;
buffer_get_setting(app, &buffer, BufferSetting_WrapPosition, &wrap); buffer_get_setting(app, &buffer, BufferSetting_WrapPosition, &wrap);
buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, wrap + 10); buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, wrap + 10);
} }
@ -578,7 +578,7 @@ CUSTOM_DOC("Decrases the current buffer's width for line wrapping.")
View_Summary view = get_active_view(app, AccessProtected); View_Summary view = get_active_view(app, AccessProtected);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected);
int32_t wrap = 0; i32 wrap = 0;
buffer_get_setting(app, &buffer, BufferSetting_WrapPosition, &wrap); buffer_get_setting(app, &buffer, BufferSetting_WrapPosition, &wrap);
buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, wrap - 10); buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, wrap - 10);
} }
@ -630,7 +630,7 @@ CUSTOM_DOC("Toggles the current buffer's virtual whitespace status.")
View_Summary view = get_active_view(app, AccessProtected); View_Summary view = get_active_view(app, AccessProtected);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected);
int32_t vwhite = 0; i32 vwhite = 0;
buffer_get_setting(app, &buffer, BufferSetting_VirtualWhitespace, &vwhite); buffer_get_setting(app, &buffer, BufferSetting_VirtualWhitespace, &vwhite);
buffer_set_setting(app, &buffer, BufferSetting_VirtualWhitespace, !vwhite); buffer_set_setting(app, &buffer, BufferSetting_VirtualWhitespace, !vwhite);
} }
@ -669,7 +669,7 @@ CUSTOM_DOC("Attempts to close 4coder.")
CUSTOM_COMMAND_SIG(goto_line) CUSTOM_COMMAND_SIG(goto_line)
CUSTOM_DOC("Queries the user for a number, and jumps the cursor to the corresponding line.") CUSTOM_DOC("Queries the user for a number, and jumps the cursor to the corresponding line.")
{ {
uint32_t access = AccessProtected; u32 access = AccessProtected;
Query_Bar bar = {}; Query_Bar bar = {};
char string_space[256]; char string_space[256];
@ -678,7 +678,7 @@ CUSTOM_DOC("Queries the user for a number, and jumps the cursor to the correspon
bar.string = make_fixed_width_string(string_space); bar.string = make_fixed_width_string(string_space);
if (query_user_number(app, &bar)){ if (query_user_number(app, &bar)){
int32_t line_number = str_to_int_s(bar.string); i32 line_number = str_to_int_s(bar.string);
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
view_set_cursor(app, &view, seek_line_char(line_number, 0), true); view_set_cursor(app, &view, seek_line_char(line_number, 0), true);
@ -690,7 +690,7 @@ CUSTOM_COMMAND_SIG(reverse_search);
static void static void
isearch__update_highlight(Application_Links *app, View_Summary *view, Managed_Object highlight, isearch__update_highlight(Application_Links *app, View_Summary *view, Managed_Object highlight,
int32_t start, int32_t end){ i32 start, i32 end){
Marker markers[4] = {}; Marker markers[4] = {};
markers[0].pos = start; markers[0].pos = start;
markers[1].pos = end; markers[1].pos = end;
@ -712,14 +712,14 @@ isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_th
} }
b32 reverse = start_reversed; b32 reverse = start_reversed;
int32_t first_pos = view.cursor.pos; i32 first_pos = view.cursor.pos;
int32_t pos = first_pos; i32 pos = first_pos;
if (query_init.size != 0){ if (query_init.size != 0){
pos += 2; pos += 2;
} }
int32_t start_pos = pos; i32 start_pos = pos;
Range match = make_range(pos, pos); Range match = make_range(pos, pos);
char bar_string_space[256]; char bar_string_space[256];
@ -763,7 +763,7 @@ isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_th
if (in.abort) break; if (in.abort) break;
uint8_t character[4]; uint8_t character[4];
uint32_t length = to_writable_character(in, character); u32 length = to_writable_character(in, character);
b32 made_change = false; b32 made_change = false;
if (in.key.keycode == '\n' || in.key.keycode == '\t'){ if (in.key.keycode == '\n' || in.key.keycode == '\t'){
@ -831,7 +831,7 @@ isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_th
if (!backspace){ if (!backspace){
if (reverse){ if (reverse){
int32_t new_pos = 0; i32 new_pos = 0;
buffer_seek_string_insensitive_backward(app, &buffer, start_pos - 1, 0, bar.string.str, bar.string.size, &new_pos); buffer_seek_string_insensitive_backward(app, &buffer, start_pos - 1, 0, bar.string.str, bar.string.size, &new_pos);
if (new_pos >= 0){ if (new_pos >= 0){
if (step_backward){ if (step_backward){
@ -847,7 +847,7 @@ isearch(Application_Links *app, b32 start_reversed, String query_init, b32 on_th
} }
} }
else{ else{
int32_t new_pos = 0; i32 new_pos = 0;
buffer_seek_string_insensitive_forward(app, &buffer, start_pos + 1, 0, bar.string.str, bar.string.size, &new_pos); buffer_seek_string_insensitive_forward(app, &buffer, start_pos + 1, 0, bar.string.str, bar.string.size, &new_pos);
if (new_pos < buffer.size){ if (new_pos < buffer.size){
if (step_forward){ if (step_forward){
@ -942,14 +942,14 @@ CUSTOM_DOC("Queries the user for two strings, and replaces all occurences of the
String r = replace.string; String r = replace.string;
String w = with.string; String w = with.string;
uint32_t access = AccessOpen; u32 access = AccessOpen;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); Buffer_Summary buffer = get_buffer(app, view.buffer_id, access);
Range range = get_view_range(&view); Range range = get_view_range(&view);
int32_t pos = range.min; i32 pos = range.min;
int32_t new_pos; i32 new_pos;
buffer_seek_string_forward(app, &buffer, pos, 0, r.str, r.size, &new_pos); buffer_seek_string_forward(app, &buffer, pos, 0, r.str, r.size, &new_pos);
global_history_edit_group_begin(app); global_history_edit_group_begin(app);
@ -964,8 +964,8 @@ CUSTOM_DOC("Queries the user for two strings, and replaces all occurences of the
} }
static void static void
query_replace_base(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, int32_t pos, String r, String w){ query_replace_base(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, i32 pos, String r, String w){
int32_t new_pos = 0; i32 new_pos = 0;
buffer_seek_string_forward(app, buffer, pos, 0, r.str, r.size, &new_pos); buffer_seek_string_forward(app, buffer, pos, 0, r.str, r.size, &new_pos);
Managed_Scope view_scope = view_get_managed_scope(app, view->view_id); Managed_Scope view_scope = view_get_managed_scope(app, view->view_id);
@ -1009,7 +1009,7 @@ query_replace_base(Application_Links *app, View_Summary *view, Buffer_Summary *b
} }
static void static void
query_replace_parameter(Application_Links *app, String replace_str, int32_t start_pos, b32 add_replace_query_bar){ query_replace_parameter(Application_Links *app, String replace_str, i32 start_pos, b32 add_replace_query_bar){
Query_Bar replace; Query_Bar replace;
replace.prompt = make_lit_string("Replace: "); replace.prompt = make_lit_string("Replace: ");
replace.string = replace_str; replace.string = replace_str;
@ -1032,7 +1032,7 @@ query_replace_parameter(Application_Links *app, String replace_str, int32_t star
View_Summary view = get_active_view(app, AccessOpen); View_Summary view = get_active_view(app, AccessOpen);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen);
int32_t pos = start_pos; i32 pos = start_pos;
Query_Bar bar; Query_Bar bar;
bar.prompt = make_lit_string("Replace? (y)es, (n)ext, (esc)\n"); bar.prompt = make_lit_string("Replace? (y)es, (n)ext, (esc)\n");
@ -1097,7 +1097,7 @@ CUSTOM_DOC("Queries the user for a string, and incrementally replace every occur
Temp_Memory temp = begin_temp_memory(part); Temp_Memory temp = begin_temp_memory(part);
Range range = get_view_range(&view); Range range = get_view_range(&view);
int32_t replace_length = range.max - range.min; i32 replace_length = range.max - range.min;
if (replace_length != 0){ if (replace_length != 0){
char *replace_space = push_array(part, char, replace_length); char *replace_space = push_array(part, char, replace_length);
if (buffer_read_range(app, &buffer, range.min, range.max, replace_space)){ if (buffer_read_range(app, &buffer, range.min, range.max, replace_space)){
@ -1206,7 +1206,7 @@ CUSTOM_DOC("Queries the user for a file name and saves the contents of the curre
char new_file_name_space[4096]; char new_file_name_space[4096];
String new_file_name = make_fixed_width_string(new_file_name_space); String new_file_name = make_fixed_width_string(new_file_name_space);
int32_t hot_dir_size = directory_get_hot(app, 0, 0); i32 hot_dir_size = directory_get_hot(app, 0, 0);
if (new_file_name.size + hot_dir_size <= new_file_name.memory_size){ if (new_file_name.size + hot_dir_size <= new_file_name.memory_size){
new_file_name.size += directory_get_hot(app, new_file_name.str + new_file_name.size, new_file_name.memory_size - new_file_name.size); new_file_name.size += directory_get_hot(app, new_file_name.str + new_file_name.size, new_file_name.memory_size - new_file_name.size);
//append(&new_file_name, "/"); //append(&new_file_name, "/");
@ -1272,7 +1272,7 @@ CUSTOM_COMMAND_SIG(make_directory_query)
CUSTOM_DOC("Queries the user for a name and creates a new directory with the given name.") CUSTOM_DOC("Queries the user for a name and creates a new directory with the given name.")
{ {
char hot_space[2048]; char hot_space[2048];
int32_t hot_length = directory_get_hot(app, hot_space, sizeof(hot_space)); i32 hot_length = directory_get_hot(app, hot_space, sizeof(hot_space));
if (hot_length < sizeof(hot_space)){ if (hot_length < sizeof(hot_space)){
String hot = make_string(hot_space, hot_length); String hot = make_string(hot_space, hot_length);
@ -1319,28 +1319,28 @@ CUSTOM_DOC("Swaps the line under the cursor with the line above it, and moves th
Full_Cursor this_line_cursor = {}; Full_Cursor this_line_cursor = {};
Full_Cursor next_line_cursor = {}; Full_Cursor next_line_cursor = {};
int32_t this_line = view.cursor.line; i32 this_line = view.cursor.line;
int32_t prev_line = this_line - 1; i32 prev_line = this_line - 1;
int32_t next_line = this_line +1; i32 next_line = this_line +1;
if (view_compute_cursor(app, &view, seek_line_char(prev_line, 1), &prev_line_cursor) && if (view_compute_cursor(app, &view, seek_line_char(prev_line, 1), &prev_line_cursor) &&
view_compute_cursor(app, &view, seek_line_char(this_line, 1), &this_line_cursor) && view_compute_cursor(app, &view, seek_line_char(this_line, 1), &this_line_cursor) &&
view_compute_cursor(app, &view, seek_line_char(next_line, 1), &next_line_cursor)){ view_compute_cursor(app, &view, seek_line_char(next_line, 1), &next_line_cursor)){
int32_t prev_line_pos = prev_line_cursor.pos; i32 prev_line_pos = prev_line_cursor.pos;
int32_t this_line_pos = this_line_cursor.pos; i32 this_line_pos = this_line_cursor.pos;
int32_t next_line_pos = next_line_cursor.pos; i32 next_line_pos = next_line_cursor.pos;
Partition *part = &global_part; Partition *part = &global_part;
Temp_Memory temp = begin_temp_memory(part); Temp_Memory temp = begin_temp_memory(part);
int32_t length = next_line_pos - prev_line_pos; i32 length = next_line_pos - prev_line_pos;
char *swap = push_array(part, char, length + 1); char *swap = push_array(part, char, length + 1);
int32_t first_len = next_line_pos - this_line_pos; i32 first_len = next_line_pos - this_line_pos;
if (buffer_read_range(app, &buffer, this_line_pos, next_line_pos, swap)){ if (buffer_read_range(app, &buffer, this_line_pos, next_line_pos, swap)){
b32 second_line_didnt_have_newline = true; b32 second_line_didnt_have_newline = true;
for (int32_t i = first_len - 1; i >= 0; --i){ for (i32 i = first_len - 1; i >= 0; --i){
if (swap[i] == '\n'){ if (swap[i] == '\n'){
second_line_didnt_have_newline = false; second_line_didnt_have_newline = false;
break; break;
@ -1377,7 +1377,7 @@ CUSTOM_DOC("Swaps the line under the cursor with the line below it, and moves th
return; return;
} }
int32_t next_line = view.cursor.line + 1; i32 next_line = view.cursor.line + 1;
Full_Cursor new_cursor = {}; Full_Cursor new_cursor = {};
if (view_compute_cursor(app, &view, seek_line_char(next_line, 1), &new_cursor)){ if (view_compute_cursor(app, &view, seek_line_char(next_line, 1), &new_cursor)){
if (new_cursor.line == next_line){ if (new_cursor.line == next_line){
@ -1404,7 +1404,7 @@ CUSTOM_DOC("Create a copy of the line on which the cursor sits.")
line_string.str = before_line; line_string.str = before_line;
line_string.size += 1; line_string.size += 1;
int32_t pos = buffer_get_line_end(app, &buffer, view.cursor.line); i32 pos = buffer_get_line_end(app, &buffer, view.cursor.line);
buffer_replace_range(app, &buffer, pos, pos, line_string.str, line_string.size); buffer_replace_range(app, &buffer, pos, pos, line_string.str, line_string.size);
} }
end_temp_memory(temp); end_temp_memory(temp);
@ -1419,8 +1419,8 @@ CUSTOM_DOC("Delete the line the on which the cursor sits.")
Partition *part = &global_part; Partition *part = &global_part;
Temp_Memory temp = begin_temp_memory(part); Temp_Memory temp = begin_temp_memory(part);
int32_t start = buffer_get_line_start(app, &buffer, view.cursor.line); i32 start = buffer_get_line_start(app, &buffer, view.cursor.line);
int32_t end = buffer_get_line_end(app, &buffer, view.cursor.line) + 1; i32 end = buffer_get_line_end(app, &buffer, view.cursor.line) + 1;
if (end > buffer.size){ if (end > buffer.size){
end = buffer.size; end = buffer.size;
} }
@ -1449,7 +1449,7 @@ get_cpp_matching_file(Application_Links *app, Buffer_Summary buffer, Buffer_Summ
String extension = file_extension(file_name); String extension = file_extension(file_name);
String new_extensions[2] = {}; String new_extensions[2] = {};
int32_t new_extensions_count = 0; i32 new_extensions_count = 0;
if (match(extension, "cpp") || match(extension, "cc")){ if (match(extension, "cpp") || match(extension, "cc")){
new_extensions[0] = make_lit_string("h"); new_extensions[0] = make_lit_string("h");
@ -1471,8 +1471,8 @@ get_cpp_matching_file(Application_Links *app, Buffer_Summary buffer, Buffer_Summ
} }
remove_extension(&file_name); remove_extension(&file_name);
int32_t base_pos = file_name.size; i32 base_pos = file_name.size;
for (int32_t i = 0; i < new_extensions_count; ++i){ for (i32 i = 0; i < new_extensions_count; ++i){
String ext = new_extensions[i]; String ext = new_extensions[i];
file_name.size = base_pos; file_name.size = base_pos;
append(&file_name, ext); append(&file_name, ext);
@ -1497,14 +1497,14 @@ CUSTOM_DOC("Reads a filename from surrounding '\"' characters and attempts to op
char file_name_[256]; char file_name_[256];
String file_name = make_fixed_width_string(file_name_); String file_name = make_fixed_width_string(file_name_);
int32_t pos = view.cursor.pos; i32 pos = view.cursor.pos;
int32_t start = 0; i32 start = 0;
int32_t end = 0; i32 end = 0;
buffer_seek_delimiter_forward(app, &buffer, pos, '"', &end); buffer_seek_delimiter_forward(app, &buffer, pos, '"', &end);
buffer_seek_delimiter_backward(app, &buffer, pos, '"', &start); buffer_seek_delimiter_backward(app, &buffer, pos, '"', &start);
++start; ++start;
int32_t size = end - start; i32 size = end - start;
char short_file_name[128]; char short_file_name[128];
if (size < sizeof(short_file_name)){ if (size < sizeof(short_file_name)){
@ -1541,7 +1541,7 @@ CUSTOM_COMMAND_SIG(view_buffer_other_panel)
CUSTOM_DOC("Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.") CUSTOM_DOC("Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.")
{ {
View_Summary view = get_active_view(app, AccessAll); View_Summary view = get_active_view(app, AccessAll);
int32_t buffer_id = view.buffer_id; i32 buffer_id = view.buffer_id;
change_active_panel(app); change_active_panel(app);
view = get_active_view(app, AccessAll); view = get_active_view(app, AccessAll);
view_set_buffer(app, &view, buffer_id, 0); view_set_buffer(app, &view, buffer_id, 0);
@ -1555,8 +1555,8 @@ CUSTOM_DOC("Set the other non-active panel to view the buffer that the active pa
View_Summary view2 = get_active_view(app, AccessAll); View_Summary view2 = get_active_view(app, AccessAll);
if (view1.view_id != view2.view_id){ if (view1.view_id != view2.view_id){
int32_t buffer_id1 = view1.buffer_id; i32 buffer_id1 = view1.buffer_id;
int32_t buffer_id2 = view2.buffer_id; i32 buffer_id2 = view2.buffer_id;
if (buffer_id1 != buffer_id2){ if (buffer_id1 != buffer_id2){
view_set_buffer(app, &view1, buffer_id2, 0); view_set_buffer(app, &view1, buffer_id2, 0);
view_set_buffer(app, &view2, buffer_id1, 0); view_set_buffer(app, &view2, buffer_id1, 0);
@ -1635,10 +1635,10 @@ CUSTOM_COMMAND_SIG(undo)
CUSTOM_DOC("Advances backward through the undo history in the buffer containing the most recent regular edit.") CUSTOM_DOC("Advances backward through the undo history in the buffer containing the most recent regular edit.")
{ {
Partition *scratch = &global_part; Partition *scratch = &global_part;
int32_t highest_edit_number = -1; i32 highest_edit_number = -1;
Buffer_ID first_buffer_match = 0; Buffer_ID first_buffer_match = 0;
Buffer_ID last_buffer_match = 0; Buffer_ID last_buffer_match = 0;
int32_t match_count = 0; i32 match_count = 0;
for (Buffer_Summary buffer = get_buffer_first(app, AccessAll); for (Buffer_Summary buffer = get_buffer_first(app, AccessAll);
buffer.exists; buffer.exists;
@ -1707,10 +1707,10 @@ CUSTOM_COMMAND_SIG(redo)
CUSTOM_DOC("Advances forward through the undo history in the buffer containing the most recent regular edit.") CUSTOM_DOC("Advances forward through the undo history in the buffer containing the most recent regular edit.")
{ {
Partition *scratch = &global_part; Partition *scratch = &global_part;
int32_t lowest_edit_number = 0x7FFFFFFF; i32 lowest_edit_number = 0x7FFFFFFF;
Buffer_ID first_buffer_match = 0; Buffer_ID first_buffer_match = 0;
Buffer_ID last_buffer_match = 0; Buffer_ID last_buffer_match = 0;
int32_t match_count = 0; i32 match_count = 0;
for (Buffer_Summary buffer = get_buffer_first(app, AccessAll); for (Buffer_Summary buffer = get_buffer_first(app, AccessAll);
buffer.exists; buffer.exists;
@ -1792,8 +1792,8 @@ CUSTOM_DOC("Loads all the theme files in the theme folder, replacing duplicates
Temp_Memory temp = begin_temp_memory(scratch); Temp_Memory temp = begin_temp_memory(scratch);
load_folder_of_themes_into_live_set(app, scratch, "themes"); load_folder_of_themes_into_live_set(app, scratch, "themes");
String name = get_theme_name(app, scratch, 0); String name = get_theme_name(app, scratch, 0);
int32_t theme_count = get_theme_count(app); i32 theme_count = get_theme_count(app);
for (int32_t i = 1; i < theme_count; i += 1){ for (i32 i = 1; i < theme_count; i += 1){
Temp_Memory sub_temp = begin_temp_memory(scratch); Temp_Memory sub_temp = begin_temp_memory(scratch);
String style_name = get_theme_name(app, scratch, i); String style_name = get_theme_name(app, scratch, i);
if (match(name, style_name)){ if (match(name, style_name)){

View File

@ -12,7 +12,7 @@ write_string(Application_Links *app, View_Summary *view, Buffer_Summary *buffer,
static void static void
write_string(Application_Links *app, String string){ write_string(Application_Links *app, String string){
uint32_t access = AccessOpen; u32 access = AccessOpen;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); Buffer_Summary buffer = get_buffer(app, view.buffer_id, access);
write_string(app, &view, &buffer, string); write_string(app, &view, &buffer, string);
@ -41,10 +41,10 @@ write_named_comment_string(Application_Links *app, char *type_string){
} }
static void static void
long_braces(Application_Links *app, char *text, int32_t size){ long_braces(Application_Links *app, char *text, i32 size){
View_Summary view = get_active_view(app, AccessOpen); View_Summary view = get_active_view(app, AccessOpen);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen);
int32_t pos = view.cursor.pos; i32 pos = view.cursor.pos;
buffer_replace_range(app, &buffer, pos, pos, text, size); buffer_replace_range(app, &buffer, pos, pos, text, size);
view_set_cursor(app, &view, seek_pos(pos + 2), true); view_set_cursor(app, &view, seek_pos(pos + 2), true);
@ -56,7 +56,7 @@ CUSTOM_COMMAND_SIG(open_long_braces)
CUSTOM_DOC("At the cursor, insert a '{' and '}' separated by a blank line.") CUSTOM_DOC("At the cursor, insert a '{' and '}' separated by a blank line.")
{ {
char text[] = "{\n\n}"; char text[] = "{\n\n}";
int32_t size = sizeof(text) - 1; i32 size = sizeof(text) - 1;
long_braces(app, text, size); long_braces(app, text, size);
} }
@ -64,7 +64,7 @@ CUSTOM_COMMAND_SIG(open_long_braces_semicolon)
CUSTOM_DOC("At the cursor, insert a '{' and '};' separated by a blank line.") CUSTOM_DOC("At the cursor, insert a '{' and '};' separated by a blank line.")
{ {
char text[] = "{\n\n};"; char text[] = "{\n\n};";
int32_t size = sizeof(text) - 1; i32 size = sizeof(text) - 1;
long_braces(app, text, size); long_braces(app, text, size);
} }
@ -72,7 +72,7 @@ CUSTOM_COMMAND_SIG(open_long_braces_break)
CUSTOM_DOC("At the cursor, insert a '{' and '}break;' separated by a blank line.") CUSTOM_DOC("At the cursor, insert a '{' and '}break;' separated by a blank line.")
{ {
char text[] = "{\n\n}break;"; char text[] = "{\n\n}break;";
int32_t size = sizeof(text) - 1; i32 size = sizeof(text) - 1;
long_braces(app, text, size); long_braces(app, text, size);
} }
@ -112,7 +112,7 @@ CUSTOM_DOC("At the cursor, insert a ' = {};'.")
write_string(app, make_lit_string(" = {};")); write_string(app, make_lit_string(" = {};"));
} }
static int32_t static i32
get_start_of_line_at_cursor(Application_Links *app, View_Summary *view, Buffer_Summary *buffer){ get_start_of_line_at_cursor(Application_Links *app, View_Summary *view, Buffer_Summary *buffer){
Full_Cursor cursor = {}; Full_Cursor cursor = {};
view_compute_cursor(app, view, seek_line_char(view->cursor.line, 1), &cursor); view_compute_cursor(app, view, seek_line_char(view->cursor.line, 1), &cursor);

View File

@ -7,13 +7,13 @@
struct Snippet{ struct Snippet{
char *name; char *name;
char *text; char *text;
int32_t cursor_offset; i32 cursor_offset;
int32_t mark_offset; i32 mark_offset;
}; };
struct Snippet_Array{ struct Snippet_Array{
Snippet *snippets; Snippet *snippets;
int32_t count; i32 count;
}; };
// BOTTOM // BOTTOM

View File

@ -18,9 +18,9 @@ get_code_extensions(Extension_List *list){
static void static void
parse_extension_line_to_extension_list(String str, Extension_List *list){ parse_extension_line_to_extension_list(String str, Extension_List *list){
int32_t mode = 0; i32 mode = 0;
int32_t j = 0, k = 0; i32 j = 0, k = 0;
for (int32_t i = 0; i < str.size; ++i){ for (i32 i = 0; i < str.size; ++i){
switch (mode){ switch (mode){
case 0: case 0:
{ {
@ -198,7 +198,7 @@ config_parser__match_text(Config_Parser *ctx, String text){
} }
static Config *config_parser__config (Config_Parser *ctx); static Config *config_parser__config (Config_Parser *ctx);
static int32_t *config_parser__version (Config_Parser *ctx); static i32 *config_parser__version (Config_Parser *ctx);
static Config_Assignment *config_parser__assignment(Config_Parser *ctx); static Config_Assignment *config_parser__assignment(Config_Parser *ctx);
static Config_LValue *config_parser__lvalue (Config_Parser *ctx); static Config_LValue *config_parser__lvalue (Config_Parser *ctx);
static Config_RValue *config_parser__rvalue (Config_Parser *ctx); static Config_RValue *config_parser__rvalue (Config_Parser *ctx);
@ -262,11 +262,11 @@ config_parser__log_error(Config_Parser *ctx, char *error_text){
static Config* static Config*
config_parser__config(Config_Parser *ctx){ config_parser__config(Config_Parser *ctx){
int32_t *version = config_parser__version(ctx); i32 *version = config_parser__version(ctx);
Config_Assignment *first = 0; Config_Assignment *first = 0;
Config_Assignment *last = 0; Config_Assignment *last = 0;
int32_t count = 0; i32 count = 0;
for (;!config_parser__recognize_token(ctx, CPP_TOKEN_EOF);){ for (;!config_parser__recognize_token(ctx, CPP_TOKEN_EOF);){
Config_Assignment *assignment = config_parser__assignment(ctx); Config_Assignment *assignment = config_parser__assignment(ctx);
if (assignment != 0){ if (assignment != 0){
@ -300,7 +300,7 @@ config_parser__recover_parse(Config_Parser *ctx){
} }
} }
static int32_t* static i32*
config_parser__version(Config_Parser *ctx){ config_parser__version(Config_Parser *ctx){
require(config_parser__match_text(ctx, make_lit_string("version"))); require(config_parser__match_text(ctx, make_lit_string("version")));
@ -331,7 +331,7 @@ config_parser__version(Config_Parser *ctx){
return(0); return(0);
} }
int32_t *ptr = push_array(ctx->arena, int32_t, 1); i32 *ptr = push_array(ctx->arena, i32, 1);
*ptr = value.integer; *ptr = value.integer;
return(ptr); return(ptr);
} }
@ -385,7 +385,7 @@ config_parser__lvalue(Config_Parser *ctx){
String identifier = config_parser__get_lexeme(ctx); String identifier = config_parser__get_lexeme(ctx);
config_parser__advance_to_next(ctx); config_parser__advance_to_next(ctx);
int32_t index = 0; i32 index = 0;
if (config_parser__match_token(ctx, CPP_TOKEN_BRACKET_OPEN)){ if (config_parser__match_token(ctx, CPP_TOKEN_BRACKET_OPEN)){
require(config_parser__recognize_token(ctx, CPP_TOKEN_INTEGER_CONSTANT)); require(config_parser__recognize_token(ctx, CPP_TOKEN_INTEGER_CONSTANT));
Config_Integer value = config_parser__get_int(ctx); Config_Integer value = config_parser__get_int(ctx);
@ -494,7 +494,7 @@ static Config_Compound*
config_parser__compound(Config_Parser *ctx){ config_parser__compound(Config_Parser *ctx){
Config_Compound_Element *first = 0; Config_Compound_Element *first = 0;
Config_Compound_Element *last = 0; Config_Compound_Element *last = 0;
int32_t count = 0; i32 count = 0;
Config_Compound_Element *element = config_parser__element(ctx); Config_Compound_Element *element = config_parser__element(ctx);
require(element != 0); require(element != 0);
@ -562,7 +562,7 @@ config_add_error(Partition *arena, Config *config, char *pos, char *error_text){
//////////////////////////////// ////////////////////////////////
static Config_Assignment* static Config_Assignment*
config_lookup_assignment(Config *config, String var_name, int32_t subscript){ config_lookup_assignment(Config *config, String var_name, i32 subscript){
Config_Assignment *assignment; Config_Assignment *assignment;
for (assignment = config->first; for (assignment = config->first;
assignment != 0; assignment != 0;
@ -576,7 +576,7 @@ config_lookup_assignment(Config *config, String var_name, int32_t subscript){
} }
static Config_Get_Result static Config_Get_Result
config_var(Config *config, String var_name, int32_t subscript); config_var(Config *config, String var_name, i32 subscript);
static Config_Get_Result static Config_Get_Result
config_evaluate_rvalue(Config *config, Config_Assignment *assignment, Config_RValue *r){ config_evaluate_rvalue(Config *config, Config_Assignment *assignment, Config_RValue *r){
@ -624,7 +624,7 @@ config_evaluate_rvalue(Config *config, Config_Assignment *assignment, Config_RVa
} }
static Config_Get_Result static Config_Get_Result
config_var(Config *config, String var_name, int32_t subscript){ config_var(Config *config, String var_name, i32 subscript){
Config_Get_Result result = {}; Config_Get_Result result = {};
Config_Assignment *assignment = config_lookup_assignment(config, var_name, subscript); Config_Assignment *assignment = config_lookup_assignment(config, var_name, subscript);
if (assignment != 0){ if (assignment != 0){
@ -634,9 +634,9 @@ config_var(Config *config, String var_name, int32_t subscript){
} }
static Config_Get_Result static Config_Get_Result
config_compound_member(Config *config, Config_Compound *compound, String var_name, int32_t index){ config_compound_member(Config *config, Config_Compound *compound, String var_name, i32 index){
Config_Get_Result result = {}; Config_Get_Result result = {};
int32_t implicit_index = 0; i32 implicit_index = 0;
b32 implicit_index_is_valid = true; b32 implicit_index_is_valid = true;
for (Config_Compound_Element *element = compound->first; for (Config_Compound_Element *element = compound->first;
element != 0; element != 0;
@ -677,9 +677,9 @@ config_compound_member(Config *config, Config_Compound *compound, String var_nam
} }
static Config_Iteration_Step_Result static Config_Iteration_Step_Result
typed_array_iteration_step(Config *parsed, Config_Compound *compound, Config_RValue_Type type, int32_t index); typed_array_iteration_step(Config *parsed, Config_Compound *compound, Config_RValue_Type type, i32 index);
static int32_t static i32
typed_array_get_count(Config *parsed, Config_Compound *compound, Config_RValue_Type type); typed_array_get_count(Config *parsed, Config_Compound *compound, Config_RValue_Type type);
static Config_Get_Result_List static Config_Get_Result_List
@ -690,14 +690,14 @@ typed_array_reference_list(Partition *arena, Config *parsed, Config_Compound *co
//////////////////////////////// ////////////////////////////////
static b32 static b32
config_has_var(Config *config, String var_name, int32_t subscript){ config_has_var(Config *config, String var_name, i32 subscript){
Config_Get_Result result = config_var(config, var_name, subscript); Config_Get_Result result = config_var(config, var_name, subscript);
b32 success = result.success && result.type == ConfigRValueType_NoType; b32 success = result.success && result.type == ConfigRValueType_NoType;
return(success); return(success);
} }
static b32 static b32
config_has_var(Config *config, char *var_name, int32_t subscript){ config_has_var(Config *config, char *var_name, i32 subscript){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_var(config, var_name_str, subscript); Config_Get_Result result = config_var(config, var_name_str, subscript);
b32 success = result.success && result.type == ConfigRValueType_NoType; b32 success = result.success && result.type == ConfigRValueType_NoType;
@ -705,7 +705,7 @@ config_has_var(Config *config, char *var_name, int32_t subscript){
} }
static b32 static b32
config_bool_var(Config *config, String var_name, int32_t subscript, b32* var_out){ config_bool_var(Config *config, String var_name, i32 subscript, b32* var_out){
Config_Get_Result result = config_var(config, var_name, subscript); Config_Get_Result result = config_var(config, var_name, subscript);
b32 success = result.success && result.type == ConfigRValueType_Boolean; b32 success = result.success && result.type == ConfigRValueType_Boolean;
if (success){ if (success){
@ -715,7 +715,7 @@ config_bool_var(Config *config, String var_name, int32_t subscript, b32* var_out
} }
static b32 static b32
config_bool_var(Config *config, char *var_name, int32_t subscript, b32* var_out){ config_bool_var(Config *config, char *var_name, i32 subscript, b32* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_var(config, var_name_str, subscript); Config_Get_Result result = config_var(config, var_name_str, subscript);
b32 success = result.success && result.type == ConfigRValueType_Boolean; b32 success = result.success && result.type == ConfigRValueType_Boolean;
@ -726,7 +726,7 @@ config_bool_var(Config *config, char *var_name, int32_t subscript, b32* var_out)
} }
static b32 static b32
config_int_var(Config *config, String var_name, int32_t subscript, int32_t* var_out){ config_int_var(Config *config, String var_name, i32 subscript, i32* var_out){
Config_Get_Result result = config_var(config, var_name, subscript); Config_Get_Result result = config_var(config, var_name, subscript);
b32 success = result.success && result.type == ConfigRValueType_Integer; b32 success = result.success && result.type == ConfigRValueType_Integer;
if (success){ if (success){
@ -736,7 +736,7 @@ config_int_var(Config *config, String var_name, int32_t subscript, int32_t* var_
} }
static b32 static b32
config_int_var(Config *config, char *var_name, int32_t subscript, int32_t* var_out){ config_int_var(Config *config, char *var_name, i32 subscript, i32* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_var(config, var_name_str, subscript); Config_Get_Result result = config_var(config, var_name_str, subscript);
b32 success = result.success && result.type == ConfigRValueType_Integer; b32 success = result.success && result.type == ConfigRValueType_Integer;
@ -747,7 +747,7 @@ config_int_var(Config *config, char *var_name, int32_t subscript, int32_t* var_o
} }
static b32 static b32
config_uint_var(Config *config, String var_name, int32_t subscript, uint32_t* var_out){ config_uint_var(Config *config, String var_name, i32 subscript, u32* var_out){
Config_Get_Result result = config_var(config, var_name, subscript); Config_Get_Result result = config_var(config, var_name, subscript);
b32 success = result.success && result.type == ConfigRValueType_Integer; b32 success = result.success && result.type == ConfigRValueType_Integer;
if (success){ if (success){
@ -757,7 +757,7 @@ config_uint_var(Config *config, String var_name, int32_t subscript, uint32_t* va
} }
static b32 static b32
config_uint_var(Config *config, char *var_name, int32_t subscript, uint32_t* var_out){ config_uint_var(Config *config, char *var_name, i32 subscript, u32* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_var(config, var_name_str, subscript); Config_Get_Result result = config_var(config, var_name_str, subscript);
b32 success = result.success && result.type == ConfigRValueType_Integer; b32 success = result.success && result.type == ConfigRValueType_Integer;
@ -768,7 +768,7 @@ config_uint_var(Config *config, char *var_name, int32_t subscript, uint32_t* var
} }
static b32 static b32
config_string_var(Config *config, String var_name, int32_t subscript, String* var_out){ config_string_var(Config *config, String var_name, i32 subscript, String* var_out){
Config_Get_Result result = config_var(config, var_name, subscript); Config_Get_Result result = config_var(config, var_name, subscript);
b32 success = result.success && result.type == ConfigRValueType_String; b32 success = result.success && result.type == ConfigRValueType_String;
if (success){ if (success){
@ -778,7 +778,7 @@ config_string_var(Config *config, String var_name, int32_t subscript, String* va
} }
static b32 static b32
config_string_var(Config *config, char *var_name, int32_t subscript, String* var_out){ config_string_var(Config *config, char *var_name, i32 subscript, String* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_var(config, var_name_str, subscript); Config_Get_Result result = config_var(config, var_name_str, subscript);
b32 success = result.success && result.type == ConfigRValueType_String; b32 success = result.success && result.type == ConfigRValueType_String;
@ -789,7 +789,7 @@ config_string_var(Config *config, char *var_name, int32_t subscript, String* var
} }
static b32 static b32
config_placed_string_var(Config *config, String var_name, int32_t subscript, String* var_out, char *space, int32_t space_size){ config_placed_string_var(Config *config, String var_name, i32 subscript, String* var_out, char *space, i32 space_size){
Config_Get_Result result = config_var(config, var_name, subscript); Config_Get_Result result = config_var(config, var_name, subscript);
b32 success = result.success && result.type == ConfigRValueType_String; b32 success = result.success && result.type == ConfigRValueType_String;
if (success){ if (success){
@ -804,7 +804,7 @@ config_placed_string_var(Config *config, String var_name, int32_t subscript, Str
} }
static b32 static b32
config_placed_string_var(Config *config, char *var_name, int32_t subscript, String* var_out, char *space, int32_t space_size){ config_placed_string_var(Config *config, char *var_name, i32 subscript, String* var_out, char *space, i32 space_size){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_var(config, var_name_str, subscript); Config_Get_Result result = config_var(config, var_name_str, subscript);
b32 success = result.success && result.type == ConfigRValueType_String; b32 success = result.success && result.type == ConfigRValueType_String;
@ -820,7 +820,7 @@ config_placed_string_var(Config *config, char *var_name, int32_t subscript, Stri
} }
static b32 static b32
config_char_var(Config *config, String var_name, int32_t subscript, char* var_out){ config_char_var(Config *config, String var_name, i32 subscript, char* var_out){
Config_Get_Result result = config_var(config, var_name, subscript); Config_Get_Result result = config_var(config, var_name, subscript);
b32 success = result.success && result.type == ConfigRValueType_Character; b32 success = result.success && result.type == ConfigRValueType_Character;
if (success){ if (success){
@ -830,7 +830,7 @@ config_char_var(Config *config, String var_name, int32_t subscript, char* var_ou
} }
static b32 static b32
config_char_var(Config *config, char *var_name, int32_t subscript, char* var_out){ config_char_var(Config *config, char *var_name, i32 subscript, char* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_var(config, var_name_str, subscript); Config_Get_Result result = config_var(config, var_name_str, subscript);
b32 success = result.success && result.type == ConfigRValueType_Character; b32 success = result.success && result.type == ConfigRValueType_Character;
@ -841,7 +841,7 @@ config_char_var(Config *config, char *var_name, int32_t subscript, char* var_out
} }
static b32 static b32
config_compound_var(Config *config, String var_name, int32_t subscript, Config_Compound** var_out){ config_compound_var(Config *config, String var_name, i32 subscript, Config_Compound** var_out){
Config_Get_Result result = config_var(config, var_name, subscript); Config_Get_Result result = config_var(config, var_name, subscript);
b32 success = result.success && result.type == ConfigRValueType_Compound; b32 success = result.success && result.type == ConfigRValueType_Compound;
if (success){ if (success){
@ -851,7 +851,7 @@ config_compound_var(Config *config, String var_name, int32_t subscript, Config_C
} }
static b32 static b32
config_compound_var(Config *config, char *var_name, int32_t subscript, Config_Compound** var_out){ config_compound_var(Config *config, char *var_name, i32 subscript, Config_Compound** var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_var(config, var_name_str, subscript); Config_Get_Result result = config_var(config, var_name_str, subscript);
b32 success = result.success && result.type == ConfigRValueType_Compound; b32 success = result.success && result.type == ConfigRValueType_Compound;
@ -863,7 +863,7 @@ config_compound_var(Config *config, char *var_name, int32_t subscript, Config_Co
static b32 static b32
config_compound_has_member(Config *config, Config_Compound *compound, config_compound_has_member(Config *config, Config_Compound *compound,
String var_name, int32_t index){ String var_name, i32 index){
Config_Get_Result result = config_compound_member(config, compound, var_name, index); Config_Get_Result result = config_compound_member(config, compound, var_name, index);
b32 success = result.success && result.type == ConfigRValueType_NoType; b32 success = result.success && result.type == ConfigRValueType_NoType;
return(success); return(success);
@ -871,7 +871,7 @@ config_compound_has_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_has_member(Config *config, Config_Compound *compound, config_compound_has_member(Config *config, Config_Compound *compound,
char *var_name, int32_t index){ char *var_name, i32 index){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);
b32 success = result.success && result.type == ConfigRValueType_NoType; b32 success = result.success && result.type == ConfigRValueType_NoType;
@ -880,7 +880,7 @@ config_compound_has_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_bool_member(Config *config, Config_Compound *compound, config_compound_bool_member(Config *config, Config_Compound *compound,
String var_name, int32_t index, b32* var_out){ String var_name, i32 index, b32* var_out){
Config_Get_Result result = config_compound_member(config, compound, var_name, index); Config_Get_Result result = config_compound_member(config, compound, var_name, index);
b32 success = result.success && result.type == ConfigRValueType_Boolean; b32 success = result.success && result.type == ConfigRValueType_Boolean;
if (success){ if (success){
@ -891,7 +891,7 @@ config_compound_bool_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_bool_member(Config *config, Config_Compound *compound, config_compound_bool_member(Config *config, Config_Compound *compound,
char *var_name, int32_t index, b32* var_out){ char *var_name, i32 index, b32* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);
b32 success = result.success && result.type == ConfigRValueType_Boolean; b32 success = result.success && result.type == ConfigRValueType_Boolean;
@ -903,7 +903,7 @@ config_compound_bool_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_int_member(Config *config, Config_Compound *compound, config_compound_int_member(Config *config, Config_Compound *compound,
String var_name, int32_t index, int32_t* var_out){ String var_name, i32 index, i32* var_out){
Config_Get_Result result = config_compound_member(config, compound, var_name, index); Config_Get_Result result = config_compound_member(config, compound, var_name, index);
b32 success = result.success && result.type == ConfigRValueType_Integer; b32 success = result.success && result.type == ConfigRValueType_Integer;
if (success){ if (success){
@ -914,7 +914,7 @@ config_compound_int_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_int_member(Config *config, Config_Compound *compound, config_compound_int_member(Config *config, Config_Compound *compound,
char *var_name, int32_t index, int32_t* var_out){ char *var_name, i32 index, i32* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);
b32 success = result.success && result.type == ConfigRValueType_Integer; b32 success = result.success && result.type == ConfigRValueType_Integer;
@ -926,7 +926,7 @@ config_compound_int_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_uint_member(Config *config, Config_Compound *compound, config_compound_uint_member(Config *config, Config_Compound *compound,
String var_name, int32_t index, uint32_t* var_out){ String var_name, i32 index, u32* var_out){
Config_Get_Result result = config_compound_member(config, compound, var_name, index); Config_Get_Result result = config_compound_member(config, compound, var_name, index);
b32 success = result.success && result.type == ConfigRValueType_Integer; b32 success = result.success && result.type == ConfigRValueType_Integer;
if (success){ if (success){
@ -937,7 +937,7 @@ config_compound_uint_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_uint_member(Config *config, Config_Compound *compound, config_compound_uint_member(Config *config, Config_Compound *compound,
char *var_name, int32_t index, uint32_t* var_out){ char *var_name, i32 index, u32* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);
b32 success = result.success && result.type == ConfigRValueType_Integer; b32 success = result.success && result.type == ConfigRValueType_Integer;
@ -949,7 +949,7 @@ config_compound_uint_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_string_member(Config *config, Config_Compound *compound, config_compound_string_member(Config *config, Config_Compound *compound,
String var_name, int32_t index, String* var_out){ String var_name, i32 index, String* var_out){
Config_Get_Result result = config_compound_member(config, compound, var_name, index); Config_Get_Result result = config_compound_member(config, compound, var_name, index);
b32 success = result.success && result.type == ConfigRValueType_String; b32 success = result.success && result.type == ConfigRValueType_String;
if (success){ if (success){
@ -960,7 +960,7 @@ config_compound_string_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_string_member(Config *config, Config_Compound *compound, config_compound_string_member(Config *config, Config_Compound *compound,
char *var_name, int32_t index, String* var_out){ char *var_name, i32 index, String* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);
b32 success = result.success && result.type == ConfigRValueType_String; b32 success = result.success && result.type == ConfigRValueType_String;
@ -972,7 +972,7 @@ config_compound_string_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_placed_string_member(Config *config, Config_Compound *compound, config_compound_placed_string_member(Config *config, Config_Compound *compound,
String var_name, int32_t index, String* var_out, char *space, int32_t space_size){ String var_name, i32 index, String* var_out, char *space, i32 space_size){
Config_Get_Result result = config_compound_member(config, compound, var_name, index); Config_Get_Result result = config_compound_member(config, compound, var_name, index);
b32 success = result.success && result.type == ConfigRValueType_String; b32 success = result.success && result.type == ConfigRValueType_String;
if (success){ if (success){
@ -988,7 +988,7 @@ config_compound_placed_string_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_placed_string_member(Config *config, Config_Compound *compound, config_compound_placed_string_member(Config *config, Config_Compound *compound,
char *var_name, int32_t index, String* var_out, char *space, int32_t space_size){ char *var_name, i32 index, String* var_out, char *space, i32 space_size){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);
b32 success = result.success && result.type == ConfigRValueType_String; b32 success = result.success && result.type == ConfigRValueType_String;
@ -1005,7 +1005,7 @@ config_compound_placed_string_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_char_member(Config *config, Config_Compound *compound, config_compound_char_member(Config *config, Config_Compound *compound,
String var_name, int32_t index, char* var_out){ String var_name, i32 index, char* var_out){
Config_Get_Result result = config_compound_member(config, compound, var_name, index); Config_Get_Result result = config_compound_member(config, compound, var_name, index);
b32 success = result.success && result.type == ConfigRValueType_Character; b32 success = result.success && result.type == ConfigRValueType_Character;
if (success){ if (success){
@ -1016,7 +1016,7 @@ config_compound_char_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_char_member(Config *config, Config_Compound *compound, config_compound_char_member(Config *config, Config_Compound *compound,
char *var_name, int32_t index, char* var_out){ char *var_name, i32 index, char* var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);
b32 success = result.success && result.type == ConfigRValueType_Character; b32 success = result.success && result.type == ConfigRValueType_Character;
@ -1028,7 +1028,7 @@ config_compound_char_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_compound_member(Config *config, Config_Compound *compound, config_compound_compound_member(Config *config, Config_Compound *compound,
String var_name, int32_t index, Config_Compound** var_out){ String var_name, i32 index, Config_Compound** var_out){
Config_Get_Result result = config_compound_member(config, compound, var_name, index); Config_Get_Result result = config_compound_member(config, compound, var_name, index);
b32 success = result.success && result.type == ConfigRValueType_Compound; b32 success = result.success && result.type == ConfigRValueType_Compound;
if (success){ if (success){
@ -1039,7 +1039,7 @@ config_compound_compound_member(Config *config, Config_Compound *compound,
static b32 static b32
config_compound_compound_member(Config *config, Config_Compound *compound, config_compound_compound_member(Config *config, Config_Compound *compound,
char *var_name, int32_t index, Config_Compound** var_out){ char *var_name, i32 index, Config_Compound** var_out){
String var_name_str = make_string_slowly(var_name); String var_name_str = make_string_slowly(var_name);
Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);
b32 success = result.success && result.type == ConfigRValueType_Compound; b32 success = result.success && result.type == ConfigRValueType_Compound;
@ -1050,13 +1050,13 @@ config_compound_compound_member(Config *config, Config_Compound *compound,
} }
static Iteration_Step_Result static Iteration_Step_Result
typed_has_array_iteration_step(Config *config, Config_Compound *compound, int32_t index){ typed_has_array_iteration_step(Config *config, Config_Compound *compound, i32 index){
Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_NoType, index); Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_NoType, index);
return(result.step); return(result.step);
} }
static Iteration_Step_Result static Iteration_Step_Result
typed_bool_array_iteration_step(Config *config, Config_Compound *compound, int32_t index, b32* var_out){ typed_bool_array_iteration_step(Config *config, Config_Compound *compound, i32 index, b32* var_out){
Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Boolean, index); Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Boolean, index);
b32 success = (result.step == Iteration_Good); b32 success = (result.step == Iteration_Good);
if (success){ if (success){
@ -1066,7 +1066,7 @@ typed_bool_array_iteration_step(Config *config, Config_Compound *compound, int32
} }
static Iteration_Step_Result static Iteration_Step_Result
typed_int_array_iteration_step(Config *config, Config_Compound *compound, int32_t index, int32_t* var_out){ typed_int_array_iteration_step(Config *config, Config_Compound *compound, i32 index, i32* var_out){
Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Integer, index); Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Integer, index);
b32 success = (result.step == Iteration_Good); b32 success = (result.step == Iteration_Good);
if (success){ if (success){
@ -1076,7 +1076,7 @@ typed_int_array_iteration_step(Config *config, Config_Compound *compound, int32_
} }
static Iteration_Step_Result static Iteration_Step_Result
typed_uint_array_iteration_step(Config *config, Config_Compound *compound, int32_t index, uint32_t* var_out){ typed_uint_array_iteration_step(Config *config, Config_Compound *compound, i32 index, u32* var_out){
Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Integer, index); Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Integer, index);
b32 success = (result.step == Iteration_Good); b32 success = (result.step == Iteration_Good);
if (success){ if (success){
@ -1086,7 +1086,7 @@ typed_uint_array_iteration_step(Config *config, Config_Compound *compound, int32
} }
static Iteration_Step_Result static Iteration_Step_Result
typed_string_array_iteration_step(Config *config, Config_Compound *compound, int32_t index, String* var_out){ typed_string_array_iteration_step(Config *config, Config_Compound *compound, i32 index, String* var_out){
Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_String, index); Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_String, index);
b32 success = (result.step == Iteration_Good); b32 success = (result.step == Iteration_Good);
if (success){ if (success){
@ -1096,8 +1096,8 @@ typed_string_array_iteration_step(Config *config, Config_Compound *compound, int
} }
static Iteration_Step_Result static Iteration_Step_Result
typed_placed_string_array_iteration_step(Config *config, Config_Compound *compound, int32_t index, String* var_out typed_placed_string_array_iteration_step(Config *config, Config_Compound *compound, i32 index, String* var_out
, char *space, int32_t space_size){ , char *space, i32 space_size){
Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_String, index); Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_String, index);
b32 success = (result.step == Iteration_Good); b32 success = (result.step == Iteration_Good);
if (success){ if (success){
@ -1112,7 +1112,7 @@ typed_placed_string_array_iteration_step(Config *config, Config_Compound *compou
} }
static Iteration_Step_Result static Iteration_Step_Result
typed_char_array_iteration_step(Config *config, Config_Compound *compound, int32_t index, char* var_out){ typed_char_array_iteration_step(Config *config, Config_Compound *compound, i32 index, char* var_out){
Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Character, index); Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Character, index);
b32 success = (result.step == Iteration_Good); b32 success = (result.step == Iteration_Good);
if (success){ if (success){
@ -1122,7 +1122,7 @@ typed_char_array_iteration_step(Config *config, Config_Compound *compound, int32
} }
static Iteration_Step_Result static Iteration_Step_Result
typed_compound_array_iteration_step(Config *config, Config_Compound *compound, int32_t index, Config_Compound** var_out){ typed_compound_array_iteration_step(Config *config, Config_Compound *compound, i32 index, Config_Compound** var_out){
Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Compound, index); Config_Iteration_Step_Result result = typed_array_iteration_step(config, compound, ConfigRValueType_Compound, index);
b32 success = (result.step == Iteration_Good); b32 success = (result.step == Iteration_Good);
if (success){ if (success){
@ -1131,45 +1131,45 @@ typed_compound_array_iteration_step(Config *config, Config_Compound *compound, i
return(result.step); return(result.step);
} }
static int32_t static i32
typed_bool_array_get_count(Config *config, Config_Compound *compound){ typed_bool_array_get_count(Config *config, Config_Compound *compound){
int32_t count = typed_array_get_count(config, compound, ConfigRValueType_Boolean); i32 count = typed_array_get_count(config, compound, ConfigRValueType_Boolean);
return(count); return(count);
} }
static int32_t static i32
typed_int_array_get_count(Config *config, Config_Compound *compound){ typed_int_array_get_count(Config *config, Config_Compound *compound){
int32_t count = typed_array_get_count(config, compound, ConfigRValueType_Integer); i32 count = typed_array_get_count(config, compound, ConfigRValueType_Integer);
return(count); return(count);
} }
static int32_t static i32
typed_float_array_get_count(Config *config, Config_Compound *compound){ typed_float_array_get_count(Config *config, Config_Compound *compound){
int32_t count = typed_array_get_count(config, compound, ConfigRValueType_Float); i32 count = typed_array_get_count(config, compound, ConfigRValueType_Float);
return(count); return(count);
} }
static int32_t static i32
typed_string_array_get_count(Config *config, Config_Compound *compound){ typed_string_array_get_count(Config *config, Config_Compound *compound){
int32_t count = typed_array_get_count(config, compound, ConfigRValueType_String); i32 count = typed_array_get_count(config, compound, ConfigRValueType_String);
return(count); return(count);
} }
static int32_t static i32
typed_character_array_get_count(Config *config, Config_Compound *compound){ typed_character_array_get_count(Config *config, Config_Compound *compound){
int32_t count = typed_array_get_count(config, compound, ConfigRValueType_Character); i32 count = typed_array_get_count(config, compound, ConfigRValueType_Character);
return(count); return(count);
} }
static int32_t static i32
typed_compound_array_get_count(Config *config, Config_Compound *compound){ typed_compound_array_get_count(Config *config, Config_Compound *compound){
int32_t count = typed_array_get_count(config, compound, ConfigRValueType_Compound); i32 count = typed_array_get_count(config, compound, ConfigRValueType_Compound);
return(count); return(count);
} }
static int32_t static i32
typed_no_type_array_get_count(Config *config, Config_Compound *compound){ typed_no_type_array_get_count(Config *config, Config_Compound *compound){
int32_t count = typed_array_get_count(config, compound, ConfigRValueType_NoType); i32 count = typed_array_get_count(config, compound, ConfigRValueType_NoType);
return(count); return(count);
} }
@ -1218,7 +1218,7 @@ typed_no_type_array_reference_list(Partition *arena, Config *config, Config_Comp
//////////////////////////////// ////////////////////////////////
static Config_Iteration_Step_Result static Config_Iteration_Step_Result
typed_array_iteration_step(Config *parsed, Config_Compound *compound, Config_RValue_Type type, int32_t index){ typed_array_iteration_step(Config *parsed, Config_Compound *compound, Config_RValue_Type type, i32 index){
Config_Iteration_Step_Result result = {}; Config_Iteration_Step_Result result = {};
result.step = Iteration_Quit; result.step = Iteration_Quit;
Config_Get_Result get_result = config_compound_member(parsed, compound, make_lit_string("~"), index); Config_Get_Result get_result = config_compound_member(parsed, compound, make_lit_string("~"), index);
@ -1234,10 +1234,10 @@ typed_array_iteration_step(Config *parsed, Config_Compound *compound, Config_RVa
return(result); return(result);
} }
static int32_t static i32
typed_array_get_count(Config *parsed, Config_Compound *compound, Config_RValue_Type type){ typed_array_get_count(Config *parsed, Config_Compound *compound, Config_RValue_Type type){
int32_t count = 0; i32 count = 0;
for (int32_t i = 0;; ++i){ for (i32 i = 0;; ++i){
Config_Iteration_Step_Result result = typed_array_iteration_step(parsed, compound, type, i); Config_Iteration_Step_Result result = typed_array_iteration_step(parsed, compound, type, i);
if (result.step == Iteration_Skip){ if (result.step == Iteration_Skip){
continue; continue;
@ -1253,7 +1253,7 @@ typed_array_get_count(Config *parsed, Config_Compound *compound, Config_RValue_T
static Config_Get_Result_List static Config_Get_Result_List
typed_array_reference_list(Partition *arena, Config *parsed, Config_Compound *compound, Config_RValue_Type type){ typed_array_reference_list(Partition *arena, Config *parsed, Config_Compound *compound, Config_RValue_Type type){
Config_Get_Result_List list = {}; Config_Get_Result_List list = {};
for (int32_t i = 0;; ++i){ for (i32 i = 0;; ++i){
Config_Iteration_Step_Result result = typed_array_iteration_step(parsed, compound, type, i); Config_Iteration_Step_Result result = typed_array_iteration_step(parsed, compound, type, i);
if (result.step == Iteration_Skip){ if (result.step == Iteration_Skip){
continue; continue;
@ -1274,7 +1274,7 @@ typed_array_reference_list(Partition *arena, Config *parsed, Config_Compound *co
static void static void
change_mapping(Application_Links *app, String mapping){ change_mapping(Application_Links *app, String mapping){
b32 did_remap = false; b32 did_remap = false;
for (int32_t i = 0; i < named_map_count; ++i){ for (i32 i = 0; i < named_map_count; ++i){
if (match(mapping, named_maps[i].name)){ if (match(mapping, named_maps[i].name)){
did_remap = true; did_remap = true;
exec_command(app, named_maps[i].remap_command); exec_command(app, named_maps[i].remap_command);
@ -1305,7 +1305,7 @@ change_mode(Application_Links *app, String mode){
static Cpp_Token_Array static Cpp_Token_Array
text_data_to_token_array(Partition *arena, String data){ text_data_to_token_array(Partition *arena, String data){
b32 success = false; b32 success = false;
int32_t max_count = (1 << 20)/sizeof(Cpp_Token); i32 max_count = (1 << 20)/sizeof(Cpp_Token);
Temp_Memory restore_point = begin_temp_memory(arena); Temp_Memory restore_point = begin_temp_memory(arena);
Cpp_Token_Array array = {}; Cpp_Token_Array array = {};
array.tokens = push_array(arena, Cpp_Token, max_count); array.tokens = push_array(arena, Cpp_Token, max_count);
@ -1511,7 +1511,7 @@ config_parse__file_name(Application_Links *app, Partition *arena,
#if 0 #if 0
static void static void
init_theme_zero(Theme *theme){ init_theme_zero(Theme *theme){
for (int32_t i = 0; i < Stag_COUNT; ++i){ for (i32 i = 0; i < Stag_COUNT; ++i){
theme->colors[i] = 0; theme->colors[i] = 0;
} }
} }
@ -1526,9 +1526,9 @@ theme_parse__data(Partition *arena, String file_name, String data, Theme_Data *t
if (parsed != 0){ if (parsed != 0){
config_fixed_string_var(parsed, "name", 0, &theme->name, theme->space); config_fixed_string_var(parsed, "name", 0, &theme->name, theme->space);
for (int32_t i = 0; i < Stag_COUNT; ++i){ for (i32 i = 0; i < Stag_COUNT; ++i){
char *name = style_tag_names[i]; char *name = style_tag_names[i];
uint32_t color = 0; u32 color = 0;
if (!config_uint_var(parsed, name, 0, &color)){ if (!config_uint_var(parsed, name, 0, &color)){
color = 0xFFFF00FF; color = 0xFFFF00FF;
} }
@ -1601,7 +1601,7 @@ config_feedback_extension_list(String *space, char *name, Extension_List *list){
if (list->count > 0){ if (list->count > 0){
append(space, name); append(space, name);
append(space, " = \""); append(space, " = \"");
for (int32_t i = 0; i < list->count; ++i){ for (i32 i = 0; i < list->count; ++i){
append(space, "."); append(space, ".");
append(space, list->exts[i]); append(space, list->exts[i]);
} }
@ -1610,7 +1610,7 @@ config_feedback_extension_list(String *space, char *name, Extension_List *list){
} }
static void static void
config_feedback_int(String *space, char *name, int32_t val){ config_feedback_int(String *space, char *name, i32 val){
append(space, name); append(space, name);
append(space, " = "); append(space, " = ");
append_int_to_str(space, val); append_int_to_str(space, val);
@ -1621,7 +1621,7 @@ config_feedback_int(String *space, char *name, int32_t val){
static void static void
load_config_and_apply(Application_Links *app, Partition *scratch, Config_Data *config, load_config_and_apply(Application_Links *app, Partition *scratch, Config_Data *config,
int32_t override_font_size, b32 override_hinting){ i32 override_font_size, b32 override_hinting){
Temp_Memory temp = begin_temp_memory(scratch); Temp_Memory temp = begin_temp_memory(scratch);
Config *parsed = config_parse__file_name(app, scratch, "config.4coder", config); Config *parsed = config_parse__file_name(app, scratch, "config.4coder", config);
@ -1699,7 +1699,7 @@ load_config_and_apply(Application_Links *app, Partition *scratch, Config_Data *c
highlight_line_at_cursor = config->highlight_line_at_cursor; highlight_line_at_cursor = config->highlight_line_at_cursor;
Face_Description description = {}; Face_Description description = {};
int32_t len = config->default_font_name.size; i32 len = config->default_font_name.size;
char *name_ptr = config->default_font_name.str; char *name_ptr = config->default_font_name.str;
if (len > sizeof(description.font.name) - 1){ if (len > sizeof(description.font.name) - 1){
len = sizeof(description.font.name) - 1; len = sizeof(description.font.name) - 1;
@ -1741,7 +1741,7 @@ load_folder_of_themes_into_live_set(Application_Links *app, Partition *scratch,
if (path.size < path.memory_size){ if (path.size < path.memory_size){
File_List list = get_file_list(app, path.str, path.size); File_List list = get_file_list(app, path.str, path.size);
for (uint32_t i = 0; i < list.count; ++i){ for (u32 i = 0; i < list.count; ++i){
File_Info *info = &list.infos[i]; File_Info *info = &list.infos[i];
if (info->folder){ if (info->folder){
continue; continue;

View File

@ -14,8 +14,8 @@
// to 4coder_remapping_commands.cpp for examples of what binding code looks like. // to 4coder_remapping_commands.cpp for examples of what binding code looks like.
#if !defined(NO_BINDING) #if !defined(NO_BINDING)
extern "C" int32_t extern "C" i32
get_bindings(void *data, int32_t size){ get_bindings(void *data, i32 size){
Bind_Helper context_ = begin_bind_helper(data, size); Bind_Helper context_ = begin_bind_helper(data, size);
Bind_Helper *context = &context_; Bind_Helper *context = &context_;
@ -26,8 +26,7 @@ get_bindings(void *data, int32_t size){
default_keys(context); default_keys(context);
#endif #endif
int32_t result = end_bind_helper(context); return(end_bind_helper(context));
return(result);
} }
#endif //NO_BINDING #endif //NO_BINDING

View File

@ -11,7 +11,7 @@ unlock_jump_buffer(void){
} }
static void static void
lock_jump_buffer(char *name, int32_t size){ lock_jump_buffer(char *name, i32 size){
if (size <= locked_buffer.memory_size){ if (size <= locked_buffer.memory_size){
copy(&locked_buffer, make_string(name, size)); copy(&locked_buffer, make_string(name, size));
} }
@ -77,7 +77,7 @@ static View_Summary
open_footer_panel(Application_Links *app, View_Summary *view){ open_footer_panel(Application_Links *app, View_Summary *view){
View_Summary special_view = open_view(app, view, ViewSplit_Bottom); View_Summary special_view = open_view(app, view, ViewSplit_Bottom);
new_view_settings(app, &special_view); new_view_settings(app, &special_view);
view_set_split_pixel_size(app, &special_view, (int32_t)(special_view.line_height*20.f)); view_set_split_pixel_size(app, &special_view, (i32)(special_view.line_height*20.f));
view_set_passive(app, &special_view, true); view_set_passive(app, &special_view, true);
return(special_view); return(special_view);
} }
@ -138,7 +138,7 @@ get_prev_view_looped_primary_panels(Application_Links *app, View_Summary *view_s
} }
static View_Summary static View_Summary
get_next_view_after_active(Application_Links *app, uint32_t access){ get_next_view_after_active(Application_Links *app, u32 access){
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
if (view.exists){ if (view.exists){
get_next_view_looped_primary_panels(app, &view, access); get_next_view_looped_primary_panels(app, &view, access);
@ -189,8 +189,8 @@ CUSTOM_DOC("Create a new panel by horizontally splitting the active panel.")
// NOTE(allen): Credits to nj/FlyingSolomon for authoring the original version of this helper. // NOTE(allen): Credits to nj/FlyingSolomon for authoring the original version of this helper.
static Buffer_ID static Buffer_ID
create_or_switch_to_buffer_by_name(Application_Links *app, char *name, int32_t name_length, View_Summary default_target_view){ create_or_switch_to_buffer_by_name(Application_Links *app, char *name, i32 name_length, View_Summary default_target_view){
uint32_t access = AccessAll; u32 access = AccessAll;
Buffer_Summary search_buffer = get_buffer_by_name(app, name, name_length, access); Buffer_Summary search_buffer = get_buffer_by_name(app, name, name_length, access);
if (search_buffer.exists){ if (search_buffer.exists){
@ -366,18 +366,18 @@ default_4coder_side_by_side_panels(Application_Links *app, Buffer_Identifier lef
} }
static void static void
default_4coder_side_by_side_panels(Application_Links *app, char **command_line_files, int32_t file_count){ default_4coder_side_by_side_panels(Application_Links *app, char **command_line_files, i32 file_count){
Buffer_Identifier left = buffer_identifier(literal("*scratch*")); Buffer_Identifier left = buffer_identifier(literal("*scratch*"));
Buffer_Identifier right = buffer_identifier(literal("*messages*")); Buffer_Identifier right = buffer_identifier(literal("*messages*"));
if (file_count > 0){ if (file_count > 0){
char *left_name = command_line_files[0]; char *left_name = command_line_files[0];
int32_t left_len = str_size(left_name); i32 left_len = str_size(left_name);
left = buffer_identifier(left_name, left_len); left = buffer_identifier(left_name, left_len);
if (file_count > 1){ if (file_count > 1){
char *right_name = command_line_files[1]; char *right_name = command_line_files[1];
int32_t right_len = str_size(right_name); i32 right_len = str_size(right_name);
right = buffer_identifier(right_name, right_len); right = buffer_identifier(right_name, right_len);
} }
} }
@ -400,12 +400,12 @@ default_4coder_one_panel(Application_Links *app, Buffer_Identifier buffer){
} }
static void static void
default_4coder_one_panel(Application_Links *app, char **command_line_files, int32_t file_count){ default_4coder_one_panel(Application_Links *app, char **command_line_files, i32 file_count){
Buffer_Identifier buffer = buffer_identifier(literal("*messages*")); Buffer_Identifier buffer = buffer_identifier(literal("*messages*"));
if (file_count > 0){ if (file_count > 0){
char *name = command_line_files[0]; char *name = command_line_files[0];
int32_t len = str_size(name); i32 len = str_size(name);
buffer = buffer_identifier(name, len); buffer = buffer_identifier(name, len);
} }

View File

@ -25,25 +25,25 @@ enum Rewrite_Type{
struct ID_Line_Column_Jump_Location{ struct ID_Line_Column_Jump_Location{
Buffer_ID buffer_id; Buffer_ID buffer_id;
int32_t line; i32 line;
int32_t column; i32 column;
}; };
typedef ID_Line_Column_Jump_Location ID_Based_Jump_Location; typedef ID_Line_Column_Jump_Location ID_Based_Jump_Location;
struct ID_Pos_Jump_Location{ struct ID_Pos_Jump_Location{
Buffer_ID buffer_id; Buffer_ID buffer_id;
int32_t pos; i32 pos;
}; };
struct Name_Line_Column_Location{ struct Name_Line_Column_Location{
String file; String file;
int32_t line; i32 line;
int32_t column; i32 column;
}; };
struct ID_Pos_Jump_Location_Array{ struct ID_Pos_Jump_Location_Array{
struct ID_Pos_Jump_Location *jumps; struct ID_Pos_Jump_Location *jumps;
int32_t count; i32 count;
}; };
//////////////////////////////// ////////////////////////////////

View File

@ -6,7 +6,7 @@ the default 4coder behavior.
// TOP // TOP
static Named_Mapping *named_maps = 0; static Named_Mapping *named_maps = 0;
static int32_t named_map_count = 0; static i32 named_map_count = 0;
static b32 allow_immediate_close_without_checking_for_changes = false; static b32 allow_immediate_close_without_checking_for_changes = false;
@ -63,7 +63,7 @@ enum{
FCoderMode_Original = 0, FCoderMode_Original = 0,
FCoderMode_NotepadLike = 1, FCoderMode_NotepadLike = 1,
}; };
static int32_t fcoder_mode = FCoderMode_Original; static i32 fcoder_mode = FCoderMode_Original;
static ID_Line_Column_Jump_Location prev_location = {}; static ID_Line_Column_Jump_Location prev_location = {};

View File

@ -134,7 +134,7 @@ static Fancy_String*
push_fancy_vstringf(Arena *arena, Fancy_String_List *list, Fancy_Color fore, Fancy_Color back, char *format, va_list args){ push_fancy_vstringf(Arena *arena, Fancy_String_List *list, Fancy_Color fore, Fancy_Color back, char *format, va_list args){
// TODO(casey): Allen, ideally we would have our own formatter here that just outputs into a buffer and can't ever "run out of space". // TODO(casey): Allen, ideally we would have our own formatter here that just outputs into a buffer and can't ever "run out of space".
char temp[1024]; char temp[1024];
int32_t length = vsprintf(temp, format, args); i32 length = vsprintf(temp, format, args);
Fancy_String *result = 0; Fancy_String *result = 0;
if (length > 0){ if (length > 0){
result = push_fancy_string(arena, list, fore, back, make_string(temp, length)); result = push_fancy_string(arena, list, fore, back, make_string(temp, length));

View File

@ -33,7 +33,7 @@ descriptions_match(Face_Description *a, Face_Description *b){
} }
static Face_ID static Face_ID
get_existing_face_id_matching_name(Application_Links *app, char *name, int32_t len){ get_existing_face_id_matching_name(Application_Links *app, char *name, i32 len){
String name_str = make_string(name, len); String name_str = make_string(name, len);
Face_ID largest_id = get_largest_face_id(app); Face_ID largest_id = get_largest_face_id(app);
Face_ID result = 0; Face_ID result = 0;
@ -62,7 +62,7 @@ get_existing_face_id_matching_description(Application_Links *app, Face_Descripti
} }
static Face_ID static Face_ID
get_face_id_by_name(Application_Links *app, char *name, int32_t len, Face_Description *base_description){ get_face_id_by_name(Application_Links *app, char *name, i32 len, Face_Description *base_description){
Face_ID new_id = 0; Face_ID new_id = 0;
String str = make_string(name, len); String str = make_string(name, len);
if (!match(str, base_description->font.name)){ if (!match(str, base_description->font.name)){
@ -95,7 +95,7 @@ get_face_id_by_description(Application_Links *app, Face_Description *description
} }
static void static void
set_global_face_by_name(Application_Links *app, char *name, int32_t len, b32 apply_to_all_buffers){ set_global_face_by_name(Application_Links *app, char *name, i32 len, b32 apply_to_all_buffers){
Face_ID global_face_id = get_face_id(app, 0); Face_ID global_face_id = get_face_id(app, 0);
Face_Description description = get_face_description(app, global_face_id); Face_Description description = get_face_description(app, global_face_id);
Face_ID new_id = get_face_id_by_name(app, name, len, &description); Face_ID new_id = get_face_id_by_name(app, name, len, &description);
@ -114,7 +114,7 @@ change_global_face_by_description(Application_Links *app, Face_Description descr
} }
static void static void
set_buffer_face_by_name(Application_Links *app, Buffer_Summary *buffer, char *name, int32_t len){ set_buffer_face_by_name(Application_Links *app, Buffer_Summary *buffer, char *name, i32 len){
Face_ID current_id = get_face_id(app, buffer); Face_ID current_id = get_face_id(app, buffer);
if (current_id != 0){ if (current_id != 0){
Face_Description description = get_face_description(app, current_id); Face_Description description = get_face_description(app, current_id);

View File

@ -1,32 +1,32 @@
struct Application_Links; struct Application_Links;
#define GLOBAL_SET_SETTING_SIG(n) b32 n(Application_Links *app, Global_Setting_ID setting, int32_t value) #define GLOBAL_SET_SETTING_SIG(n) b32 n(Application_Links *app, Global_Setting_ID setting, i32 value)
#define GLOBAL_SET_MAPPING_SIG(n) b32 n(Application_Links *app, void *data, int32_t size) #define GLOBAL_SET_MAPPING_SIG(n) b32 n(Application_Links *app, void *data, i32 size)
#define EXEC_SYSTEM_COMMAND_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags) #define EXEC_SYSTEM_COMMAND_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags)
#define CLIPBOARD_POST_SIG(n) b32 n(Application_Links *app, int32_t clipboard_id, String string) #define CLIPBOARD_POST_SIG(n) b32 n(Application_Links *app, i32 clipboard_id, String string)
#define CLIPBOARD_COUNT_SIG(n) b32 n(Application_Links *app, int32_t clipboard_id, int32_t *count_out) #define CLIPBOARD_COUNT_SIG(n) b32 n(Application_Links *app, i32 clipboard_id, i32 *count_out)
#define CLIPBOARD_INDEX_SIG(n) b32 n(Application_Links *app, int32_t clipboard_id, int32_t item_index, String *string_out, int32_t *required_size_out) #define CLIPBOARD_INDEX_SIG(n) b32 n(Application_Links *app, i32 clipboard_id, i32 item_index, String *string_out, i32 *required_size_out)
#define CREATE_PARSE_CONTEXT_SIG(n) Parse_Context_ID n(Application_Links *app, Parser_String_And_Type *kw, uint32_t kw_count, Parser_String_And_Type *pp, uint32_t pp_count) #define CREATE_PARSE_CONTEXT_SIG(n) Parse_Context_ID n(Application_Links *app, Parser_String_And_Type *kw, u32 kw_count, Parser_String_And_Type *pp, u32 pp_count)
#define GET_BUFFER_COUNT_SIG(n) int32_t n(Application_Links *app) #define GET_BUFFER_COUNT_SIG(n) i32 n(Application_Links *app)
#define GET_BUFFER_FIRST_SIG(n) b32 n(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out) #define GET_BUFFER_FIRST_SIG(n) b32 n(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out)
#define GET_BUFFER_NEXT_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out) #define GET_BUFFER_NEXT_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out)
#define GET_BUFFER_SUMMARY_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out) #define GET_BUFFER_SUMMARY_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out)
#define GET_BUFFER_BY_NAME_SIG(n) b32 n(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out) #define GET_BUFFER_BY_NAME_SIG(n) b32 n(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out)
#define GET_BUFFER_BY_FILE_NAME_SIG(n) b32 n(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out) #define GET_BUFFER_BY_FILE_NAME_SIG(n) b32 n(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out)
#define BUFFER_READ_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, char *out) #define BUFFER_READ_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, char *out)
#define BUFFER_REPLACE_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String string) #define BUFFER_REPLACE_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, String string)
#define BUFFER_SET_EDIT_HANDLER_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler) #define BUFFER_SET_EDIT_HANDLER_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler)
#define BUFFER_COMPUTE_CURSOR_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out) #define BUFFER_COMPUTE_CURSOR_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out)
#define BUFFER_BATCH_EDIT_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type) #define BUFFER_BATCH_EDIT_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, char *str, i32 str_len, Buffer_Edit *edits, i32 edit_count, Buffer_Batch_Edit_Type type)
#define BUFFER_GET_SETTING_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t *value_out) #define BUFFER_GET_SETTING_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 *value_out)
#define BUFFER_SET_SETTING_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t value) #define BUFFER_SET_SETTING_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value)
#define BUFFER_GET_MANAGED_SCOPE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out) #define BUFFER_GET_MANAGED_SCOPE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out)
#define BUFFER_TOKEN_COUNT_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, int32_t *count_out) #define BUFFER_TOKEN_COUNT_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, i32 *count_out)
#define BUFFER_READ_TOKENS_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out) #define BUFFER_READ_TOKENS_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, i32 start_token, i32 end_token, Cpp_Token *tokens_out)
#define BUFFER_GET_TOKEN_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out) #define BUFFER_GET_TOKEN_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out)
#define BUFFER_GET_TOKEN_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, int32_t pos, Cpp_Get_Token_Result *get_result) #define BUFFER_GET_TOKEN_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, i32 pos, Cpp_Get_Token_Result *get_result)
#define BUFFER_SEND_END_SIGNAL_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id) #define BUFFER_SEND_END_SIGNAL_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id)
#define CREATE_BUFFER_SIG(n) b32 n(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out) #define CREATE_BUFFER_SIG(n) b32 n(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out)
#define BUFFER_SAVE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, String file_name, uint32_t flags) #define BUFFER_SAVE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, String file_name, u32 flags)
#define BUFFER_KILL_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result) #define BUFFER_KILL_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result)
#define BUFFER_REOPEN_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result) #define BUFFER_REOPEN_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result)
#define BUFFER_GET_FILE_ATTRIBUTES_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, File_Attributes *attributes_out) #define BUFFER_GET_FILE_ATTRIBUTES_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, File_Attributes *attributes_out)
@ -48,8 +48,8 @@ struct Application_Links;
#define PANEL_GET_MARGIN_SIG(n) b32 n(Application_Links *app, Panel_ID panel_id, i32_Rect *margins_out) #define PANEL_GET_MARGIN_SIG(n) b32 n(Application_Links *app, Panel_ID panel_id, i32_Rect *margins_out)
#define VIEW_CLOSE_SIG(n) b32 n(Application_Links *app, View_ID view_id) #define VIEW_CLOSE_SIG(n) b32 n(Application_Links *app, View_ID view_id)
#define VIEW_SET_ACTIVE_SIG(n) b32 n(Application_Links *app, View_ID view_id) #define VIEW_SET_ACTIVE_SIG(n) b32 n(Application_Links *app, View_ID view_id)
#define VIEW_GET_SETTING_SIG(n) b32 n(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t *value_out) #define VIEW_GET_SETTING_SIG(n) b32 n(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 *value_out)
#define VIEW_SET_SETTING_SIG(n) b32 n(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t value) #define VIEW_SET_SETTING_SIG(n) b32 n(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 value)
#define VIEW_GET_MANAGED_SCOPE_SIG(n) b32 n(Application_Links *app, View_ID view_id, Managed_Scope *scope) #define VIEW_GET_MANAGED_SCOPE_SIG(n) b32 n(Application_Links *app, View_ID view_id, Managed_Scope *scope)
#define VIEW_GET_ENCLOSURE_RECT_SIG(n) b32 n(Application_Links *app, View_ID view_id, i32_Rect *rect_out) #define VIEW_GET_ENCLOSURE_RECT_SIG(n) b32 n(Application_Links *app, View_ID view_id, i32_Rect *rect_out)
#define VIEW_COMPUTE_CURSOR_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out) #define VIEW_COMPUTE_CURSOR_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out)
@ -57,7 +57,7 @@ struct Application_Links;
#define VIEW_SET_SCROLL_SIG(n) b32 n(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll) #define VIEW_SET_SCROLL_SIG(n) b32 n(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll)
#define VIEW_SET_MARK_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek) #define VIEW_SET_MARK_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek)
#define VIEW_SET_BUFFER_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) #define VIEW_SET_BUFFER_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags)
#define VIEW_POST_FADE_SIG(n) b32 n(Application_Links *app, View_ID view_id, float seconds, int32_t start, int32_t end, int_color color) #define VIEW_POST_FADE_SIG(n) b32 n(Application_Links *app, View_ID view_id, float seconds, i32 start, i32 end, int_color color)
#define VIEW_BEGIN_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id) #define VIEW_BEGIN_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id)
#define VIEW_END_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id) #define VIEW_END_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id)
#define VIEW_IS_IN_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id) #define VIEW_IS_IN_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id)
@ -66,7 +66,7 @@ struct Application_Links;
#define CREATE_USER_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app) #define CREATE_USER_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app)
#define DESTROY_USER_MANAGED_SCOPE_SIG(n) b32 n(Application_Links *app, Managed_Scope scope) #define DESTROY_USER_MANAGED_SCOPE_SIG(n) b32 n(Application_Links *app, Managed_Scope scope)
#define GET_GLOBAL_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app) #define GET_GLOBAL_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app)
#define GET_MANAGED_SCOPE_WITH_MULTIPLE_DEPENDENCIES_SIG(n) Managed_Scope n(Application_Links *app, Managed_Scope *scopes, int32_t count) #define GET_MANAGED_SCOPE_WITH_MULTIPLE_DEPENDENCIES_SIG(n) Managed_Scope n(Application_Links *app, Managed_Scope *scopes, i32 count)
#define MANAGED_SCOPE_CLEAR_CONTENTS_SIG(n) b32 n(Application_Links *app, Managed_Scope scope) #define MANAGED_SCOPE_CLEAR_CONTENTS_SIG(n) b32 n(Application_Links *app, Managed_Scope scope)
#define MANAGED_SCOPE_CLEAR_SELF_ALL_DEPENDENT_SCOPES_SIG(n) b32 n(Application_Links *app, Managed_Scope scope) #define MANAGED_SCOPE_CLEAR_SELF_ALL_DEPENDENT_SCOPES_SIG(n) b32 n(Application_Links *app, Managed_Scope scope)
#define MANAGED_VARIABLE_CREATE_SIG(n) Managed_Variable_ID n(Application_Links *app, char *null_terminated_name, uint64_t default_value) #define MANAGED_VARIABLE_CREATE_SIG(n) Managed_Variable_ID n(Application_Links *app, char *null_terminated_name, uint64_t default_value)
@ -75,7 +75,7 @@ struct Application_Links;
#define MANAGED_VARIABLE_SET_SIG(n) b32 n(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value) #define MANAGED_VARIABLE_SET_SIG(n) b32 n(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value)
#define MANAGED_VARIABLE_GET_SIG(n) b32 n(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out) #define MANAGED_VARIABLE_GET_SIG(n) b32 n(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out)
#define ALLOC_MANAGED_MEMORY_IN_SCOPE_SIG(n) Managed_Object n(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count) #define ALLOC_MANAGED_MEMORY_IN_SCOPE_SIG(n) Managed_Object n(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count)
#define ALLOC_BUFFER_MARKERS_ON_BUFFER_SIG(n) Managed_Object n(Application_Links *app, Buffer_ID buffer_id, int32_t count, Managed_Scope *optional_extra_scope) #define ALLOC_BUFFER_MARKERS_ON_BUFFER_SIG(n) Managed_Object n(Application_Links *app, Buffer_ID buffer_id, i32 count, Managed_Scope *optional_extra_scope)
#define ALLOC_MANAGED_ARENA_IN_SCOPE_SIG(n) Managed_Object n(Application_Links *app, Managed_Scope scope, i32 page_size) #define ALLOC_MANAGED_ARENA_IN_SCOPE_SIG(n) Managed_Object n(Application_Links *app, Managed_Scope scope, i32 page_size)
#define CREATE_MARKER_VISUAL_SIG(n) Marker_Visual n(Application_Links *app, Managed_Object object) #define CREATE_MARKER_VISUAL_SIG(n) Marker_Visual n(Application_Links *app, Managed_Object object)
#define MARKER_VISUAL_SET_EFFECT_SIG(n) b32 n(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style) #define MARKER_VISUAL_SET_EFFECT_SIG(n) b32 n(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style)
@ -83,28 +83,28 @@ struct Application_Links;
#define MARKER_VISUAL_SET_PRIORITY_SIG(n) b32 n(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority) #define MARKER_VISUAL_SET_PRIORITY_SIG(n) b32 n(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority)
#define MARKER_VISUAL_SET_VIEW_KEY_SIG(n) b32 n(Application_Links *app, Marker_Visual visual, View_ID key_view_id) #define MARKER_VISUAL_SET_VIEW_KEY_SIG(n) b32 n(Application_Links *app, Marker_Visual visual, View_ID key_view_id)
#define DESTROY_MARKER_VISUAL_SIG(n) b32 n(Application_Links *app, Marker_Visual visual) #define DESTROY_MARKER_VISUAL_SIG(n) b32 n(Application_Links *app, Marker_Visual visual)
#define BUFFER_MARKERS_GET_ATTACHED_VISUAL_COUNT_SIG(n) int32_t n(Application_Links *app, Managed_Object object) #define BUFFER_MARKERS_GET_ATTACHED_VISUAL_COUNT_SIG(n) i32 n(Application_Links *app, Managed_Object object)
#define BUFFER_MARKERS_GET_ATTACHED_VISUAL_SIG(n) Marker_Visual* n(Application_Links *app, Partition *part, Managed_Object object) #define BUFFER_MARKERS_GET_ATTACHED_VISUAL_SIG(n) Marker_Visual* n(Application_Links *app, Partition *part, Managed_Object object)
#define MANAGED_OBJECT_GET_ITEM_SIZE_SIG(n) uint32_t n(Application_Links *app, Managed_Object object) #define MANAGED_OBJECT_GET_ITEM_SIZE_SIG(n) u32 n(Application_Links *app, Managed_Object object)
#define MANAGED_OBJECT_GET_ITEM_COUNT_SIG(n) uint32_t n(Application_Links *app, Managed_Object object) #define MANAGED_OBJECT_GET_ITEM_COUNT_SIG(n) u32 n(Application_Links *app, Managed_Object object)
#define MANAGED_OBJECT_GET_TYPE_SIG(n) Managed_Object_Type n(Application_Links *app, Managed_Object object) #define MANAGED_OBJECT_GET_TYPE_SIG(n) Managed_Object_Type n(Application_Links *app, Managed_Object object)
#define MANAGED_OBJECT_GET_CONTAINING_SCOPE_SIG(n) Managed_Scope n(Application_Links *app, Managed_Object object) #define MANAGED_OBJECT_GET_CONTAINING_SCOPE_SIG(n) Managed_Scope n(Application_Links *app, Managed_Object object)
#define MANAGED_OBJECT_FREE_SIG(n) b32 n(Application_Links *app, Managed_Object object) #define MANAGED_OBJECT_FREE_SIG(n) b32 n(Application_Links *app, Managed_Object object)
#define MANAGED_OBJECT_STORE_DATA_SIG(n) b32 n(Application_Links *app, Managed_Object object, uint32_t first_index, uint32_t count, void *mem) #define MANAGED_OBJECT_STORE_DATA_SIG(n) b32 n(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem)
#define MANAGED_OBJECT_LOAD_DATA_SIG(n) b32 n(Application_Links *app, Managed_Object object, uint32_t first_index, uint32_t count, void *mem_out) #define MANAGED_OBJECT_LOAD_DATA_SIG(n) b32 n(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem_out)
#define GET_USER_INPUT_SIG(n) User_Input n(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type) #define GET_USER_INPUT_SIG(n) User_Input n(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type)
#define GET_COMMAND_INPUT_SIG(n) User_Input n(Application_Links *app) #define GET_COMMAND_INPUT_SIG(n) User_Input n(Application_Links *app)
#define SET_COMMAND_INPUT_SIG(n) void n(Application_Links *app, Key_Event_Data key_data) #define SET_COMMAND_INPUT_SIG(n) void n(Application_Links *app, Key_Event_Data key_data)
#define GET_MOUSE_STATE_SIG(n) Mouse_State n(Application_Links *app) #define GET_MOUSE_STATE_SIG(n) Mouse_State n(Application_Links *app)
#define GET_ACTIVE_QUERY_BARS_SIG(n) int32_t n(Application_Links *app, View_ID view_id, int32_t max_result_count, Query_Bar **result_array) #define GET_ACTIVE_QUERY_BARS_SIG(n) i32 n(Application_Links *app, View_ID view_id, i32 max_result_count, Query_Bar **result_array)
#define START_QUERY_BAR_SIG(n) b32 n(Application_Links *app, Query_Bar *bar, uint32_t flags) #define START_QUERY_BAR_SIG(n) b32 n(Application_Links *app, Query_Bar *bar, u32 flags)
#define END_QUERY_BAR_SIG(n) void n(Application_Links *app, Query_Bar *bar, uint32_t flags) #define END_QUERY_BAR_SIG(n) void n(Application_Links *app, Query_Bar *bar, u32 flags)
#define PRINT_MESSAGE_SIG(n) b32 n(Application_Links *app, String message) #define PRINT_MESSAGE_SIG(n) b32 n(Application_Links *app, String message)
#define GET_LARGEST_FACE_ID_SIG(n) Face_ID n(Application_Links *app) #define GET_LARGEST_FACE_ID_SIG(n) Face_ID n(Application_Links *app)
#define SET_GLOBAL_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, b32 apply_to_all_buffers) #define SET_GLOBAL_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, b32 apply_to_all_buffers)
#define BUFFER_HISTORY_GET_MAX_RECORD_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out) #define BUFFER_HISTORY_GET_MAX_RECORD_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out)
#define BUFFER_HISTORY_GET_RECORD_INFO_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out) #define BUFFER_HISTORY_GET_RECORD_INFO_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out)
#define BUFFER_HISTORY_GET_GROUP_SUB_RECORD_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, int32_t sub_index, Record_Info *record_out) #define BUFFER_HISTORY_GET_GROUP_SUB_RECORD_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index, Record_Info *record_out)
#define BUFFER_HISTORY_GET_CURRENT_STATE_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out) #define BUFFER_HISTORY_GET_CURRENT_STATE_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out)
#define BUFFER_HISTORY_SET_CURRENT_STATE_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index) #define BUFFER_HISTORY_SET_CURRENT_STATE_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index)
#define BUFFER_HISTORY_MERGE_RECORD_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags) #define BUFFER_HISTORY_MERGE_RECORD_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags)
@ -117,22 +117,22 @@ struct Application_Links;
#define TRY_CREATE_NEW_FACE_SIG(n) Face_ID n(Application_Links *app, Face_Description *description) #define TRY_CREATE_NEW_FACE_SIG(n) Face_ID n(Application_Links *app, Face_Description *description)
#define TRY_MODIFY_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, Face_Description *description) #define TRY_MODIFY_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, Face_Description *description)
#define TRY_RELEASE_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, Face_ID replacement_id) #define TRY_RELEASE_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, Face_ID replacement_id)
#define GET_AVAILABLE_FONT_COUNT_SIG(n) int32_t n(Application_Links *app) #define GET_AVAILABLE_FONT_COUNT_SIG(n) i32 n(Application_Links *app)
#define GET_AVAILABLE_FONT_SIG(n) Available_Font n(Application_Links *app, int32_t index) #define GET_AVAILABLE_FONT_SIG(n) Available_Font n(Application_Links *app, i32 index)
#define SET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, int32_t count) #define SET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, i32 count)
#define GET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, int32_t count) #define GET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, i32 count)
#define FINALIZE_COLOR_SIG(n) argb_color n(Application_Links *app, int_color color) #define FINALIZE_COLOR_SIG(n) argb_color n(Application_Links *app, int_color color)
#define GET_HOT_DIRECTORY_SIG(n) int32_t n(Application_Links *app, String *out, int32_t *required_size_out) #define GET_HOT_DIRECTORY_SIG(n) i32 n(Application_Links *app, String *out, i32 *required_size_out)
#define SET_HOT_DIRECTORY_SIG(n) b32 n(Application_Links *app, String string) #define SET_HOT_DIRECTORY_SIG(n) b32 n(Application_Links *app, String string)
#define GET_FILE_LIST_SIG(n) b32 n(Application_Links *app, String directory, File_List *list_out) #define GET_FILE_LIST_SIG(n) b32 n(Application_Links *app, String directory, File_List *list_out)
#define FREE_FILE_LIST_SIG(n) void n(Application_Links *app, File_List list) #define FREE_FILE_LIST_SIG(n) void n(Application_Links *app, File_List list)
#define SET_GUI_UP_DOWN_KEYS_SIG(n) void n(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier) #define SET_GUI_UP_DOWN_KEYS_SIG(n) void n(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier)
#define MEMORY_ALLOCATE_SIG(n) void* n(Application_Links *app, int32_t size) #define MEMORY_ALLOCATE_SIG(n) void* n(Application_Links *app, i32 size)
#define MEMORY_SET_PROTECTION_SIG(n) b32 n(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags) #define MEMORY_SET_PROTECTION_SIG(n) b32 n(Application_Links *app, void *ptr, i32 size, Memory_Protect_Flags flags)
#define MEMORY_FREE_SIG(n) void n(Application_Links *app, void *ptr, int32_t size) #define MEMORY_FREE_SIG(n) void n(Application_Links *app, void *ptr, i32 size)
#define FILE_GET_ATTRIBUTES_SIG(n) b32 n(Application_Links *app, String file_name, File_Attributes *attributes_out) #define FILE_GET_ATTRIBUTES_SIG(n) b32 n(Application_Links *app, String file_name, File_Attributes *attributes_out)
#define DIRECTORY_CD_SIG(n) b32 n(Application_Links *app, String *directory, String relative_path) #define DIRECTORY_CD_SIG(n) b32 n(Application_Links *app, String *directory, String relative_path)
#define GET_4ED_PATH_SIG(n) b32 n(Application_Links *app, String *path_out, int32_t *required_size_out) #define GET_4ED_PATH_SIG(n) b32 n(Application_Links *app, String *path_out, i32 *required_size_out)
#define SHOW_MOUSE_CURSOR_SIG(n) void n(Application_Links *app, Mouse_Cursor_Show_Type show) #define SHOW_MOUSE_CURSOR_SIG(n) void n(Application_Links *app, Mouse_Cursor_Show_Type show)
#define SET_EDIT_FINISHED_HOOK_REPEAT_SPEED_SIG(n) b32 n(Application_Links *app, u32 milliseconds) #define SET_EDIT_FINISHED_HOOK_REPEAT_SPEED_SIG(n) b32 n(Application_Links *app, u32 milliseconds)
#define SET_FULLSCREEN_SIG(n) b32 n(Application_Links *app, b32 full_screen) #define SET_FULLSCREEN_SIG(n) b32 n(Application_Links *app, b32 full_screen)
@ -147,7 +147,7 @@ struct Application_Links;
#define GET_DEFAULT_FONT_FOR_VIEW_SIG(n) Face_ID n(Application_Links *app, View_ID view_id) #define GET_DEFAULT_FONT_FOR_VIEW_SIG(n) Face_ID n(Application_Links *app, View_ID view_id)
#define OPEN_COLOR_PICKER_SIG(n) void n(Application_Links *app, color_picker *picker) #define OPEN_COLOR_PICKER_SIG(n) void n(Application_Links *app, color_picker *picker)
#define ANIMATE_SIG(n) void n(Application_Links *app) #define ANIMATE_SIG(n) void n(Application_Links *app)
#define FIND_ALL_IN_RANGE_INSENSITIVE_SIG(n) Found_String_List n(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t end, String key, Partition *memory) #define FIND_ALL_IN_RANGE_INSENSITIVE_SIG(n) Found_String_List n(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 end, String key, Partition *memory)
typedef GLOBAL_SET_SETTING_SIG(Global_Set_Setting_Function); typedef GLOBAL_SET_SETTING_SIG(Global_Set_Setting_Function);
typedef GLOBAL_SET_MAPPING_SIG(Global_Set_Mapping_Function); typedef GLOBAL_SET_MAPPING_SIG(Global_Set_Mapping_Function);
typedef EXEC_SYSTEM_COMMAND_SIG(Exec_System_Command_Function); typedef EXEC_SYSTEM_COMMAND_SIG(Exec_System_Command_Function);
@ -757,34 +757,34 @@ app_links->open_color_picker_ = Open_Color_Picker;\
app_links->animate_ = Animate;\ app_links->animate_ = Animate;\
app_links->find_all_in_range_insensitive_ = Find_All_In_Range_Insensitive;} while(false) app_links->find_all_in_range_insensitive_ = Find_All_In_Range_Insensitive;} while(false)
#if defined(ALLOW_DEP_4CODER) #if defined(ALLOW_DEP_4CODER)
static b32 global_set_setting(Application_Links *app, Global_Setting_ID setting, int32_t value){return(app->global_set_setting(app, setting, value));} static b32 global_set_setting(Application_Links *app, Global_Setting_ID setting, i32 value){return(app->global_set_setting(app, setting, value));}
static b32 global_set_mapping(Application_Links *app, void *data, int32_t size){return(app->global_set_mapping(app, data, size));} static b32 global_set_mapping(Application_Links *app, void *data, i32 size){return(app->global_set_mapping(app, data, size));}
static b32 exec_system_command(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags){return(app->exec_system_command(app, view_id, buffer_id, path, command, flags));} static b32 exec_system_command(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags){return(app->exec_system_command(app, view_id, buffer_id, path, command, flags));}
static b32 clipboard_post(Application_Links *app, int32_t clipboard_id, String string){return(app->clipboard_post(app, clipboard_id, string));} static b32 clipboard_post(Application_Links *app, i32 clipboard_id, String string){return(app->clipboard_post(app, clipboard_id, string));}
static b32 clipboard_count(Application_Links *app, int32_t clipboard_id, int32_t *count_out){return(app->clipboard_count(app, clipboard_id, count_out));} static b32 clipboard_count(Application_Links *app, i32 clipboard_id, i32 *count_out){return(app->clipboard_count(app, clipboard_id, count_out));}
static b32 clipboard_index(Application_Links *app, int32_t clipboard_id, int32_t item_index, String *string_out, int32_t *required_size_out){return(app->clipboard_index(app, clipboard_id, item_index, string_out, required_size_out));} static b32 clipboard_index(Application_Links *app, i32 clipboard_id, i32 item_index, String *string_out, i32 *required_size_out){return(app->clipboard_index(app, clipboard_id, item_index, string_out, required_size_out));}
static Parse_Context_ID create_parse_context(Application_Links *app, Parser_String_And_Type *kw, uint32_t kw_count, Parser_String_And_Type *pp, uint32_t pp_count){return(app->create_parse_context(app, kw, kw_count, pp, pp_count));} static Parse_Context_ID create_parse_context(Application_Links *app, Parser_String_And_Type *kw, u32 kw_count, Parser_String_And_Type *pp, u32 pp_count){return(app->create_parse_context(app, kw, kw_count, pp, pp_count));}
static int32_t get_buffer_count(Application_Links *app){return(app->get_buffer_count(app));} static i32 get_buffer_count(Application_Links *app){return(app->get_buffer_count(app));}
static b32 get_buffer_first(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_first(app, access, buffer_id_out));} static b32 get_buffer_first(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_first(app, access, buffer_id_out));}
static b32 get_buffer_next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_next(app, buffer_id, access, buffer_id_out));} static b32 get_buffer_next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_next(app, buffer_id, access, buffer_id_out));}
static b32 get_buffer_summary(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out){return(app->get_buffer_summary(app, buffer_id, access, buffer_summary_out));} static b32 get_buffer_summary(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out){return(app->get_buffer_summary(app, buffer_id, access, buffer_summary_out));}
static b32 get_buffer_by_name(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_name(app, name, access, buffer_id_out));} static b32 get_buffer_by_name(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_name(app, name, access, buffer_id_out));}
static b32 get_buffer_by_file_name(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_file_name(app, file_name, access, buffer_id_out));} static b32 get_buffer_by_file_name(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_file_name(app, file_name, access, buffer_id_out));}
static b32 buffer_read_range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, char *out){return(app->buffer_read_range(app, buffer_id, start, one_past_last, out));} static b32 buffer_read_range(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, char *out){return(app->buffer_read_range(app, buffer_id, start, one_past_last, out));}
static b32 buffer_replace_range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String string){return(app->buffer_replace_range(app, buffer_id, start, one_past_last, string));} static b32 buffer_replace_range(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, String string){return(app->buffer_replace_range(app, buffer_id, start, one_past_last, string));}
static b32 buffer_set_edit_handler(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler){return(app->buffer_set_edit_handler(app, buffer_id, handler));} static b32 buffer_set_edit_handler(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler){return(app->buffer_set_edit_handler(app, buffer_id, handler));}
static b32 buffer_compute_cursor(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out){return(app->buffer_compute_cursor(app, buffer_id, seek, cursor_out));} static b32 buffer_compute_cursor(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out){return(app->buffer_compute_cursor(app, buffer_id, seek, cursor_out));}
static b32 buffer_batch_edit(Application_Links *app, Buffer_ID buffer_id, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type){return(app->buffer_batch_edit(app, buffer_id, str, str_len, edits, edit_count, type));} static b32 buffer_batch_edit(Application_Links *app, Buffer_ID buffer_id, char *str, i32 str_len, Buffer_Edit *edits, i32 edit_count, Buffer_Batch_Edit_Type type){return(app->buffer_batch_edit(app, buffer_id, str, str_len, edits, edit_count, type));}
static b32 buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t *value_out){return(app->buffer_get_setting(app, buffer_id, setting, value_out));} static b32 buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 *value_out){return(app->buffer_get_setting(app, buffer_id, setting, value_out));}
static b32 buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t value){return(app->buffer_set_setting(app, buffer_id, setting, value));} static b32 buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value){return(app->buffer_set_setting(app, buffer_id, setting, value));}
static b32 buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out){return(app->buffer_get_managed_scope(app, buffer_id, scope_out));} static b32 buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out){return(app->buffer_get_managed_scope(app, buffer_id, scope_out));}
static b32 buffer_token_count(Application_Links *app, Buffer_ID buffer_id, int32_t *count_out){return(app->buffer_token_count(app, buffer_id, count_out));} static b32 buffer_token_count(Application_Links *app, Buffer_ID buffer_id, i32 *count_out){return(app->buffer_token_count(app, buffer_id, count_out));}
static b32 buffer_read_tokens(Application_Links *app, Buffer_ID buffer_id, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens(app, buffer_id, start_token, end_token, tokens_out));} static b32 buffer_read_tokens(Application_Links *app, Buffer_ID buffer_id, i32 start_token, i32 end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens(app, buffer_id, start_token, end_token, tokens_out));}
static b32 buffer_get_token_range(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){return(app->buffer_get_token_range(app, buffer_id, first_token_out, one_past_last_token_out));} static b32 buffer_get_token_range(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){return(app->buffer_get_token_range(app, buffer_id, first_token_out, one_past_last_token_out));}
static b32 buffer_get_token_index(Application_Links *app, Buffer_ID buffer_id, int32_t pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index(app, buffer_id, pos, get_result));} static b32 buffer_get_token_index(Application_Links *app, Buffer_ID buffer_id, i32 pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index(app, buffer_id, pos, get_result));}
static b32 buffer_send_end_signal(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_send_end_signal(app, buffer_id));} static b32 buffer_send_end_signal(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_send_end_signal(app, buffer_id));}
static b32 create_buffer(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out){return(app->create_buffer(app, file_name, flags, new_buffer_id_out));} static b32 create_buffer(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out){return(app->create_buffer(app, file_name, flags, new_buffer_id_out));}
static b32 buffer_save(Application_Links *app, Buffer_ID buffer_id, String file_name, uint32_t flags){return(app->buffer_save(app, buffer_id, file_name, flags));} static b32 buffer_save(Application_Links *app, Buffer_ID buffer_id, String file_name, u32 flags){return(app->buffer_save(app, buffer_id, file_name, flags));}
static b32 buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result){return(app->buffer_kill(app, buffer_id, flags, result));} static b32 buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result){return(app->buffer_kill(app, buffer_id, flags, result));}
static b32 buffer_reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result){return(app->buffer_reopen(app, buffer_id, flags, result));} static b32 buffer_reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result){return(app->buffer_reopen(app, buffer_id, flags, result));}
static b32 buffer_get_file_attributes(Application_Links *app, Buffer_ID buffer_id, File_Attributes *attributes_out){return(app->buffer_get_file_attributes(app, buffer_id, attributes_out));} static b32 buffer_get_file_attributes(Application_Links *app, Buffer_ID buffer_id, File_Attributes *attributes_out){return(app->buffer_get_file_attributes(app, buffer_id, attributes_out));}
@ -806,8 +806,8 @@ static b32 panel_get_max(Application_Links *app, Panel_ID panel_id, Panel_ID *pa
static b32 panel_get_margin(Application_Links *app, Panel_ID panel_id, i32_Rect *margins_out){return(app->panel_get_margin(app, panel_id, margins_out));} static b32 panel_get_margin(Application_Links *app, Panel_ID panel_id, i32_Rect *margins_out){return(app->panel_get_margin(app, panel_id, margins_out));}
static b32 view_close(Application_Links *app, View_ID view_id){return(app->view_close(app, view_id));} static b32 view_close(Application_Links *app, View_ID view_id){return(app->view_close(app, view_id));}
static b32 view_set_active(Application_Links *app, View_ID view_id){return(app->view_set_active(app, view_id));} static b32 view_set_active(Application_Links *app, View_ID view_id){return(app->view_set_active(app, view_id));}
static b32 view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t *value_out){return(app->view_get_setting(app, view_id, setting, value_out));} static b32 view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 *value_out){return(app->view_get_setting(app, view_id, setting, value_out));}
static b32 view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t value){return(app->view_set_setting(app, view_id, setting, value));} static b32 view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 value){return(app->view_set_setting(app, view_id, setting, value));}
static b32 view_get_managed_scope(Application_Links *app, View_ID view_id, Managed_Scope *scope){return(app->view_get_managed_scope(app, view_id, scope));} static b32 view_get_managed_scope(Application_Links *app, View_ID view_id, Managed_Scope *scope){return(app->view_get_managed_scope(app, view_id, scope));}
static b32 view_get_enclosure_rect(Application_Links *app, View_ID view_id, i32_Rect *rect_out){return(app->view_get_enclosure_rect(app, view_id, rect_out));} static b32 view_get_enclosure_rect(Application_Links *app, View_ID view_id, i32_Rect *rect_out){return(app->view_get_enclosure_rect(app, view_id, rect_out));}
static b32 view_compute_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor(app, view_id, seek, cursor_out));} static b32 view_compute_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor(app, view_id, seek, cursor_out));}
@ -815,7 +815,7 @@ static b32 view_set_cursor(Application_Links *app, View_ID view_id, Buffer_Seek
static b32 view_set_scroll(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll){return(app->view_set_scroll(app, view_id, scroll));} static b32 view_set_scroll(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll){return(app->view_set_scroll(app, view_id, scroll));}
static b32 view_set_mark(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_set_mark(app, view_id, seek));} static b32 view_set_mark(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_set_mark(app, view_id, seek));}
static b32 view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer(app, view_id, buffer_id, flags));} static b32 view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer(app, view_id, buffer_id, flags));}
static b32 view_post_fade(Application_Links *app, View_ID view_id, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade(app, view_id, seconds, start, end, color));} static b32 view_post_fade(Application_Links *app, View_ID view_id, float seconds, i32 start, i32 end, int_color color){return(app->view_post_fade(app, view_id, seconds, start, end, color));}
static b32 view_begin_ui_mode(Application_Links *app, View_ID view_id){return(app->view_begin_ui_mode(app, view_id));} static b32 view_begin_ui_mode(Application_Links *app, View_ID view_id){return(app->view_begin_ui_mode(app, view_id));}
static b32 view_end_ui_mode(Application_Links *app, View_ID view_id){return(app->view_end_ui_mode(app, view_id));} static b32 view_end_ui_mode(Application_Links *app, View_ID view_id){return(app->view_end_ui_mode(app, view_id));}
static b32 view_is_in_ui_mode(Application_Links *app, View_ID view_id){return(app->view_is_in_ui_mode(app, view_id));} static b32 view_is_in_ui_mode(Application_Links *app, View_ID view_id){return(app->view_is_in_ui_mode(app, view_id));}
@ -824,7 +824,7 @@ static b32 view_get_quit_ui_handler(Application_Links *app, View_ID view_id, UI_
static Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope(app));} static Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope(app));}
static b32 destroy_user_managed_scope(Application_Links *app, Managed_Scope scope){return(app->destroy_user_managed_scope(app, scope));} static b32 destroy_user_managed_scope(Application_Links *app, Managed_Scope scope){return(app->destroy_user_managed_scope(app, scope));}
static Managed_Scope get_global_managed_scope(Application_Links *app){return(app->get_global_managed_scope(app));} static Managed_Scope get_global_managed_scope(Application_Links *app){return(app->get_global_managed_scope(app));}
static Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *scopes, int32_t count){return(app->get_managed_scope_with_multiple_dependencies(app, scopes, count));} static Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *scopes, i32 count){return(app->get_managed_scope_with_multiple_dependencies(app, scopes, count));}
static b32 managed_scope_clear_contents(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_contents(app, scope));} static b32 managed_scope_clear_contents(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_contents(app, scope));}
static b32 managed_scope_clear_self_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_self_all_dependent_scopes(app, scope));} static b32 managed_scope_clear_self_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_self_all_dependent_scopes(app, scope));}
static Managed_Variable_ID managed_variable_create(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->managed_variable_create(app, null_terminated_name, default_value));} static Managed_Variable_ID managed_variable_create(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->managed_variable_create(app, null_terminated_name, default_value));}
@ -833,7 +833,7 @@ static Managed_Variable_ID managed_variable_create_or_get_id(Application_Links *
static b32 managed_variable_set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value){return(app->managed_variable_set(app, scope, id, value));} static b32 managed_variable_set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value){return(app->managed_variable_set(app, scope, id, value));}
static b32 managed_variable_get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out){return(app->managed_variable_get(app, scope, id, value_out));} static b32 managed_variable_get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out){return(app->managed_variable_get(app, scope, id, value_out));}
static Managed_Object alloc_managed_memory_in_scope(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count){return(app->alloc_managed_memory_in_scope(app, scope, item_size, count));} static Managed_Object alloc_managed_memory_in_scope(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count){return(app->alloc_managed_memory_in_scope(app, scope, item_size, count));}
static Managed_Object alloc_buffer_markers_on_buffer(Application_Links *app, Buffer_ID buffer_id, int32_t count, Managed_Scope *optional_extra_scope){return(app->alloc_buffer_markers_on_buffer(app, buffer_id, count, optional_extra_scope));} static Managed_Object alloc_buffer_markers_on_buffer(Application_Links *app, Buffer_ID buffer_id, i32 count, Managed_Scope *optional_extra_scope){return(app->alloc_buffer_markers_on_buffer(app, buffer_id, count, optional_extra_scope));}
static Managed_Object alloc_managed_arena_in_scope(Application_Links *app, Managed_Scope scope, i32 page_size){return(app->alloc_managed_arena_in_scope(app, scope, page_size));} static Managed_Object alloc_managed_arena_in_scope(Application_Links *app, Managed_Scope scope, i32 page_size){return(app->alloc_managed_arena_in_scope(app, scope, page_size));}
static Marker_Visual create_marker_visual(Application_Links *app, Managed_Object object){return(app->create_marker_visual(app, object));} static Marker_Visual create_marker_visual(Application_Links *app, Managed_Object object){return(app->create_marker_visual(app, object));}
static b32 marker_visual_set_effect(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style){return(app->marker_visual_set_effect(app, visual, type, color, text_color, text_style));} static b32 marker_visual_set_effect(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style){return(app->marker_visual_set_effect(app, visual, type, color, text_color, text_style));}
@ -841,28 +841,28 @@ static b32 marker_visual_set_take_rule(Application_Links *app, Marker_Visual vis
static b32 marker_visual_set_priority(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority){return(app->marker_visual_set_priority(app, visual, priority));} static b32 marker_visual_set_priority(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority){return(app->marker_visual_set_priority(app, visual, priority));}
static b32 marker_visual_set_view_key(Application_Links *app, Marker_Visual visual, View_ID key_view_id){return(app->marker_visual_set_view_key(app, visual, key_view_id));} static b32 marker_visual_set_view_key(Application_Links *app, Marker_Visual visual, View_ID key_view_id){return(app->marker_visual_set_view_key(app, visual, key_view_id));}
static b32 destroy_marker_visual(Application_Links *app, Marker_Visual visual){return(app->destroy_marker_visual(app, visual));} static b32 destroy_marker_visual(Application_Links *app, Marker_Visual visual){return(app->destroy_marker_visual(app, visual));}
static int32_t buffer_markers_get_attached_visual_count(Application_Links *app, Managed_Object object){return(app->buffer_markers_get_attached_visual_count(app, object));} static i32 buffer_markers_get_attached_visual_count(Application_Links *app, Managed_Object object){return(app->buffer_markers_get_attached_visual_count(app, object));}
static Marker_Visual* buffer_markers_get_attached_visual(Application_Links *app, Partition *part, Managed_Object object){return(app->buffer_markers_get_attached_visual(app, part, object));} static Marker_Visual* buffer_markers_get_attached_visual(Application_Links *app, Partition *part, Managed_Object object){return(app->buffer_markers_get_attached_visual(app, part, object));}
static uint32_t managed_object_get_item_size(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_size(app, object));} static u32 managed_object_get_item_size(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_size(app, object));}
static uint32_t managed_object_get_item_count(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_count(app, object));} static u32 managed_object_get_item_count(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_count(app, object));}
static Managed_Object_Type managed_object_get_type(Application_Links *app, Managed_Object object){return(app->managed_object_get_type(app, object));} static Managed_Object_Type managed_object_get_type(Application_Links *app, Managed_Object object){return(app->managed_object_get_type(app, object));}
static Managed_Scope managed_object_get_containing_scope(Application_Links *app, Managed_Object object){return(app->managed_object_get_containing_scope(app, object));} static Managed_Scope managed_object_get_containing_scope(Application_Links *app, Managed_Object object){return(app->managed_object_get_containing_scope(app, object));}
static b32 managed_object_free(Application_Links *app, Managed_Object object){return(app->managed_object_free(app, object));} static b32 managed_object_free(Application_Links *app, Managed_Object object){return(app->managed_object_free(app, object));}
static b32 managed_object_store_data(Application_Links *app, Managed_Object object, uint32_t first_index, uint32_t count, void *mem){return(app->managed_object_store_data(app, object, first_index, count, mem));} static b32 managed_object_store_data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem){return(app->managed_object_store_data(app, object, first_index, count, mem));}
static b32 managed_object_load_data(Application_Links *app, Managed_Object object, uint32_t first_index, uint32_t count, void *mem_out){return(app->managed_object_load_data(app, object, first_index, count, mem_out));} static b32 managed_object_load_data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem_out){return(app->managed_object_load_data(app, object, first_index, count, mem_out));}
static User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input(app, get_type, abort_type));} static User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input(app, get_type, abort_type));}
static User_Input get_command_input(Application_Links *app){return(app->get_command_input(app));} static User_Input get_command_input(Application_Links *app){return(app->get_command_input(app));}
static void set_command_input(Application_Links *app, Key_Event_Data key_data){(app->set_command_input(app, key_data));} static void set_command_input(Application_Links *app, Key_Event_Data key_data){(app->set_command_input(app, key_data));}
static Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse_state(app));} static Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse_state(app));}
static int32_t get_active_query_bars(Application_Links *app, View_ID view_id, int32_t max_result_count, Query_Bar **result_array){return(app->get_active_query_bars(app, view_id, max_result_count, result_array));} static i32 get_active_query_bars(Application_Links *app, View_ID view_id, i32 max_result_count, Query_Bar **result_array){return(app->get_active_query_bars(app, view_id, max_result_count, result_array));}
static b32 start_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){return(app->start_query_bar(app, bar, flags));} static b32 start_query_bar(Application_Links *app, Query_Bar *bar, u32 flags){return(app->start_query_bar(app, bar, flags));}
static void end_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){(app->end_query_bar(app, bar, flags));} static void end_query_bar(Application_Links *app, Query_Bar *bar, u32 flags){(app->end_query_bar(app, bar, flags));}
static b32 print_message(Application_Links *app, String message){return(app->print_message(app, message));} static b32 print_message(Application_Links *app, String message){return(app->print_message(app, message));}
static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id(app));} static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id(app));}
static b32 set_global_face(Application_Links *app, Face_ID id, b32 apply_to_all_buffers){return(app->set_global_face(app, id, apply_to_all_buffers));} static b32 set_global_face(Application_Links *app, Face_ID id, b32 apply_to_all_buffers){return(app->set_global_face(app, id, apply_to_all_buffers));}
static b32 buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_max_record_index(app, buffer_id, index_out));} static b32 buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_max_record_index(app, buffer_id, index_out));}
static b32 buffer_history_get_record_info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out){return(app->buffer_history_get_record_info(app, buffer_id, index, record_out));} static b32 buffer_history_get_record_info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out){return(app->buffer_history_get_record_info(app, buffer_id, index, record_out));}
static b32 buffer_history_get_group_sub_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, int32_t sub_index, Record_Info *record_out){return(app->buffer_history_get_group_sub_record(app, buffer_id, index, sub_index, record_out));} static b32 buffer_history_get_group_sub_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index, Record_Info *record_out){return(app->buffer_history_get_group_sub_record(app, buffer_id, index, sub_index, record_out));}
static b32 buffer_history_get_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_current_state_index(app, buffer_id, index_out));} static b32 buffer_history_get_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_current_state_index(app, buffer_id, index_out));}
static b32 buffer_history_set_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){return(app->buffer_history_set_current_state_index(app, buffer_id, index));} static b32 buffer_history_set_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){return(app->buffer_history_set_current_state_index(app, buffer_id, index));}
static b32 buffer_history_merge_record_range(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){return(app->buffer_history_merge_record_range(app, buffer_id, first_index, last_index, flags));} static b32 buffer_history_merge_record_range(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){return(app->buffer_history_merge_record_range(app, buffer_id, first_index, last_index, flags));}
@ -875,22 +875,22 @@ static b32 get_face_id(Application_Links *app, Buffer_ID buffer_id, Face_ID *fac
static Face_ID try_create_new_face(Application_Links *app, Face_Description *description){return(app->try_create_new_face(app, description));} static Face_ID try_create_new_face(Application_Links *app, Face_Description *description){return(app->try_create_new_face(app, description));}
static b32 try_modify_face(Application_Links *app, Face_ID id, Face_Description *description){return(app->try_modify_face(app, id, description));} static b32 try_modify_face(Application_Links *app, Face_ID id, Face_Description *description){return(app->try_modify_face(app, id, description));}
static b32 try_release_face(Application_Links *app, Face_ID id, Face_ID replacement_id){return(app->try_release_face(app, id, replacement_id));} static b32 try_release_face(Application_Links *app, Face_ID id, Face_ID replacement_id){return(app->try_release_face(app, id, replacement_id));}
static int32_t get_available_font_count(Application_Links *app){return(app->get_available_font_count(app));} static i32 get_available_font_count(Application_Links *app){return(app->get_available_font_count(app));}
static Available_Font get_available_font(Application_Links *app, int32_t index){return(app->get_available_font(app, index));} static Available_Font get_available_font(Application_Links *app, i32 index){return(app->get_available_font(app, index));}
static void set_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->set_theme_colors(app, colors, count));} static void set_theme_colors(Application_Links *app, Theme_Color *colors, i32 count){(app->set_theme_colors(app, colors, count));}
static void get_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->get_theme_colors(app, colors, count));} static void get_theme_colors(Application_Links *app, Theme_Color *colors, i32 count){(app->get_theme_colors(app, colors, count));}
static argb_color finalize_color(Application_Links *app, int_color color){return(app->finalize_color(app, color));} static argb_color finalize_color(Application_Links *app, int_color color){return(app->finalize_color(app, color));}
static int32_t get_hot_directory(Application_Links *app, String *out, int32_t *required_size_out){return(app->get_hot_directory(app, out, required_size_out));} static i32 get_hot_directory(Application_Links *app, String *out, i32 *required_size_out){return(app->get_hot_directory(app, out, required_size_out));}
static b32 set_hot_directory(Application_Links *app, String string){return(app->set_hot_directory(app, string));} static b32 set_hot_directory(Application_Links *app, String string){return(app->set_hot_directory(app, string));}
static b32 get_file_list(Application_Links *app, String directory, File_List *list_out){return(app->get_file_list(app, directory, list_out));} static b32 get_file_list(Application_Links *app, String directory, File_List *list_out){return(app->get_file_list(app, directory, list_out));}
static void free_file_list(Application_Links *app, File_List list){(app->free_file_list(app, list));} static void free_file_list(Application_Links *app, File_List list){(app->free_file_list(app, list));}
static void set_gui_up_down_keys(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier){(app->set_gui_up_down_keys(app, up_key, up_key_modifier, down_key, down_key_modifier));} static void set_gui_up_down_keys(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier){(app->set_gui_up_down_keys(app, up_key, up_key_modifier, down_key, down_key_modifier));}
static void* memory_allocate(Application_Links *app, int32_t size){return(app->memory_allocate(app, size));} static void* memory_allocate(Application_Links *app, i32 size){return(app->memory_allocate(app, size));}
static b32 memory_set_protection(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags){return(app->memory_set_protection(app, ptr, size, flags));} static b32 memory_set_protection(Application_Links *app, void *ptr, i32 size, Memory_Protect_Flags flags){return(app->memory_set_protection(app, ptr, size, flags));}
static void memory_free(Application_Links *app, void *ptr, int32_t size){(app->memory_free(app, ptr, size));} static void memory_free(Application_Links *app, void *ptr, i32 size){(app->memory_free(app, ptr, size));}
static b32 file_get_attributes(Application_Links *app, String file_name, File_Attributes *attributes_out){return(app->file_get_attributes(app, file_name, attributes_out));} static b32 file_get_attributes(Application_Links *app, String file_name, File_Attributes *attributes_out){return(app->file_get_attributes(app, file_name, attributes_out));}
static b32 directory_cd(Application_Links *app, String *directory, String relative_path){return(app->directory_cd(app, directory, relative_path));} static b32 directory_cd(Application_Links *app, String *directory, String relative_path){return(app->directory_cd(app, directory, relative_path));}
static b32 get_4ed_path(Application_Links *app, String *path_out, int32_t *required_size_out){return(app->get_4ed_path(app, path_out, required_size_out));} static b32 get_4ed_path(Application_Links *app, String *path_out, i32 *required_size_out){return(app->get_4ed_path(app, path_out, required_size_out));}
static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor(app, show));} static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor(app, show));}
static b32 set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){return(app->set_edit_finished_hook_repeat_speed(app, milliseconds));} static b32 set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){return(app->set_edit_finished_hook_repeat_speed(app, milliseconds));}
static b32 set_fullscreen(Application_Links *app, b32 full_screen){return(app->set_fullscreen(app, full_screen));} static b32 set_fullscreen(Application_Links *app, b32 full_screen){return(app->set_fullscreen(app, full_screen));}
@ -905,36 +905,36 @@ static void draw_rectangle_outline(Application_Links *app, f32_Rect rect, int_co
static Face_ID get_default_font_for_view(Application_Links *app, View_ID view_id){return(app->get_default_font_for_view(app, view_id));} static Face_ID get_default_font_for_view(Application_Links *app, View_ID view_id){return(app->get_default_font_for_view(app, view_id));}
static void open_color_picker(Application_Links *app, color_picker *picker){(app->open_color_picker(app, picker));} static void open_color_picker(Application_Links *app, color_picker *picker){(app->open_color_picker(app, picker));}
static void animate(Application_Links *app){(app->animate(app));} static void animate(Application_Links *app){(app->animate(app));}
static Found_String_List find_all_in_range_insensitive(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t end, String key, Partition *memory){return(app->find_all_in_range_insensitive(app, buffer_id, start, end, key, memory));} static Found_String_List find_all_in_range_insensitive(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 end, String key, Partition *memory){return(app->find_all_in_range_insensitive(app, buffer_id, start, end, key, memory));}
#else #else
static b32 global_set_setting(Application_Links *app, Global_Setting_ID setting, int32_t value){return(app->global_set_setting_(app, setting, value));} static b32 global_set_setting(Application_Links *app, Global_Setting_ID setting, i32 value){return(app->global_set_setting_(app, setting, value));}
static b32 global_set_mapping(Application_Links *app, void *data, int32_t size){return(app->global_set_mapping_(app, data, size));} static b32 global_set_mapping(Application_Links *app, void *data, i32 size){return(app->global_set_mapping_(app, data, size));}
static b32 exec_system_command(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags){return(app->exec_system_command_(app, view_id, buffer_id, path, command, flags));} static b32 exec_system_command(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags){return(app->exec_system_command_(app, view_id, buffer_id, path, command, flags));}
static b32 clipboard_post(Application_Links *app, int32_t clipboard_id, String string){return(app->clipboard_post_(app, clipboard_id, string));} static b32 clipboard_post(Application_Links *app, i32 clipboard_id, String string){return(app->clipboard_post_(app, clipboard_id, string));}
static b32 clipboard_count(Application_Links *app, int32_t clipboard_id, int32_t *count_out){return(app->clipboard_count_(app, clipboard_id, count_out));} static b32 clipboard_count(Application_Links *app, i32 clipboard_id, i32 *count_out){return(app->clipboard_count_(app, clipboard_id, count_out));}
static b32 clipboard_index(Application_Links *app, int32_t clipboard_id, int32_t item_index, String *string_out, int32_t *required_size_out){return(app->clipboard_index_(app, clipboard_id, item_index, string_out, required_size_out));} static b32 clipboard_index(Application_Links *app, i32 clipboard_id, i32 item_index, String *string_out, i32 *required_size_out){return(app->clipboard_index_(app, clipboard_id, item_index, string_out, required_size_out));}
static Parse_Context_ID create_parse_context(Application_Links *app, Parser_String_And_Type *kw, uint32_t kw_count, Parser_String_And_Type *pp, uint32_t pp_count){return(app->create_parse_context_(app, kw, kw_count, pp, pp_count));} static Parse_Context_ID create_parse_context(Application_Links *app, Parser_String_And_Type *kw, u32 kw_count, Parser_String_And_Type *pp, u32 pp_count){return(app->create_parse_context_(app, kw, kw_count, pp, pp_count));}
static int32_t get_buffer_count(Application_Links *app){return(app->get_buffer_count_(app));} static i32 get_buffer_count(Application_Links *app){return(app->get_buffer_count_(app));}
static b32 get_buffer_first(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_first_(app, access, buffer_id_out));} static b32 get_buffer_first(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_first_(app, access, buffer_id_out));}
static b32 get_buffer_next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_next_(app, buffer_id, access, buffer_id_out));} static b32 get_buffer_next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_next_(app, buffer_id, access, buffer_id_out));}
static b32 get_buffer_summary(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out){return(app->get_buffer_summary_(app, buffer_id, access, buffer_summary_out));} static b32 get_buffer_summary(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out){return(app->get_buffer_summary_(app, buffer_id, access, buffer_summary_out));}
static b32 get_buffer_by_name(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_name_(app, name, access, buffer_id_out));} static b32 get_buffer_by_name(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_name_(app, name, access, buffer_id_out));}
static b32 get_buffer_by_file_name(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_file_name_(app, file_name, access, buffer_id_out));} static b32 get_buffer_by_file_name(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_file_name_(app, file_name, access, buffer_id_out));}
static b32 buffer_read_range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, char *out){return(app->buffer_read_range_(app, buffer_id, start, one_past_last, out));} static b32 buffer_read_range(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, char *out){return(app->buffer_read_range_(app, buffer_id, start, one_past_last, out));}
static b32 buffer_replace_range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String string){return(app->buffer_replace_range_(app, buffer_id, start, one_past_last, string));} static b32 buffer_replace_range(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, String string){return(app->buffer_replace_range_(app, buffer_id, start, one_past_last, string));}
static b32 buffer_set_edit_handler(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler){return(app->buffer_set_edit_handler_(app, buffer_id, handler));} static b32 buffer_set_edit_handler(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler){return(app->buffer_set_edit_handler_(app, buffer_id, handler));}
static b32 buffer_compute_cursor(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out){return(app->buffer_compute_cursor_(app, buffer_id, seek, cursor_out));} static b32 buffer_compute_cursor(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out){return(app->buffer_compute_cursor_(app, buffer_id, seek, cursor_out));}
static b32 buffer_batch_edit(Application_Links *app, Buffer_ID buffer_id, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type){return(app->buffer_batch_edit_(app, buffer_id, str, str_len, edits, edit_count, type));} static b32 buffer_batch_edit(Application_Links *app, Buffer_ID buffer_id, char *str, i32 str_len, Buffer_Edit *edits, i32 edit_count, Buffer_Batch_Edit_Type type){return(app->buffer_batch_edit_(app, buffer_id, str, str_len, edits, edit_count, type));}
static b32 buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t *value_out){return(app->buffer_get_setting_(app, buffer_id, setting, value_out));} static b32 buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 *value_out){return(app->buffer_get_setting_(app, buffer_id, setting, value_out));}
static b32 buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t value){return(app->buffer_set_setting_(app, buffer_id, setting, value));} static b32 buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value){return(app->buffer_set_setting_(app, buffer_id, setting, value));}
static b32 buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out){return(app->buffer_get_managed_scope_(app, buffer_id, scope_out));} static b32 buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out){return(app->buffer_get_managed_scope_(app, buffer_id, scope_out));}
static b32 buffer_token_count(Application_Links *app, Buffer_ID buffer_id, int32_t *count_out){return(app->buffer_token_count_(app, buffer_id, count_out));} static b32 buffer_token_count(Application_Links *app, Buffer_ID buffer_id, i32 *count_out){return(app->buffer_token_count_(app, buffer_id, count_out));}
static b32 buffer_read_tokens(Application_Links *app, Buffer_ID buffer_id, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens_(app, buffer_id, start_token, end_token, tokens_out));} static b32 buffer_read_tokens(Application_Links *app, Buffer_ID buffer_id, i32 start_token, i32 end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens_(app, buffer_id, start_token, end_token, tokens_out));}
static b32 buffer_get_token_range(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){return(app->buffer_get_token_range_(app, buffer_id, first_token_out, one_past_last_token_out));} static b32 buffer_get_token_range(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){return(app->buffer_get_token_range_(app, buffer_id, first_token_out, one_past_last_token_out));}
static b32 buffer_get_token_index(Application_Links *app, Buffer_ID buffer_id, int32_t pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index_(app, buffer_id, pos, get_result));} static b32 buffer_get_token_index(Application_Links *app, Buffer_ID buffer_id, i32 pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index_(app, buffer_id, pos, get_result));}
static b32 buffer_send_end_signal(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_send_end_signal_(app, buffer_id));} static b32 buffer_send_end_signal(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_send_end_signal_(app, buffer_id));}
static b32 create_buffer(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out){return(app->create_buffer_(app, file_name, flags, new_buffer_id_out));} static b32 create_buffer(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out){return(app->create_buffer_(app, file_name, flags, new_buffer_id_out));}
static b32 buffer_save(Application_Links *app, Buffer_ID buffer_id, String file_name, uint32_t flags){return(app->buffer_save_(app, buffer_id, file_name, flags));} static b32 buffer_save(Application_Links *app, Buffer_ID buffer_id, String file_name, u32 flags){return(app->buffer_save_(app, buffer_id, file_name, flags));}
static b32 buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result){return(app->buffer_kill_(app, buffer_id, flags, result));} static b32 buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result){return(app->buffer_kill_(app, buffer_id, flags, result));}
static b32 buffer_reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result){return(app->buffer_reopen_(app, buffer_id, flags, result));} static b32 buffer_reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result){return(app->buffer_reopen_(app, buffer_id, flags, result));}
static b32 buffer_get_file_attributes(Application_Links *app, Buffer_ID buffer_id, File_Attributes *attributes_out){return(app->buffer_get_file_attributes_(app, buffer_id, attributes_out));} static b32 buffer_get_file_attributes(Application_Links *app, Buffer_ID buffer_id, File_Attributes *attributes_out){return(app->buffer_get_file_attributes_(app, buffer_id, attributes_out));}
@ -956,8 +956,8 @@ static b32 panel_get_max(Application_Links *app, Panel_ID panel_id, Panel_ID *pa
static b32 panel_get_margin(Application_Links *app, Panel_ID panel_id, i32_Rect *margins_out){return(app->panel_get_margin_(app, panel_id, margins_out));} static b32 panel_get_margin(Application_Links *app, Panel_ID panel_id, i32_Rect *margins_out){return(app->panel_get_margin_(app, panel_id, margins_out));}
static b32 view_close(Application_Links *app, View_ID view_id){return(app->view_close_(app, view_id));} static b32 view_close(Application_Links *app, View_ID view_id){return(app->view_close_(app, view_id));}
static b32 view_set_active(Application_Links *app, View_ID view_id){return(app->view_set_active_(app, view_id));} static b32 view_set_active(Application_Links *app, View_ID view_id){return(app->view_set_active_(app, view_id));}
static b32 view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t *value_out){return(app->view_get_setting_(app, view_id, setting, value_out));} static b32 view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 *value_out){return(app->view_get_setting_(app, view_id, setting, value_out));}
static b32 view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t value){return(app->view_set_setting_(app, view_id, setting, value));} static b32 view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 value){return(app->view_set_setting_(app, view_id, setting, value));}
static b32 view_get_managed_scope(Application_Links *app, View_ID view_id, Managed_Scope *scope){return(app->view_get_managed_scope_(app, view_id, scope));} static b32 view_get_managed_scope(Application_Links *app, View_ID view_id, Managed_Scope *scope){return(app->view_get_managed_scope_(app, view_id, scope));}
static b32 view_get_enclosure_rect(Application_Links *app, View_ID view_id, i32_Rect *rect_out){return(app->view_get_enclosure_rect_(app, view_id, rect_out));} static b32 view_get_enclosure_rect(Application_Links *app, View_ID view_id, i32_Rect *rect_out){return(app->view_get_enclosure_rect_(app, view_id, rect_out));}
static b32 view_compute_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor_(app, view_id, seek, cursor_out));} static b32 view_compute_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor_(app, view_id, seek, cursor_out));}
@ -965,7 +965,7 @@ static b32 view_set_cursor(Application_Links *app, View_ID view_id, Buffer_Seek
static b32 view_set_scroll(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll){return(app->view_set_scroll_(app, view_id, scroll));} static b32 view_set_scroll(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll){return(app->view_set_scroll_(app, view_id, scroll));}
static b32 view_set_mark(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_set_mark_(app, view_id, seek));} static b32 view_set_mark(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_set_mark_(app, view_id, seek));}
static b32 view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer_(app, view_id, buffer_id, flags));} static b32 view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer_(app, view_id, buffer_id, flags));}
static b32 view_post_fade(Application_Links *app, View_ID view_id, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade_(app, view_id, seconds, start, end, color));} static b32 view_post_fade(Application_Links *app, View_ID view_id, float seconds, i32 start, i32 end, int_color color){return(app->view_post_fade_(app, view_id, seconds, start, end, color));}
static b32 view_begin_ui_mode(Application_Links *app, View_ID view_id){return(app->view_begin_ui_mode_(app, view_id));} static b32 view_begin_ui_mode(Application_Links *app, View_ID view_id){return(app->view_begin_ui_mode_(app, view_id));}
static b32 view_end_ui_mode(Application_Links *app, View_ID view_id){return(app->view_end_ui_mode_(app, view_id));} static b32 view_end_ui_mode(Application_Links *app, View_ID view_id){return(app->view_end_ui_mode_(app, view_id));}
static b32 view_is_in_ui_mode(Application_Links *app, View_ID view_id){return(app->view_is_in_ui_mode_(app, view_id));} static b32 view_is_in_ui_mode(Application_Links *app, View_ID view_id){return(app->view_is_in_ui_mode_(app, view_id));}
@ -974,7 +974,7 @@ static b32 view_get_quit_ui_handler(Application_Links *app, View_ID view_id, UI_
static Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope_(app));} static Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope_(app));}
static b32 destroy_user_managed_scope(Application_Links *app, Managed_Scope scope){return(app->destroy_user_managed_scope_(app, scope));} static b32 destroy_user_managed_scope(Application_Links *app, Managed_Scope scope){return(app->destroy_user_managed_scope_(app, scope));}
static Managed_Scope get_global_managed_scope(Application_Links *app){return(app->get_global_managed_scope_(app));} static Managed_Scope get_global_managed_scope(Application_Links *app){return(app->get_global_managed_scope_(app));}
static Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *scopes, int32_t count){return(app->get_managed_scope_with_multiple_dependencies_(app, scopes, count));} static Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *scopes, i32 count){return(app->get_managed_scope_with_multiple_dependencies_(app, scopes, count));}
static b32 managed_scope_clear_contents(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_contents_(app, scope));} static b32 managed_scope_clear_contents(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_contents_(app, scope));}
static b32 managed_scope_clear_self_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_self_all_dependent_scopes_(app, scope));} static b32 managed_scope_clear_self_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_self_all_dependent_scopes_(app, scope));}
static Managed_Variable_ID managed_variable_create(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->managed_variable_create_(app, null_terminated_name, default_value));} static Managed_Variable_ID managed_variable_create(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->managed_variable_create_(app, null_terminated_name, default_value));}
@ -983,7 +983,7 @@ static Managed_Variable_ID managed_variable_create_or_get_id(Application_Links *
static b32 managed_variable_set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value){return(app->managed_variable_set_(app, scope, id, value));} static b32 managed_variable_set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value){return(app->managed_variable_set_(app, scope, id, value));}
static b32 managed_variable_get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out){return(app->managed_variable_get_(app, scope, id, value_out));} static b32 managed_variable_get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out){return(app->managed_variable_get_(app, scope, id, value_out));}
static Managed_Object alloc_managed_memory_in_scope(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count){return(app->alloc_managed_memory_in_scope_(app, scope, item_size, count));} static Managed_Object alloc_managed_memory_in_scope(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count){return(app->alloc_managed_memory_in_scope_(app, scope, item_size, count));}
static Managed_Object alloc_buffer_markers_on_buffer(Application_Links *app, Buffer_ID buffer_id, int32_t count, Managed_Scope *optional_extra_scope){return(app->alloc_buffer_markers_on_buffer_(app, buffer_id, count, optional_extra_scope));} static Managed_Object alloc_buffer_markers_on_buffer(Application_Links *app, Buffer_ID buffer_id, i32 count, Managed_Scope *optional_extra_scope){return(app->alloc_buffer_markers_on_buffer_(app, buffer_id, count, optional_extra_scope));}
static Managed_Object alloc_managed_arena_in_scope(Application_Links *app, Managed_Scope scope, i32 page_size){return(app->alloc_managed_arena_in_scope_(app, scope, page_size));} static Managed_Object alloc_managed_arena_in_scope(Application_Links *app, Managed_Scope scope, i32 page_size){return(app->alloc_managed_arena_in_scope_(app, scope, page_size));}
static Marker_Visual create_marker_visual(Application_Links *app, Managed_Object object){return(app->create_marker_visual_(app, object));} static Marker_Visual create_marker_visual(Application_Links *app, Managed_Object object){return(app->create_marker_visual_(app, object));}
static b32 marker_visual_set_effect(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style){return(app->marker_visual_set_effect_(app, visual, type, color, text_color, text_style));} static b32 marker_visual_set_effect(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style){return(app->marker_visual_set_effect_(app, visual, type, color, text_color, text_style));}
@ -991,28 +991,28 @@ static b32 marker_visual_set_take_rule(Application_Links *app, Marker_Visual vis
static b32 marker_visual_set_priority(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority){return(app->marker_visual_set_priority_(app, visual, priority));} static b32 marker_visual_set_priority(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority){return(app->marker_visual_set_priority_(app, visual, priority));}
static b32 marker_visual_set_view_key(Application_Links *app, Marker_Visual visual, View_ID key_view_id){return(app->marker_visual_set_view_key_(app, visual, key_view_id));} static b32 marker_visual_set_view_key(Application_Links *app, Marker_Visual visual, View_ID key_view_id){return(app->marker_visual_set_view_key_(app, visual, key_view_id));}
static b32 destroy_marker_visual(Application_Links *app, Marker_Visual visual){return(app->destroy_marker_visual_(app, visual));} static b32 destroy_marker_visual(Application_Links *app, Marker_Visual visual){return(app->destroy_marker_visual_(app, visual));}
static int32_t buffer_markers_get_attached_visual_count(Application_Links *app, Managed_Object object){return(app->buffer_markers_get_attached_visual_count_(app, object));} static i32 buffer_markers_get_attached_visual_count(Application_Links *app, Managed_Object object){return(app->buffer_markers_get_attached_visual_count_(app, object));}
static Marker_Visual* buffer_markers_get_attached_visual(Application_Links *app, Partition *part, Managed_Object object){return(app->buffer_markers_get_attached_visual_(app, part, object));} static Marker_Visual* buffer_markers_get_attached_visual(Application_Links *app, Partition *part, Managed_Object object){return(app->buffer_markers_get_attached_visual_(app, part, object));}
static uint32_t managed_object_get_item_size(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_size_(app, object));} static u32 managed_object_get_item_size(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_size_(app, object));}
static uint32_t managed_object_get_item_count(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_count_(app, object));} static u32 managed_object_get_item_count(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_count_(app, object));}
static Managed_Object_Type managed_object_get_type(Application_Links *app, Managed_Object object){return(app->managed_object_get_type_(app, object));} static Managed_Object_Type managed_object_get_type(Application_Links *app, Managed_Object object){return(app->managed_object_get_type_(app, object));}
static Managed_Scope managed_object_get_containing_scope(Application_Links *app, Managed_Object object){return(app->managed_object_get_containing_scope_(app, object));} static Managed_Scope managed_object_get_containing_scope(Application_Links *app, Managed_Object object){return(app->managed_object_get_containing_scope_(app, object));}
static b32 managed_object_free(Application_Links *app, Managed_Object object){return(app->managed_object_free_(app, object));} static b32 managed_object_free(Application_Links *app, Managed_Object object){return(app->managed_object_free_(app, object));}
static b32 managed_object_store_data(Application_Links *app, Managed_Object object, uint32_t first_index, uint32_t count, void *mem){return(app->managed_object_store_data_(app, object, first_index, count, mem));} static b32 managed_object_store_data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem){return(app->managed_object_store_data_(app, object, first_index, count, mem));}
static b32 managed_object_load_data(Application_Links *app, Managed_Object object, uint32_t first_index, uint32_t count, void *mem_out){return(app->managed_object_load_data_(app, object, first_index, count, mem_out));} static b32 managed_object_load_data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem_out){return(app->managed_object_load_data_(app, object, first_index, count, mem_out));}
static User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input_(app, get_type, abort_type));} static User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input_(app, get_type, abort_type));}
static User_Input get_command_input(Application_Links *app){return(app->get_command_input_(app));} static User_Input get_command_input(Application_Links *app){return(app->get_command_input_(app));}
static void set_command_input(Application_Links *app, Key_Event_Data key_data){(app->set_command_input_(app, key_data));} static void set_command_input(Application_Links *app, Key_Event_Data key_data){(app->set_command_input_(app, key_data));}
static Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse_state_(app));} static Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse_state_(app));}
static int32_t get_active_query_bars(Application_Links *app, View_ID view_id, int32_t max_result_count, Query_Bar **result_array){return(app->get_active_query_bars_(app, view_id, max_result_count, result_array));} static i32 get_active_query_bars(Application_Links *app, View_ID view_id, i32 max_result_count, Query_Bar **result_array){return(app->get_active_query_bars_(app, view_id, max_result_count, result_array));}
static b32 start_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){return(app->start_query_bar_(app, bar, flags));} static b32 start_query_bar(Application_Links *app, Query_Bar *bar, u32 flags){return(app->start_query_bar_(app, bar, flags));}
static void end_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){(app->end_query_bar_(app, bar, flags));} static void end_query_bar(Application_Links *app, Query_Bar *bar, u32 flags){(app->end_query_bar_(app, bar, flags));}
static b32 print_message(Application_Links *app, String message){return(app->print_message_(app, message));} static b32 print_message(Application_Links *app, String message){return(app->print_message_(app, message));}
static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id_(app));} static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id_(app));}
static b32 set_global_face(Application_Links *app, Face_ID id, b32 apply_to_all_buffers){return(app->set_global_face_(app, id, apply_to_all_buffers));} static b32 set_global_face(Application_Links *app, Face_ID id, b32 apply_to_all_buffers){return(app->set_global_face_(app, id, apply_to_all_buffers));}
static b32 buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_max_record_index_(app, buffer_id, index_out));} static b32 buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_max_record_index_(app, buffer_id, index_out));}
static b32 buffer_history_get_record_info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out){return(app->buffer_history_get_record_info_(app, buffer_id, index, record_out));} static b32 buffer_history_get_record_info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out){return(app->buffer_history_get_record_info_(app, buffer_id, index, record_out));}
static b32 buffer_history_get_group_sub_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, int32_t sub_index, Record_Info *record_out){return(app->buffer_history_get_group_sub_record_(app, buffer_id, index, sub_index, record_out));} static b32 buffer_history_get_group_sub_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index, Record_Info *record_out){return(app->buffer_history_get_group_sub_record_(app, buffer_id, index, sub_index, record_out));}
static b32 buffer_history_get_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_current_state_index_(app, buffer_id, index_out));} static b32 buffer_history_get_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_current_state_index_(app, buffer_id, index_out));}
static b32 buffer_history_set_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){return(app->buffer_history_set_current_state_index_(app, buffer_id, index));} static b32 buffer_history_set_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){return(app->buffer_history_set_current_state_index_(app, buffer_id, index));}
static b32 buffer_history_merge_record_range(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){return(app->buffer_history_merge_record_range_(app, buffer_id, first_index, last_index, flags));} static b32 buffer_history_merge_record_range(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){return(app->buffer_history_merge_record_range_(app, buffer_id, first_index, last_index, flags));}
@ -1025,22 +1025,22 @@ static b32 get_face_id(Application_Links *app, Buffer_ID buffer_id, Face_ID *fac
static Face_ID try_create_new_face(Application_Links *app, Face_Description *description){return(app->try_create_new_face_(app, description));} static Face_ID try_create_new_face(Application_Links *app, Face_Description *description){return(app->try_create_new_face_(app, description));}
static b32 try_modify_face(Application_Links *app, Face_ID id, Face_Description *description){return(app->try_modify_face_(app, id, description));} static b32 try_modify_face(Application_Links *app, Face_ID id, Face_Description *description){return(app->try_modify_face_(app, id, description));}
static b32 try_release_face(Application_Links *app, Face_ID id, Face_ID replacement_id){return(app->try_release_face_(app, id, replacement_id));} static b32 try_release_face(Application_Links *app, Face_ID id, Face_ID replacement_id){return(app->try_release_face_(app, id, replacement_id));}
static int32_t get_available_font_count(Application_Links *app){return(app->get_available_font_count_(app));} static i32 get_available_font_count(Application_Links *app){return(app->get_available_font_count_(app));}
static Available_Font get_available_font(Application_Links *app, int32_t index){return(app->get_available_font_(app, index));} static Available_Font get_available_font(Application_Links *app, i32 index){return(app->get_available_font_(app, index));}
static void set_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->set_theme_colors_(app, colors, count));} static void set_theme_colors(Application_Links *app, Theme_Color *colors, i32 count){(app->set_theme_colors_(app, colors, count));}
static void get_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->get_theme_colors_(app, colors, count));} static void get_theme_colors(Application_Links *app, Theme_Color *colors, i32 count){(app->get_theme_colors_(app, colors, count));}
static argb_color finalize_color(Application_Links *app, int_color color){return(app->finalize_color_(app, color));} static argb_color finalize_color(Application_Links *app, int_color color){return(app->finalize_color_(app, color));}
static int32_t get_hot_directory(Application_Links *app, String *out, int32_t *required_size_out){return(app->get_hot_directory_(app, out, required_size_out));} static i32 get_hot_directory(Application_Links *app, String *out, i32 *required_size_out){return(app->get_hot_directory_(app, out, required_size_out));}
static b32 set_hot_directory(Application_Links *app, String string){return(app->set_hot_directory_(app, string));} static b32 set_hot_directory(Application_Links *app, String string){return(app->set_hot_directory_(app, string));}
static b32 get_file_list(Application_Links *app, String directory, File_List *list_out){return(app->get_file_list_(app, directory, list_out));} static b32 get_file_list(Application_Links *app, String directory, File_List *list_out){return(app->get_file_list_(app, directory, list_out));}
static void free_file_list(Application_Links *app, File_List list){(app->free_file_list_(app, list));} static void free_file_list(Application_Links *app, File_List list){(app->free_file_list_(app, list));}
static void set_gui_up_down_keys(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier){(app->set_gui_up_down_keys_(app, up_key, up_key_modifier, down_key, down_key_modifier));} static void set_gui_up_down_keys(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier){(app->set_gui_up_down_keys_(app, up_key, up_key_modifier, down_key, down_key_modifier));}
static void* memory_allocate(Application_Links *app, int32_t size){return(app->memory_allocate_(app, size));} static void* memory_allocate(Application_Links *app, i32 size){return(app->memory_allocate_(app, size));}
static b32 memory_set_protection(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags){return(app->memory_set_protection_(app, ptr, size, flags));} static b32 memory_set_protection(Application_Links *app, void *ptr, i32 size, Memory_Protect_Flags flags){return(app->memory_set_protection_(app, ptr, size, flags));}
static void memory_free(Application_Links *app, void *ptr, int32_t size){(app->memory_free_(app, ptr, size));} static void memory_free(Application_Links *app, void *ptr, i32 size){(app->memory_free_(app, ptr, size));}
static b32 file_get_attributes(Application_Links *app, String file_name, File_Attributes *attributes_out){return(app->file_get_attributes_(app, file_name, attributes_out));} static b32 file_get_attributes(Application_Links *app, String file_name, File_Attributes *attributes_out){return(app->file_get_attributes_(app, file_name, attributes_out));}
static b32 directory_cd(Application_Links *app, String *directory, String relative_path){return(app->directory_cd_(app, directory, relative_path));} static b32 directory_cd(Application_Links *app, String *directory, String relative_path){return(app->directory_cd_(app, directory, relative_path));}
static b32 get_4ed_path(Application_Links *app, String *path_out, int32_t *required_size_out){return(app->get_4ed_path_(app, path_out, required_size_out));} static b32 get_4ed_path(Application_Links *app, String *path_out, i32 *required_size_out){return(app->get_4ed_path_(app, path_out, required_size_out));}
static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor_(app, show));} static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor_(app, show));}
static b32 set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){return(app->set_edit_finished_hook_repeat_speed_(app, milliseconds));} static b32 set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){return(app->set_edit_finished_hook_repeat_speed_(app, milliseconds));}
static b32 set_fullscreen(Application_Links *app, b32 full_screen){return(app->set_fullscreen_(app, full_screen));} static b32 set_fullscreen(Application_Links *app, b32 full_screen){return(app->set_fullscreen_(app, full_screen));}
@ -1055,5 +1055,5 @@ static void draw_rectangle_outline(Application_Links *app, f32_Rect rect, int_co
static Face_ID get_default_font_for_view(Application_Links *app, View_ID view_id){return(app->get_default_font_for_view_(app, view_id));} static Face_ID get_default_font_for_view(Application_Links *app, View_ID view_id){return(app->get_default_font_for_view_(app, view_id));}
static void open_color_picker(Application_Links *app, color_picker *picker){(app->open_color_picker_(app, picker));} static void open_color_picker(Application_Links *app, color_picker *picker){(app->open_color_picker_(app, picker));}
static void animate(Application_Links *app){(app->animate_(app));} static void animate(Application_Links *app){(app->animate_(app));}
static Found_String_List find_all_in_range_insensitive(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t end, String key, Partition *memory){return(app->find_all_in_range_insensitive_(app, buffer_id, start, end, key, memory));} static Found_String_List find_all_in_range_insensitive(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 end, String key, Partition *memory){return(app->find_all_in_range_insensitive_(app, buffer_id, start, end, key, memory));}
#endif #endif

View File

@ -5,7 +5,7 @@
// TOP // TOP
static Buffer_Insertion static Buffer_Insertion
begin_buffer_insertion_at(Application_Links *app, Buffer_ID buffer_id, int32_t at){ begin_buffer_insertion_at(Application_Links *app, Buffer_ID buffer_id, i32 at){
Buffer_Insertion result = {}; Buffer_Insertion result = {};
result.app = app; result.app = app;
result.buffer = buffer_id; result.buffer = buffer_id;
@ -33,14 +33,14 @@ insert_string(Buffer_Insertion *insertion, String string){
insertion->at += string.size; insertion->at += string.size;
} }
static int32_t static i32
insertf(Buffer_Insertion *insertion, char *format, ...){ insertf(Buffer_Insertion *insertion, char *format, ...){
// TODO(casey): Allen, ideally we would have our own formatter here that just outputs into a buffer and can't ever "run out of space". // TODO(casey): Allen, ideally we would have our own formatter here that just outputs into a buffer and can't ever "run out of space".
char temp[1024]; char temp[1024];
va_list args; va_list args;
va_start(args, format); va_start(args, format);
int32_t result = vsprintf(temp, format, args); i32 result = vsprintf(temp, format, args);
va_end(args); va_end(args);
insert_string(insertion, make_string(temp, result)); insert_string(insertion, make_string(temp, result));
@ -55,7 +55,7 @@ insertc(Buffer_Insertion *insertion, char C){
} }
static b32 static b32
insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, int32_t line, int32_t truncate_at){ insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 line, i32 truncate_at){
Partition *part = &global_part; Partition *part = &global_part;
Temp_Memory temp = begin_temp_memory(part); Temp_Memory temp = begin_temp_memory(part);
@ -69,7 +69,7 @@ insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, int32_
if (buffer_compute_cursor(insertion->app, &buffer, seek_line_char(line, -1), &end)){ if (buffer_compute_cursor(insertion->app, &buffer, seek_line_char(line, -1), &end)){
if (begin.line == line){ if (begin.line == line){
if (0 <= begin.pos && begin.pos <= end.pos && end.pos <= buffer.size){ if (0 <= begin.pos && begin.pos <= end.pos && end.pos <= buffer.size){
int32_t size = (end.pos - begin.pos); i32 size = (end.pos - begin.pos);
if(truncate_at && (size > truncate_at)) if(truncate_at && (size > truncate_at))
{ {
size = truncate_at; size = truncate_at;
@ -93,7 +93,7 @@ insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, int32_
} }
static b32 static b32
insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, int32_t line){ insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 line){
return(insert_line_from_buffer(insertion, buffer_id, line, 0)); return(insert_line_from_buffer(insertion, buffer_id, line, 0));
} }

View File

@ -9,7 +9,7 @@ activate_jump(Application_Links *app, Partition *scratch, Heap *heap,
View_Summary *view, struct Lister_State *state, View_Summary *view, struct Lister_State *state,
String text_field, void *user_data, b32 activated_by_mouse){ String text_field, void *user_data, b32 activated_by_mouse){
Lister_Activation_Code result_code = ListerActivation_Finished; Lister_Activation_Code result_code = ListerActivation_Finished;
int32_t list_index = (int32_t)PtrAsInt(user_data); i32 list_index = (i32)PtrAsInt(user_data);
Jump_Lister_Parameters *params = (Jump_Lister_Parameters*)state->lister.data.user_data; Jump_Lister_Parameters *params = (Jump_Lister_Parameters*)state->lister.data.user_data;
Marker_List *list = get_marker_list_for_buffer(params->list_buffer_id); Marker_List *list = get_marker_list_for_buffer(params->list_buffer_id);
if (list != 0){ if (list != 0){
@ -70,13 +70,13 @@ open_jump_lister(Application_Links *app, Partition *scratch, Heap *heap,
if (list != 0){ if (list != 0){
Buffer_Summary list_buffer = get_buffer(app, list_buffer_id, AccessAll); Buffer_Summary list_buffer = get_buffer(app, list_buffer_id, AccessAll);
int32_t estimated_string_space_size = 0; i32 estimated_string_space_size = 0;
view_end_ui_mode(app, ui_view); view_end_ui_mode(app, ui_view);
Temp_Memory temp = begin_temp_memory(scratch); Temp_Memory temp = begin_temp_memory(scratch);
int32_t option_count = list->jump_count; i32 option_count = list->jump_count;
Lister_Option *options = push_array(scratch, Lister_Option, option_count); Lister_Option *options = push_array(scratch, Lister_Option, option_count);
Managed_Object stored_jumps = list->jump_array; Managed_Object stored_jumps = list->jump_array;
for (int32_t i = 0; i < option_count; i += 1){ for (i32 i = 0; i < option_count; i += 1){
Sticky_Jump_Stored stored = {}; Sticky_Jump_Stored stored = {};
managed_object_load_data(app, stored_jumps, i, 1, &stored); managed_object_load_data(app, stored_jumps, i, 1, &stored);
String line = {}; String line = {};
@ -84,7 +84,7 @@ open_jump_lister(Application_Links *app, Partition *scratch, Heap *heap,
options[i].string = line; options[i].string = line;
memset(&options[i].status, 0, sizeof(options[i].status)); memset(&options[i].status, 0, sizeof(options[i].status));
options[i].user_data = IntAsPtr(i); options[i].user_data = IntAsPtr(i);
int32_t aligned_size = line.size + 1 + 7; i32 aligned_size = line.size + 1 + 7;
aligned_size = aligned_size - aligned_size%8; aligned_size = aligned_size - aligned_size%8;
estimated_string_space_size += aligned_size; estimated_string_space_size += aligned_size;
} }

View File

@ -4,7 +4,7 @@
// TOP // TOP
typedef int32_t Jump_Lister_Activation_Rule; typedef i32 Jump_Lister_Activation_Rule;
enum{ enum{
JumpListerActivation_OpenInUIView = 0, JumpListerActivation_OpenInUIView = 0,
JumpListerActivation_OpenInTargetViewKeepUI = 1, JumpListerActivation_OpenInTargetViewKeepUI = 1,

View File

@ -5,25 +5,25 @@ and decrementing various forms of number as numerical objects despite being enco
// TOP // TOP
static int32_t static i32
get_numeric_string_at_cursor(Application_Links *app, Buffer_Summary *buffer, int32_t start_pos, int32_t *numeric_start, int32_t *numeric_end){ get_numeric_string_at_cursor(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, i32 *numeric_start, i32 *numeric_end){
int32_t result = 0; i32 result = 0;
char current = buffer_get_char(app, buffer, start_pos); char current = buffer_get_char(app, buffer, start_pos);
if (char_is_numeric(current)){ if (char_is_numeric(current)){
char chunk[1024]; char chunk[1024];
int32_t chunk_size = sizeof(chunk); i32 chunk_size = sizeof(chunk);
Stream_Chunk stream = {}; Stream_Chunk stream = {};
int32_t pos = start_pos; i32 pos = start_pos;
int32_t pos1 = 0; i32 pos1 = 0;
int32_t pos2 = 0; i32 pos2 = 0;
if (init_stream_chunk(&stream, app, buffer, start_pos, chunk, chunk_size)){ if (init_stream_chunk(&stream, app, buffer, start_pos, chunk, chunk_size)){
int32_t still_looping = 1; i32 still_looping = 1;
while (still_looping){ while (still_looping){
for (; pos >= stream.start; --pos){ for (; pos >= stream.start; --pos){
char at_pos = stream.data[pos]; char at_pos = stream.data[pos];
@ -63,22 +63,22 @@ get_numeric_string_at_cursor(Application_Links *app, Buffer_Summary *buffer, int
} }
struct Miblo_Number_Info{ struct Miblo_Number_Info{
int32_t start, end; i32 start, end;
int32_t x; i32 x;
}; };
static int32_t static i32
get_numeric_at_cursor(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Miblo_Number_Info *info){ get_numeric_at_cursor(Application_Links *app, Buffer_Summary *buffer, i32 pos, Miblo_Number_Info *info){
int32_t result = 0; i32 result = 0;
int32_t numeric_start = 0, numeric_end = 0; i32 numeric_start = 0, numeric_end = 0;
if (get_numeric_string_at_cursor(app, buffer, pos, &numeric_start, &numeric_end)){ if (get_numeric_string_at_cursor(app, buffer, pos, &numeric_start, &numeric_end)){
char numeric_string[1024]; char numeric_string[1024];
String str = make_string(numeric_string, numeric_end - numeric_start, sizeof(numeric_string)); String str = make_string(numeric_string, numeric_end - numeric_start, sizeof(numeric_string));
if (str.size < str.memory_size){ if (str.size < str.memory_size){
buffer_read_range(app, buffer, numeric_start, numeric_end, numeric_string); buffer_read_range(app, buffer, numeric_start, numeric_end, numeric_string);
int32_t x = str_to_int(str); i32 x = str_to_int(str);
int_to_str(&str, x+1); int_to_str(&str, x+1);
info->start = numeric_start; info->start = numeric_start;
@ -126,25 +126,25 @@ CUSTOM_DOC("Decrement an integer under the cursor by one.")
// NOTE(allen): miblo time stamp format // NOTE(allen): miblo time stamp format
// (h+:)?m?m:ss // (h+:)?m?m:ss
static int32_t static i32
get_timestamp_string_at_cursor(Application_Links *app, Buffer_Summary *buffer, int32_t start_pos, int32_t *timestamp_start, int32_t *timestamp_end){ get_timestamp_string_at_cursor(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, i32 *timestamp_start, i32 *timestamp_end){
int32_t result = 0; i32 result = 0;
char current = buffer_get_char(app, buffer, start_pos); char current = buffer_get_char(app, buffer, start_pos);
if (char_is_numeric(current) || current == ':'){ if (char_is_numeric(current) || current == ':'){
char chunk[1024]; char chunk[1024];
int32_t chunk_size = sizeof(chunk); i32 chunk_size = sizeof(chunk);
Stream_Chunk stream = {}; Stream_Chunk stream = {};
int32_t pos = start_pos; i32 pos = start_pos;
int32_t pos1 = 0; i32 pos1 = 0;
int32_t pos2 = 0; i32 pos2 = 0;
if (init_stream_chunk(&stream, app, buffer, start_pos, chunk, chunk_size)){ if (init_stream_chunk(&stream, app, buffer, start_pos, chunk, chunk_size)){
int32_t still_looping = 1; i32 still_looping = 1;
while (still_looping){ while (still_looping){
for (; pos >= stream.start; --pos){ for (; pos >= stream.start; --pos){
char at_pos = stream.data[pos]; char at_pos = stream.data[pos];
@ -184,9 +184,9 @@ get_timestamp_string_at_cursor(Application_Links *app, Buffer_Summary *buffer, i
} }
struct Miblo_Timestamp{ struct Miblo_Timestamp{
int32_t second; i32 second;
int32_t minute; i32 minute;
int32_t hour; i32 hour;
}; };
static Miblo_Timestamp null_miblo_timestamp = {}; static Miblo_Timestamp null_miblo_timestamp = {};
@ -197,7 +197,7 @@ enum{
}; };
static Miblo_Timestamp static Miblo_Timestamp
increment_timestamp(Miblo_Timestamp t, int32_t type, int32_t amt){ increment_timestamp(Miblo_Timestamp t, i32 type, i32 amt){
Miblo_Timestamp r = t; Miblo_Timestamp r = t;
switch (type){ switch (type){
case MIBLO_SECOND: /* CASE second */ case MIBLO_SECOND: /* CASE second */
@ -207,7 +207,7 @@ increment_timestamp(Miblo_Timestamp t, int32_t type, int32_t amt){
// 2. What is thrown away by (1) store in amt, divide by 60, round down even when negative. // 2. What is thrown away by (1) store in amt, divide by 60, round down even when negative.
amt = 0; amt = 0;
if (r.second < 0){ if (r.second < 0){
int32_t pos_second = -r.second; i32 pos_second = -r.second;
amt = -((pos_second + 59)/60); amt = -((pos_second + 59)/60);
r.second = 60 - (pos_second % 60); r.second = 60 - (pos_second % 60);
} }
@ -223,7 +223,7 @@ increment_timestamp(Miblo_Timestamp t, int32_t type, int32_t amt){
// 2. What is thrown away by (1) store in amt, divide by 60, round down even when negative. // 2. What is thrown away by (1) store in amt, divide by 60, round down even when negative.
amt = 0; amt = 0;
if (r.minute < 0){ if (r.minute < 0){
int32_t pos_minute = -r.minute; i32 pos_minute = -r.minute;
amt = -((pos_minute + 59)/60); amt = -((pos_minute + 59)/60);
r.minute = 60 - (pos_minute % 60); r.minute = 60 - (pos_minute % 60);
} }
@ -275,23 +275,23 @@ timestamp_to_str(String *dest, Miblo_Timestamp t){
} }
struct Miblo_Timestamp_Info{ struct Miblo_Timestamp_Info{
int32_t start, end; i32 start, end;
Miblo_Timestamp time; Miblo_Timestamp time;
}; };
static int32_t static i32
get_timestamp_at_cursor(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Miblo_Timestamp_Info *info){ get_timestamp_at_cursor(Application_Links *app, Buffer_Summary *buffer, i32 pos, Miblo_Timestamp_Info *info){
int32_t result = 0; i32 result = 0;
int32_t timestamp_start = 0, timestamp_end = 0; i32 timestamp_start = 0, timestamp_end = 0;
if (get_timestamp_string_at_cursor(app, buffer, pos, &timestamp_start, &timestamp_end)){ if (get_timestamp_string_at_cursor(app, buffer, pos, &timestamp_start, &timestamp_end)){
char timestamp_string[1024]; char timestamp_string[1024];
String str = make_string(timestamp_string, timestamp_end - timestamp_start, sizeof(timestamp_string)); String str = make_string(timestamp_string, timestamp_end - timestamp_start, sizeof(timestamp_string));
if (str.size < str.memory_size){ if (str.size < str.memory_size){
buffer_read_range(app, buffer, timestamp_start, timestamp_end, timestamp_string); buffer_read_range(app, buffer, timestamp_start, timestamp_end, timestamp_string);
int32_t count_colons = 0; i32 count_colons = 0;
for (int32_t i = 0; i < str.size; ++i){ for (i32 i = 0; i < str.size; ++i){
if (str.str[i] == ':'){ if (str.str[i] == ':'){
++count_colons; ++count_colons;
} }
@ -300,11 +300,11 @@ get_timestamp_at_cursor(Application_Links *app, Buffer_Summary *buffer, int32_t
if (count_colons == 1 || count_colons == 2){ if (count_colons == 1 || count_colons == 2){
Miblo_Timestamp t = {}; Miblo_Timestamp t = {};
int32_t success = 0; i32 success = 0;
int32_t i = 0; i32 i = 0;
int32_t number_start[3], number_end[3]; i32 number_start[3], number_end[3];
for (int32_t k = 0; k < 3; ++k){ for (i32 k = 0; k < 3; ++k){
number_start[k] = i; number_start[k] = i;
for (; i <= str.size; ++i){ for (; i <= str.size; ++i){
if (i == str.size || str.str[i] == ':'){ if (i == str.size || str.str[i] == ':'){
@ -358,7 +358,7 @@ get_timestamp_at_cursor(Application_Links *app, Buffer_Summary *buffer, int32_t
} }
static void static void
miblo_time_stamp_alter(Application_Links *app, int32_t unit_type, int32_t amt){ miblo_time_stamp_alter(Application_Links *app, i32 unit_type, i32 amt){
View_Summary view = get_active_view(app, AccessOpen); View_Summary view = get_active_view(app, AccessOpen);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen);

View File

@ -9,7 +9,7 @@ static Managed_Variable_ID mirror_root_loc = 0;
#define DefaultMirrorRootName "DEFAULT.mirror_root" #define DefaultMirrorRootName "DEFAULT.mirror_root"
static b32 static b32
mirror_edit_handler(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String text); mirror_edit_handler(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, String text);
//////////////////////////////// ////////////////////////////////
@ -82,18 +82,18 @@ mirror_end__inner(Application_Links *app, Managed_Object mirror){
struct Mirror__Binary_Search_Result{ struct Mirror__Binary_Search_Result{
b32 abutting; b32 abutting;
int32_t index; i32 index;
}; };
static Mirror__Binary_Search_Result static Mirror__Binary_Search_Result
mirror__binary_search_max_point_below(Marker *ranges, int32_t target, int32_t first, int32_t one_past_last){ mirror__binary_search_max_point_below(Marker *ranges, i32 target, i32 first, i32 one_past_last){
Mirror__Binary_Search_Result result = {}; Mirror__Binary_Search_Result result = {};
result.index = -1; result.index = -1;
first = (first*2) - 1; first = (first*2) - 1;
one_past_last = one_past_last*2; one_past_last = one_past_last*2;
for (;;){ for (;;){
int32_t mid = (first + one_past_last)/2; i32 mid = (first + one_past_last)/2;
int32_t pos = -1; i32 pos = -1;
if (mid != -1){ if (mid != -1){
Marker *marker = ranges + mid; Marker *marker = ranges + mid;
pos = marker->pos; pos = marker->pos;
@ -118,15 +118,15 @@ mirror__binary_search_max_point_below(Marker *ranges, int32_t target, int32_t fi
} }
static Mirror__Binary_Search_Result static Mirror__Binary_Search_Result
mirror__binary_search_min_point_above(Marker *ranges, int32_t target, int32_t first, int32_t one_past_last, mirror__binary_search_min_point_above(Marker *ranges, i32 target, i32 first, i32 one_past_last,
int32_t fake_index, int32_t fake_pos){ i32 fake_index, i32 fake_pos){
Mirror__Binary_Search_Result result = {}; Mirror__Binary_Search_Result result = {};
result.index = -1; result.index = -1;
first = first*2; first = first*2;
one_past_last = (one_past_last*2) + 1; one_past_last = (one_past_last*2) + 1;
for (;;){ for (;;){
int32_t mid = (first + one_past_last - 1)/2; i32 mid = (first + one_past_last - 1)/2;
int32_t pos = fake_pos; i32 pos = fake_pos;
if (mid != fake_index){ if (mid != fake_index){
Marker *marker = ranges + mid; Marker *marker = ranges + mid;
pos = marker->pos; pos = marker->pos;
@ -167,7 +167,7 @@ mirror__hot_from_data(Application_Links *app, Arena *arena, Mirror mirror_data){
} }
static b32 static b32
mirror__min_max_point_indices_not_intersecting(int32_t above_point, int32_t below_point, int32_t *range_index_out){ mirror__min_max_point_indices_not_intersecting(i32 above_point, i32 below_point, i32 *range_index_out){
b32 result = false; b32 result = false;
if (below_point < above_point && (above_point%2) == 0 && ((below_point + 2)%2) == 1){ if (below_point < above_point && (above_point%2) == 0 && ((below_point + 2)%2) == 1){
*range_index_out = above_point/2; *range_index_out = above_point/2;
@ -177,7 +177,7 @@ mirror__min_max_point_indices_not_intersecting(int32_t above_point, int32_t belo
} }
static b32 static b32
mirror__min_max_point_indices_contained(int32_t above_point, int32_t below_point, int32_t *range_index_out){ mirror__min_max_point_indices_contained(i32 above_point, i32 below_point, i32 *range_index_out){
b32 result = false; b32 result = false;
if (below_point < above_point && (above_point%2) == 1 && ((below_point + 2)%2) == 0){ if (below_point < above_point && (above_point%2) == 1 && ((below_point + 2)%2) == 0){
*range_index_out = above_point/2; *range_index_out = above_point/2;
@ -188,21 +188,21 @@ mirror__min_max_point_indices_contained(int32_t above_point, int32_t below_point
struct Mirror__Check_Range_Result{ struct Mirror__Check_Range_Result{
b32 passed_checks; b32 passed_checks;
int32_t insert_index; i32 insert_index;
}; };
static Mirror__Check_Range_Result static Mirror__Check_Range_Result
mirror__check_range_to_add(Application_Links *app, Arena *scratch, int32_t mirror_first, int32_t source_first, int32_t length, mirror__check_range_to_add(Application_Links *app, Arena *scratch, i32 mirror_first, i32 source_first, i32 length,
Buffer_Summary *source_buffer, Buffer_Summary *mirror_buffer, Mirror_Hot *mirror_hot, Buffer_Summary *source_buffer, Buffer_Summary *mirror_buffer, Mirror_Hot *mirror_hot,
int32_t collidable_indices_first, b32 auto_trust_text){ i32 collidable_indices_first, b32 auto_trust_text){
// check the new range for the following rules and determine the insert index // check the new range for the following rules and determine the insert index
Mirror__Check_Range_Result result = {}; Mirror__Check_Range_Result result = {};
result.insert_index = -1; result.insert_index = -1;
// 1. the source range must be entirely contained in the source buffer and // 1. the source range must be entirely contained in the source buffer and
// the mirror range must be entirely contained in the mirror buffer // the mirror range must be entirely contained in the mirror buffer
int32_t source_one_past_last = source_first + length; i32 source_one_past_last = source_first + length;
int32_t mirror_one_past_last = mirror_first + length; i32 mirror_one_past_last = mirror_first + length;
if (0 <= source_first && source_one_past_last <= source_buffer->size && if (0 <= source_first && source_one_past_last <= source_buffer->size &&
0 <= mirror_first && mirror_one_past_last <= mirror_buffer->size){ 0 <= mirror_first && mirror_one_past_last <= mirror_buffer->size){
@ -213,8 +213,8 @@ mirror__check_range_to_add(Application_Links *app, Arena *scratch, int32_t mirro
result.insert_index = 0; result.insert_index = 0;
} }
else{ else{
int32_t fake_index = mirror_hot->count*2; i32 fake_index = mirror_hot->count*2;
int32_t fake_pos = mirror_buffer->size + 1; i32 fake_pos = mirror_buffer->size + 1;
Mirror__Binary_Search_Result above_point = mirror__binary_search_min_point_above(mirror_hot->mirror_ranges, mirror_first, Mirror__Binary_Search_Result above_point = mirror__binary_search_min_point_above(mirror_hot->mirror_ranges, mirror_first,
collidable_indices_first, mirror_hot->count, collidable_indices_first, mirror_hot->count,
fake_index, fake_pos); fake_index, fake_pos);
@ -254,8 +254,8 @@ mirror__check_range_to_add(Application_Links *app, Arena *scratch, int32_t mirro
static b32 static b32
mirror_add_range__inner_check_optimization(Application_Links *app, Managed_Object mirror, Buffer_ID source, mirror_add_range__inner_check_optimization(Application_Links *app, Managed_Object mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t length, i32 mirror_first, i32 source_first, i32 length,
int32_t collidable_indices_first, b32 auto_trust_text, int32_t *insert_index_out){ i32 collidable_indices_first, b32 auto_trust_text, i32 *insert_index_out){
b32 result = false; b32 result = false;
if (length > 0){ if (length > 0){
Buffer_Summary source_buffer = {}; Buffer_Summary source_buffer = {};
@ -295,7 +295,7 @@ mirror_add_range__inner_check_optimization(Application_Links *app, Managed_Objec
if (check.passed_checks){ if (check.passed_checks){
// insert the new range at the insert index // insert the new range at the insert index
b32 r = true; b32 r = true;
int32_t insert_index = check.insert_index; i32 insert_index = check.insert_index;
*insert_index_out = insert_index; *insert_index_out = insert_index;
Marker mirror_range[2] = {}; Marker mirror_range[2] = {};
@ -328,7 +328,7 @@ mirror_add_range__inner_check_optimization(Application_Links *app, Managed_Objec
} }
Managed_Scope mirror_sub_scope = get_managed_scope_with_multiple_dependencies(app, scopes, 2); Managed_Scope mirror_sub_scope = get_managed_scope_with_multiple_dependencies(app, scopes, 2);
int32_t new_max = 256; i32 new_max = 256;
if (new_max <= mirror_data.max){ if (new_max <= mirror_data.max){
new_max = mirror_data.max*2; new_max = mirror_data.max*2;
} }
@ -339,7 +339,7 @@ mirror_add_range__inner_check_optimization(Application_Links *app, Managed_Objec
mirror_data.max = new_max; mirror_data.max = new_max;
// head ranges // head ranges
int32_t head_count = insert_index; i32 head_count = insert_index;
if (head_count > 0){ if (head_count > 0){
r = r && managed_object_store_data(app, mirror_data.source_buffer_ids, 0, head_count , mirror_hot.source_buffer_ids); r = r && managed_object_store_data(app, mirror_data.source_buffer_ids, 0, head_count , mirror_hot.source_buffer_ids);
r = r && managed_object_store_data(app, mirror_data.mirror_ranges , 0, head_count*2, mirror_hot.mirror_ranges ); r = r && managed_object_store_data(app, mirror_data.mirror_ranges , 0, head_count*2, mirror_hot.mirror_ranges );
@ -348,10 +348,10 @@ mirror_add_range__inner_check_optimization(Application_Links *app, Managed_Objec
} }
// tail ranges // tail ranges
int32_t tail_count = mirror_hot.count - insert_index; i32 tail_count = mirror_hot.count - insert_index;
if (tail_count > 0){ if (tail_count > 0){
int32_t to = insert_index + 1; i32 to = insert_index + 1;
int32_t from = insert_index; i32 from = insert_index;
r = r && managed_object_store_data(app, mirror_data.source_buffer_ids, to , tail_count , mirror_hot.source_buffer_ids + from); r = r && managed_object_store_data(app, mirror_data.source_buffer_ids, to , tail_count , mirror_hot.source_buffer_ids + from);
r = r && managed_object_store_data(app, mirror_data.mirror_ranges , to*2, tail_count*2, mirror_hot.mirror_ranges + from*2 ); r = r && managed_object_store_data(app, mirror_data.mirror_ranges , to*2, tail_count*2, mirror_hot.mirror_ranges + from*2 );
r = r && managed_object_store_data(app, mirror_data.source_ranges , to , tail_count , mirror_hot.source_ranges + from ); r = r && managed_object_store_data(app, mirror_data.source_ranges , to , tail_count , mirror_hot.source_ranges + from );
@ -381,8 +381,8 @@ mirror_add_range__inner_check_optimization(Application_Links *app, Managed_Objec
static b32 static b32
mirror_add_range__inner(Application_Links *app, Managed_Object mirror, Buffer_ID source, mirror_add_range__inner(Application_Links *app, Managed_Object mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t length){ i32 mirror_first, i32 source_first, i32 length){
int32_t ignore = 0; i32 ignore = 0;
return(mirror_add_range__inner_check_optimization(app, mirror, source, mirror_first, source_first, length, 0, false, &ignore)); return(mirror_add_range__inner_check_optimization(app, mirror, source, mirror_first, source_first, length, 0, false, &ignore));
} }
@ -466,7 +466,7 @@ mirror_end(Application_Links *app, Managed_Object mirror){
static b32 static b32
mirror_add_range(Application_Links *app, Managed_Object mirror, Buffer_ID source, mirror_add_range(Application_Links *app, Managed_Object mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t length){ i32 mirror_first, i32 source_first, i32 length){
mirror__global_init(app); mirror__global_init(app);
return(mirror_add_range__inner(app, mirror, source, mirror_first, source_first, length)); return(mirror_add_range__inner(app, mirror, source, mirror_first, source_first, length));
} }
@ -539,7 +539,7 @@ mirror_buffer_end(Application_Links *app, Buffer_ID mirror){
static b32 static b32
mirror_buffer_add_range_exact(Application_Links *app, Buffer_ID mirror, Buffer_ID source, mirror_buffer_add_range_exact(Application_Links *app, Buffer_ID mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t length){ i32 mirror_first, i32 source_first, i32 length){
mirror__global_init(app); mirror__global_init(app);
b32 result = false; b32 result = false;
Managed_Object mirror_object = mirror__buffer_to_object(app, mirror); Managed_Object mirror_object = mirror__buffer_to_object(app, mirror);
@ -549,10 +549,10 @@ mirror_buffer_add_range_exact(Application_Links *app, Buffer_ID mirror, Buffer_I
return(result); return(result);
} }
static int32_t static i32
mirror__range_loose_get_length(Application_Links *app, Buffer_ID mirror, Buffer_ID source, mirror__range_loose_get_length(Application_Links *app, Buffer_ID mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t max_length){ i32 mirror_first, i32 source_first, i32 max_length){
int32_t result = 0; i32 result = 0;
Arena arena = make_arena(app, (8 << 10)); Arena arena = make_arena(app, (8 << 10));
char *buffer_1 = push_array(&arena, char, max_length); char *buffer_1 = push_array(&arena, char, max_length);
char *buffer_2 = push_array(&arena, char, max_length); char *buffer_2 = push_array(&arena, char, max_length);
@ -572,10 +572,10 @@ mirror__range_loose_get_length(Application_Links *app, Buffer_ID mirror, Buffer_
static b32 static b32
mirror_buffer_add_range_loose(Application_Links *app, Buffer_ID mirror, Buffer_ID source, mirror_buffer_add_range_loose(Application_Links *app, Buffer_ID mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t max_length){ i32 mirror_first, i32 source_first, i32 max_length){
mirror__global_init(app); mirror__global_init(app);
b32 result = false; b32 result = false;
int32_t length = mirror__range_loose_get_length(app, mirror, source, mirror_first, source_first, max_length); i32 length = mirror__range_loose_get_length(app, mirror, source, mirror_first, source_first, max_length);
if (length > 0){ if (length > 0){
Managed_Object mirror_object = mirror__buffer_to_object(app, mirror); Managed_Object mirror_object = mirror__buffer_to_object(app, mirror);
if (mirror_object != 0){ if (mirror_object != 0){
@ -587,7 +587,7 @@ mirror_buffer_add_range_loose(Application_Links *app, Buffer_ID mirror, Buffer_I
static b32 static b32
mirror_buffer_insert_range(Application_Links *app, Buffer_ID mirror, Buffer_ID source, mirror_buffer_insert_range(Application_Links *app, Buffer_ID mirror, Buffer_ID source,
int32_t mirror_insert_pos, int32_t source_first, int32_t length){ i32 mirror_insert_pos, i32 source_first, i32 length){
mirror__global_init(app); mirror__global_init(app);
b32 result = false; b32 result = false;
Managed_Object mirror_object = mirror__buffer_to_object(app, mirror); Managed_Object mirror_object = mirror__buffer_to_object(app, mirror);
@ -672,13 +672,13 @@ mirror_buffer_refresh(Application_Links *app, Buffer_ID mirror){
} }
static void static void
mirror_quick_sort_mirror_ranges(Mirror_Range *ranges, int32_t first, int32_t one_past_last){ mirror_quick_sort_mirror_ranges(Mirror_Range *ranges, i32 first, i32 one_past_last){
int32_t last = one_past_last - 1; i32 last = one_past_last - 1;
if (first < last){ if (first < last){
int32_t pivot_mirror_first = ranges[last].mirror_first; i32 pivot_mirror_first = ranges[last].mirror_first;
int32_t j = first; i32 j = first;
for (int32_t i = first; i < last; i += 1){ for (i32 i = first; i < last; i += 1){
int32_t mirror_first = ranges[i].mirror_first; i32 mirror_first = ranges[i].mirror_first;
if (mirror_first < pivot_mirror_first){ if (mirror_first < pivot_mirror_first){
if (j < i){ if (j < i){
Mirror_Range t = ranges[i]; Mirror_Range t = ranges[i];
@ -693,19 +693,19 @@ mirror_quick_sort_mirror_ranges(Mirror_Range *ranges, int32_t first, int32_t one
ranges[last] = ranges[j]; ranges[last] = ranges[j];
ranges[j] = t; ranges[j] = t;
} }
int32_t pivot = j; i32 pivot = j;
mirror_quick_sort_mirror_ranges(ranges, first, pivot); mirror_quick_sort_mirror_ranges(ranges, first, pivot);
mirror_quick_sort_mirror_ranges(ranges, pivot + 1, one_past_last); mirror_quick_sort_mirror_ranges(ranges, pivot + 1, one_past_last);
} }
} }
static b32 static b32
mirror__check_range_array_sorting(Mirror_Range *ranges, int32_t count){ mirror__check_range_array_sorting(Mirror_Range *ranges, i32 count){
b32 result = true; b32 result = true;
int32_t prev_pos = -1; i32 prev_pos = -1;
for (int32_t i = 0; i < count; i += 1){ for (i32 i = 0; i < count; i += 1){
int32_t first = ranges[i].mirror_first; i32 first = ranges[i].mirror_first;
int32_t one_past_last = first + ranges[i].length; i32 one_past_last = first + ranges[i].length;
if (prev_pos < first && first <= one_past_last){ if (prev_pos < first && first <= one_past_last){
prev_pos = one_past_last; prev_pos = one_past_last;
} }
@ -718,7 +718,7 @@ mirror__check_range_array_sorting(Mirror_Range *ranges, int32_t count){
} }
static b32 static b32
mirror_buffer_add_range_exact_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, int32_t count){ mirror_buffer_add_range_exact_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, i32 count){
mirror__global_init(app); mirror__global_init(app);
b32 result = false; b32 result = false;
Managed_Object mirror_object = mirror__buffer_to_object(app, mirror); Managed_Object mirror_object = mirror__buffer_to_object(app, mirror);
@ -726,9 +726,9 @@ mirror_buffer_add_range_exact_array(Application_Links *app, Buffer_ID mirror, Mi
if (mirror__check_range_array_sorting(ranges, count)){ if (mirror__check_range_array_sorting(ranges, count)){
b32 r = true; b32 r = true;
Mirror_Range *range = ranges; Mirror_Range *range = ranges;
int32_t safe_to_ignore_index = 0; i32 safe_to_ignore_index = 0;
for (int32_t i = 0; i < count; i += 1, range += 1){ for (i32 i = 0; i < count; i += 1, range += 1){
int32_t new_range_index = 0; i32 new_range_index = 0;
if (range->length > 0){ if (range->length > 0){
if (!mirror_add_range__inner_check_optimization(app, mirror_object, range->source_buffer_id, if (!mirror_add_range__inner_check_optimization(app, mirror_object, range->source_buffer_id,
range->mirror_first, range->source_first, range->length, range->mirror_first, range->source_first, range->length,
@ -747,23 +747,23 @@ mirror_buffer_add_range_exact_array(Application_Links *app, Buffer_ID mirror, Mi
} }
static b32 static b32
mirror_buffer_add_range_loose_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, int32_t count){ mirror_buffer_add_range_loose_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, i32 count){
mirror__global_init(app); mirror__global_init(app);
b32 result = false; b32 result = false;
Managed_Object mirror_object = mirror__buffer_to_object(app, mirror); Managed_Object mirror_object = mirror__buffer_to_object(app, mirror);
if (mirror_object != 0){ if (mirror_object != 0){
{ {
Mirror_Range *range = ranges; Mirror_Range *range = ranges;
for (int32_t i = 0; i < count; i += 1, range += 1){ for (i32 i = 0; i < count; i += 1, range += 1){
range->length = mirror__range_loose_get_length(app, mirror, range->source_buffer_id, range->mirror_first, range->source_first, range->length); range->length = mirror__range_loose_get_length(app, mirror, range->source_buffer_id, range->mirror_first, range->source_first, range->length);
} }
} }
if (mirror__check_range_array_sorting(ranges, count)){ if (mirror__check_range_array_sorting(ranges, count)){
b32 r = true; b32 r = true;
Mirror_Range *range = ranges; Mirror_Range *range = ranges;
int32_t safe_to_ignore_index = 0; i32 safe_to_ignore_index = 0;
for (int32_t i = 0; i < count; i += 1, range += 1){ for (i32 i = 0; i < count; i += 1, range += 1){
int32_t new_range_index = 0; i32 new_range_index = 0;
if (range->length > 0){ if (range->length > 0){
if (!mirror_add_range__inner_check_optimization(app, mirror_object, range->source_buffer_id, if (!mirror_add_range__inner_check_optimization(app, mirror_object, range->source_buffer_id,
range->mirror_first, range->source_first, range->length, range->mirror_first, range->source_first, range->length,
@ -782,7 +782,7 @@ mirror_buffer_add_range_loose_array(Application_Links *app, Buffer_ID mirror, Mi
} }
static b32 static b32
mirror_buffer_insert_range_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, int32_t count){ mirror_buffer_insert_range_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, i32 count){
mirror__global_init(app); mirror__global_init(app);
b32 result = false; b32 result = false;
Managed_Object mirror_object = mirror__buffer_to_object(app, mirror); Managed_Object mirror_object = mirror__buffer_to_object(app, mirror);
@ -793,11 +793,11 @@ mirror_buffer_insert_range_array(Application_Links *app, Buffer_ID mirror, Mirro
if (mirror__check_range_array_sorting(ranges, count)){ if (mirror__check_range_array_sorting(ranges, count)){
b32 r = true; b32 r = true;
Mirror_Range *range = ranges; Mirror_Range *range = ranges;
int32_t safe_to_ignore_index = 0; i32 safe_to_ignore_index = 0;
int32_t total_shift = 0; i32 total_shift = 0;
Arena arena = make_arena(app, (8 << 10)); Arena arena = make_arena(app, (8 << 10));
for (int32_t i = 0; i < count; i += 1, range += 1){ for (i32 i = 0; i < count; i += 1, range += 1){
int32_t mirror_first = range->mirror_first + total_shift; i32 mirror_first = range->mirror_first + total_shift;
b32 did_insert = false; b32 did_insert = false;
{ {
Temp_Memory_Arena temp = begin_temp_memory(&arena); Temp_Memory_Arena temp = begin_temp_memory(&arena);
@ -810,7 +810,7 @@ mirror_buffer_insert_range_array(Application_Links *app, Buffer_ID mirror, Mirro
} }
end_temp_memory(temp); end_temp_memory(temp);
} }
int32_t new_range_index = 0; i32 new_range_index = 0;
if (range->length > 0){ if (range->length > 0){
if (!mirror_add_range__inner_check_optimization(app, mirror_object, range->source_buffer_id, if (!mirror_add_range__inner_check_optimization(app, mirror_object, range->source_buffer_id,
mirror_first, range->source_first, range->length, mirror_first, range->source_first, range->length,
@ -835,7 +835,7 @@ mirror_buffer_insert_range_array(Application_Links *app, Buffer_ID mirror, Mirro
//////////////////////////////// ////////////////////////////////
static b32 static b32
mirror_edit_handler(Application_Links *app, Buffer_ID buffer_id, int32_t first, int32_t one_past_last, String text){ mirror_edit_handler(Application_Links *app, Buffer_ID buffer_id, i32 first, i32 one_past_last, String text){
mirror__global_init(app); mirror__global_init(app);
b32 result = false; b32 result = false;
Buffer_Summary mirror_buffer = {}; Buffer_Summary mirror_buffer = {};
@ -857,14 +857,14 @@ mirror_edit_handler(Application_Links *app, Buffer_ID buffer_id, int32_t first,
unreflected_range = true; unreflected_range = true;
} }
else{ else{
int32_t fake_index = mirror_hot.count*2; i32 fake_index = mirror_hot.count*2;
int32_t fake_pos = mirror_buffer.size + 1; i32 fake_pos = mirror_buffer.size + 1;
Mirror__Binary_Search_Result above_point = mirror__binary_search_min_point_above(mirror_hot.mirror_ranges, first, Mirror__Binary_Search_Result above_point = mirror__binary_search_min_point_above(mirror_hot.mirror_ranges, first,
0, mirror_hot.count, 0, mirror_hot.count,
fake_index, fake_pos); fake_index, fake_pos);
Mirror__Binary_Search_Result below_point = mirror__binary_search_max_point_below(mirror_hot.mirror_ranges, one_past_last, Mirror__Binary_Search_Result below_point = mirror__binary_search_max_point_below(mirror_hot.mirror_ranges, one_past_last,
0, mirror_hot.count); 0, mirror_hot.count);
int32_t ignore = 0; i32 ignore = 0;
if (mirror__min_max_point_indices_not_intersecting(above_point.index, below_point.index, &ignore)){ if (mirror__min_max_point_indices_not_intersecting(above_point.index, below_point.index, &ignore)){
unreflected_range = true; unreflected_range = true;
} }
@ -898,10 +898,10 @@ mirror_edit_handler(Application_Links *app, Buffer_ID buffer_id, int32_t first,
if (!blocked){ if (!blocked){
b32 reflected_range = false; b32 reflected_range = false;
int32_t range_index = 0; i32 range_index = 0;
if (mirror_hot.count > 0){ if (mirror_hot.count > 0){
int32_t fake_index = mirror_hot.count*2; i32 fake_index = mirror_hot.count*2;
int32_t fake_pos = mirror_buffer.size + 1; i32 fake_pos = mirror_buffer.size + 1;
Mirror__Binary_Search_Result above_point = mirror__binary_search_min_point_above(mirror_hot.mirror_ranges, first, Mirror__Binary_Search_Result above_point = mirror__binary_search_min_point_above(mirror_hot.mirror_ranges, first,
0, mirror_hot.count, 0, mirror_hot.count,
fake_index, fake_pos); fake_index, fake_pos);
@ -920,14 +920,14 @@ mirror_edit_handler(Application_Links *app, Buffer_ID buffer_id, int32_t first,
Marker *mirror_range = mirror_hot.mirror_ranges + range_index*2; Marker *mirror_range = mirror_hot.mirror_ranges + range_index*2;
Marker source_range[2]; Marker source_range[2];
if (managed_object_load_data(app, source_range_object, 0, 2, source_range)){ if (managed_object_load_data(app, source_range_object, 0, 2, source_range)){
int32_t base_source_first = source_range[0].pos; i32 base_source_first = source_range[0].pos;
//int32_t base_source_one_past_last = source_range[1].pos; //i32 base_source_one_past_last = source_range[1].pos;
int32_t base_mirror_first = mirror_range[0].pos; i32 base_mirror_first = mirror_range[0].pos;
//int32_t base_mirror_one_past_last = mirror_range[1].pos; //i32 base_mirror_one_past_last = mirror_range[1].pos;
int32_t source_first = base_source_first + (first - base_mirror_first); i32 source_first = base_source_first + (first - base_mirror_first);
int32_t source_one_past_last = source_first + (one_past_last - first); i32 source_one_past_last = source_first + (one_past_last - first);
global_history_edit_group_begin(app); global_history_edit_group_begin(app);
if (buffer_replace_range(app, source, source_first, source_one_past_last, text)){ if (buffer_replace_range(app, source, source_first, source_one_past_last, text)){

View File

@ -7,20 +7,20 @@
struct Mirror_Range{ struct Mirror_Range{
Buffer_ID source_buffer_id; Buffer_ID source_buffer_id;
int32_t mirror_first; i32 mirror_first;
int32_t source_first; i32 source_first;
int32_t length; i32 length;
}; };
//////////////////////////////// ////////////////////////////////
typedef int32_t Mirror_Mode; typedef i32 Mirror_Mode;
enum{ enum{
MirrorMode_Constructing, MirrorMode_Constructing,
MirrorMode_Reflecting, MirrorMode_Reflecting,
}; };
typedef uint32_t Mirror_Flags; typedef u32 Mirror_Flags;
enum{ enum{
MirrorFlag_NoHighlight = 0x0, MirrorFlag_NoHighlight = 0x0,
MirrorFlag_CharacterRangeHighlight = 0x1, MirrorFlag_CharacterRangeHighlight = 0x1,
@ -35,15 +35,15 @@ struct Mirror{
Mirror_Mode mode; Mirror_Mode mode;
Mirror_Flags flags; Mirror_Flags flags;
Managed_Scope mirror_scope; Managed_Scope mirror_scope;
int32_t count; i32 count;
int32_t max; i32 max;
Managed_Object source_buffer_ids; Managed_Object source_buffer_ids;
Managed_Object mirror_ranges; Managed_Object mirror_ranges;
Managed_Object source_ranges; Managed_Object source_ranges;
}; };
struct Mirror_Hot{ struct Mirror_Hot{
int32_t count; i32 count;
Buffer_ID *source_buffer_ids; Buffer_ID *source_buffer_ids;
Marker *mirror_ranges; Marker *mirror_ranges;
Managed_Object *source_ranges; Managed_Object *source_ranges;
@ -56,7 +56,7 @@ struct Mirror_Hot{
static b32 mirror_init(Application_Links *app, Buffer_ID buffer, Mirror_Flags flags, Managed_Object *mirror_object_out); static b32 mirror_init(Application_Links *app, Buffer_ID buffer, Mirror_Flags flags, Managed_Object *mirror_object_out);
static b32 mirror_end(Application_Links *app, Managed_Object mirror); static b32 mirror_end(Application_Links *app, Managed_Object mirror);
static b32 mirror_add_range(Application_Links *app, Managed_Object mirror, Buffer_ID source, static b32 mirror_add_range(Application_Links *app, Managed_Object mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t length); i32 mirror_first, i32 source_first, i32 length);
static b32 mirror_set_mode(Application_Links *app, Managed_Object mirror, Mirror_Mode mode); static b32 mirror_set_mode(Application_Links *app, Managed_Object mirror, Mirror_Mode mode);
static b32 mirror_get_mode(Application_Links *app, Managed_Object mirror, Mirror_Mode *mode_out); static b32 mirror_get_mode(Application_Links *app, Managed_Object mirror, Mirror_Mode *mode_out);
static b32 mirror_set_flags(Application_Links *app, Managed_Object mirror, Mirror_Flags flags); static b32 mirror_set_flags(Application_Links *app, Managed_Object mirror, Mirror_Flags flags);
@ -69,11 +69,11 @@ static b32 mirror_get_flags(Application_Links *app, Managed_Object mirror, Mirr
static b32 mirror_buffer_create(Application_Links *app, String buffer_name, Mirror_Flags flags, Buffer_ID *mirror_buffer_id_out); static b32 mirror_buffer_create(Application_Links *app, String buffer_name, Mirror_Flags flags, Buffer_ID *mirror_buffer_id_out);
static b32 mirror_buffer_end(Application_Links *app, Buffer_ID mirror); static b32 mirror_buffer_end(Application_Links *app, Buffer_ID mirror);
static b32 mirror_buffer_add_range_exact(Application_Links *app, Buffer_ID mirror, Buffer_ID source, static b32 mirror_buffer_add_range_exact(Application_Links *app, Buffer_ID mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t length); i32 mirror_first, i32 source_first, i32 length);
static b32 mirror_buffer_add_range_loose(Application_Links *app, Buffer_ID mirror, Buffer_ID source, static b32 mirror_buffer_add_range_loose(Application_Links *app, Buffer_ID mirror, Buffer_ID source,
int32_t mirror_first, int32_t source_first, int32_t max_length); i32 mirror_first, i32 source_first, i32 max_length);
static b32 mirror_buffer_insert_range(Application_Links *app, Buffer_ID mirror, Buffer_ID source, static b32 mirror_buffer_insert_range(Application_Links *app, Buffer_ID mirror, Buffer_ID source,
int32_t mirror_insert_pos, int32_t source_first, int32_t length); i32 mirror_insert_pos, i32 source_first, i32 length);
static b32 mirror_buffer_set_mode(Application_Links *app, Buffer_ID mirror, Mirror_Mode mode); static b32 mirror_buffer_set_mode(Application_Links *app, Buffer_ID mirror, Mirror_Mode mode);
static b32 mirror_buffer_get_mode(Application_Links *app, Buffer_ID mirror, Mirror_Mode *mode_out); static b32 mirror_buffer_get_mode(Application_Links *app, Buffer_ID mirror, Mirror_Mode *mode_out);
static b32 mirror_buffer_set_flags(Application_Links *app, Buffer_ID mirror, Mirror_Flags flags); static b32 mirror_buffer_set_flags(Application_Links *app, Buffer_ID mirror, Mirror_Flags flags);
@ -81,11 +81,11 @@ static b32 mirror_buffer_get_flags(Application_Links *app, Buffer_ID mirror, Mi
static b32 mirror_buffer_refresh(Application_Links *app, Buffer_ID mirror); static b32 mirror_buffer_refresh(Application_Links *app, Buffer_ID mirror);
static void mirror_quick_sort_mirror_ranges(Mirror_Range *ranges, int32_t first, int32_t one_past_last); static void mirror_quick_sort_mirror_ranges(Mirror_Range *ranges, i32 first, i32 one_past_last);
static b32 mirror_buffer_add_range_exact_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, int32_t count); static b32 mirror_buffer_add_range_exact_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, i32 count);
static b32 mirror_buffer_add_range_loose_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, int32_t count); static b32 mirror_buffer_add_range_loose_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, i32 count);
static b32 mirror_buffer_insert_range_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, int32_t count); static b32 mirror_buffer_insert_range_array(Application_Links *app, Buffer_ID mirror, Mirror_Range *ranges, i32 count);
#endif #endif

View File

@ -32,7 +32,7 @@ mac_default_keys(Bind_Helper *context){
static Bind_Helper static Bind_Helper
get_context_on_global_part(void){ get_context_on_global_part(void){
Bind_Helper result = {}; Bind_Helper result = {};
int32_t size = (1 << 20); i32 size = (1 << 20);
for (;;){ for (;;){
void *data = push_array(&global_part, char, size); void *data = push_array(&global_part, char, size);
if (data != 0){ if (data != 0){

View File

@ -20,7 +20,7 @@ struct Statement_Parser{
Buffer_Summary *buffer; Buffer_Summary *buffer;
}; };
typedef int32_t Find_Scope_Token_Type; typedef i32 Find_Scope_Token_Type;
enum{ enum{
FindScopeTokenType_None = 0, FindScopeTokenType_None = 0,
FindScopeTokenType_Open = 1, FindScopeTokenType_Open = 1,

View File

@ -7,7 +7,7 @@
#if !defined(FCODER_SEARCH_H) #if !defined(FCODER_SEARCH_H)
#define FCODER_SEARCH_H #define FCODER_SEARCH_H
typedef int32_t Seek_Potential_Match_Direction; typedef i32 Seek_Potential_Match_Direction;
enum{ enum{
SeekPotentialMatch_Forward = 0, SeekPotentialMatch_Forward = 0,
SeekPotentialMatch_Backward = 1, SeekPotentialMatch_Backward = 1,
@ -19,14 +19,14 @@ enum{
FindResult_PastEnd, FindResult_PastEnd,
}; };
typedef int32_t Search_Range_Type; typedef i32 Search_Range_Type;
enum{ enum{
SearchRange_FrontToBack = 0, SearchRange_FrontToBack = 0,
SearchRange_BackToFront = 1, SearchRange_BackToFront = 1,
SearchRange_Wave = 2, SearchRange_Wave = 2,
}; };
typedef uint32_t Search_Range_Flag; typedef u32 Search_Range_Flag;
enum{ enum{
SearchFlag_MatchWholeWord = 0x0000, SearchFlag_MatchWholeWord = 0x0000,
SearchFlag_MatchWordPrefix = 0x0001, SearchFlag_MatchWordPrefix = 0x0001,
@ -36,43 +36,43 @@ enum{
}; };
struct Search_Range{ struct Search_Range{
int32_t type; i32 type;
uint32_t flags; u32 flags;
int32_t buffer; i32 buffer;
int32_t start; i32 start;
int32_t size; i32 size;
int32_t mid_start; i32 mid_start;
int32_t mid_size; i32 mid_size;
}; };
struct Search_Set{ struct Search_Set{
Search_Range *ranges; Search_Range *ranges;
int32_t count; i32 count;
int32_t max; i32 max;
}; };
struct Search_Key{ struct Search_Key{
char *base; char *base;
int32_t base_size; i32 base_size;
String words[16]; String words[16];
int32_t count; i32 count;
int32_t min_size; i32 min_size;
}; };
struct Search_Iter{ struct Search_Iter{
Search_Key key; Search_Key key;
int32_t pos; i32 pos;
int32_t back_pos; i32 back_pos;
int32_t i; i32 i;
int32_t range_initialized; i32 range_initialized;
}; };
struct Search_Match{ struct Search_Match{
Buffer_Summary buffer; Buffer_Summary buffer;
int32_t start; i32 start;
int32_t end; i32 end;
int32_t match_word_index; i32 match_word_index;
int32_t found_match; i32 found_match;
}; };
struct Word_Complete_State{ struct Word_Complete_State{
@ -80,9 +80,9 @@ struct Word_Complete_State{
Search_Iter iter; Search_Iter iter;
Table hits; Table hits;
String_Space str; String_Space str;
int32_t word_start; i32 word_start;
int32_t word_end; i32 word_end;
int32_t initialized; i32 initialized;
}; };
#endif #endif

View File

@ -4,7 +4,7 @@
#if !defined(FCODER_SEEK_H) #if !defined(FCODER_SEEK_H)
#define FCODER_SEEK_H #define FCODER_SEEK_H
typedef uint32_t Buffer_Seek_String_Flags; typedef u32 Buffer_Seek_String_Flags;
enum{ enum{
BufferSeekString_Backward = 1, BufferSeekString_Backward = 1,
BufferSeekString_CaseInsensitive = 2, BufferSeekString_CaseInsensitive = 2,

View File

@ -12,7 +12,7 @@ CUSTOM_DOC("If the command execute_any_cli has already been used, this will exec
String hot_directory = make_string_slowly(hot_directory_space); String hot_directory = make_string_slowly(hot_directory_space);
if (out_buffer.size > 0 && cmd.size > 0 && hot_directory.size > 0){ if (out_buffer.size > 0 && cmd.size > 0 && hot_directory.size > 0){
uint32_t access = AccessAll; u32 access = AccessAll;
View_Summary view = get_active_view(app, access); View_Summary view = get_active_view(app, access);
exec_system_command(app, &view, buffer_identifier(out_buffer.str, out_buffer.size), hot_directory.str, hot_directory.size, cmd.str, cmd.size, CLI_OverlapWithConflict | CLI_CursorAtEnd); exec_system_command(app, &view, buffer_identifier(out_buffer.str, out_buffer.size), hot_directory.str, hot_directory.size, cmd.str, cmd.size, CLI_OverlapWithConflict | CLI_CursorAtEnd);

View File

@ -36,7 +36,7 @@ struct UI_Item{
struct UI_List{ struct UI_List{
UI_Item *first; UI_Item *first;
UI_Item *last; UI_Item *last;
int32_t count; i32 count;
}; };
struct UI_Data{ struct UI_Data{
@ -53,7 +53,7 @@ struct UI_Storage{
//////////////////////////////// ////////////////////////////////
typedef int32_t Lister_Activation_Code; typedef i32 Lister_Activation_Code;
enum{ enum{
ListerActivation_Finished = 0, ListerActivation_Finished = 0,
ListerActivation_Continue = 1, ListerActivation_Continue = 1,
@ -72,21 +72,21 @@ struct Lister_Node{
String string; String string;
union{ union{
String status; String status;
int32_t index; i32 index;
}; };
void *user_data; void *user_data;
int32_t raw_index; i32 raw_index;
}; };
struct Lister_Option_List{ struct Lister_Option_List{
Lister_Node *first; Lister_Node *first;
Lister_Node *last; Lister_Node *last;
int32_t count; i32 count;
}; };
struct Lister_Node_Ptr_Array{ struct Lister_Node_Ptr_Array{
Lister_Node **node_ptrs; Lister_Node **node_ptrs;
int32_t count; i32 count;
}; };
struct Lister_Handlers{ struct Lister_Handlers{
@ -104,7 +104,7 @@ struct Lister_Data{
// List Data // List Data
void *user_data; void *user_data;
int32_t user_data_size; i32 user_data_size;
char query_space[256]; char query_space[256];
String query; String query;
char text_field_space[256]; char text_field_space[256];
@ -129,11 +129,11 @@ struct Lister_State{
// State set directly by input handlers // State set directly by input handlers
void *hot_user_data; void *hot_user_data;
int32_t item_index; i32 item_index;
// State of UI computed during UI update // State of UI computed during UI update
int32_t raw_item_index; i32 raw_item_index;
int32_t item_count_after_filter; i32 item_count_after_filter;
}; };
struct Lister_Prealloced_String{ struct Lister_Prealloced_String{
@ -157,7 +157,7 @@ struct Lister_Fixed_Option{
struct Lister_UI_Option{ struct Lister_UI_Option{
char *string; char *string;
int32_t index; i32 index;
void *user_data; void *user_data;
}; };

View File

@ -53,7 +53,7 @@ fill_view_summary(System_Functions *system, View_Summary *view, View *vptr, Live
if (vptr->in_use){ if (vptr->in_use){
view->exists = true; view->exists = true;
view->view_id = (int32_t)(vptr - live_set->views) + 1; view->view_id = (i32)(vptr - live_set->views) + 1;
view->line_height = (f32)(vptr->line_height); view->line_height = (f32)(vptr->line_height);
view->unwrapped_lines = data->file->settings.unwrapped_lines; view->unwrapped_lines = data->file->settings.unwrapped_lines;
view->show_whitespace = data->show_whitespace; view->show_whitespace = data->show_whitespace;
@ -155,7 +155,7 @@ panel_api_check_panel(Panel *panel){
} }
API_EXPORT b32 API_EXPORT b32
Global_Set_Setting(Application_Links *app, Global_Setting_ID setting, int32_t value) Global_Set_Setting(Application_Links *app, Global_Setting_ID setting, i32 value)
/* /*
DOC_PARAM(setting, Which setting to change.) DOC_PARAM(setting, Which setting to change.)
DOC_PARAM(value, The new value to set ont he specified setting.) DOC_PARAM(value, The new value to set ont he specified setting.)
@ -180,7 +180,7 @@ DOC_SEE(Global_Setting_ID)
} }
API_EXPORT b32 API_EXPORT b32
Global_Set_Mapping(Application_Links *app, void *data, int32_t size) Global_Set_Mapping(Application_Links *app, void *data, i32 size)
/* /*
DOC_PARAM(data, The beginning of a binding buffer. Bind_Helper is designed to make it easy to produce such a buffer.) DOC_PARAM(data, The beginning of a binding buffer. Bind_Helper is designed to make it easy to produce such a buffer.)
DOC_PARAM(size, The size of the binding buffer in bytes.) DOC_PARAM(size, The size of the binding buffer in bytes.)
@ -351,7 +351,7 @@ DOC_SEE(Command_Line_Interface_Flag)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Clipboard_Post(Application_Links *app, int32_t clipboard_id, String string) Clipboard_Post(Application_Links *app, i32 clipboard_id, String string)
/* /*
DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.) DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.)
DOC_PARAM(str, The str parameter specifies the string to be posted to the clipboard, it need not be null terminated.) DOC_PARAM(str, The str parameter specifies the string to be posted to the clipboard, it need not be null terminated.)
@ -367,7 +367,7 @@ DOC_SEE(The_4coder_Clipboard)
} }
API_EXPORT b32 API_EXPORT b32
Clipboard_Count(Application_Links *app, int32_t clipboard_id, int32_t *count_out) Clipboard_Count(Application_Links *app, i32 clipboard_id, i32 *count_out)
/* /*
DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.) DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.)
DOC(This call returns the number of items in the clipboard.) DOC(This call returns the number of items in the clipboard.)
@ -380,7 +380,7 @@ DOC_SEE(The_4coder_Clipboard)
} }
API_EXPORT b32 API_EXPORT b32
Clipboard_Index(Application_Links *app, int32_t clipboard_id, int32_t item_index, String *string_out, int32_t *required_size_out) Clipboard_Index(Application_Links *app, i32 clipboard_id, i32 item_index, String *string_out, i32 *required_size_out)
/* /*
DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.) DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.)
DOC_PARAM(item_index, This parameter specifies which item to read, 0 is the most recent copy, 1 is the second most recent copy, etc.) DOC_PARAM(item_index, This parameter specifies which item to read, 0 is the most recent copy, 1 is the second most recent copy, etc.)
@ -406,7 +406,7 @@ DOC_SEE(The_4coder_Clipboard)
} }
API_EXPORT Parse_Context_ID API_EXPORT Parse_Context_ID
Create_Parse_Context(Application_Links *app, Parser_String_And_Type *kw, uint32_t kw_count, Parser_String_And_Type *pp, uint32_t pp_count) Create_Parse_Context(Application_Links *app, Parser_String_And_Type *kw, u32 kw_count, Parser_String_And_Type *pp, u32 pp_count)
/* /*
DOC_PARAM(kw, The list of keywords and type of each.) DOC_PARAM(kw, The list of keywords and type of each.)
DOC_PARAM(kw_count, The number of keywords in the list.) DOC_PARAM(kw_count, The number of keywords in the list.)
@ -419,14 +419,14 @@ DOC_RETURN(On success returns an id for the new parse context. If id == 0, then
return(id); return(id);
} }
API_EXPORT int32_t API_EXPORT i32
Get_Buffer_Count(Application_Links *app) Get_Buffer_Count(Application_Links *app)
/* /*
DOC(Gives the total number of buffers in the application.) DOC(Gives the total number of buffers in the application.)
*/{ */{
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
Working_Set *working_set = &models->working_set; Working_Set *working_set = &models->working_set;
int32_t result = working_set->file_count; i32 result = working_set->file_count;
return(result); return(result);
} }
@ -614,7 +614,7 @@ DOC_SEE(Access_Flag)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Read_Range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, char *out) Buffer_Read_Range(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, char *out)
/* /*
DOC_PARAM(buffer, This parameter specifies the buffer to read.) DOC_PARAM(buffer, This parameter specifies the buffer to read.)
DOC_PARAM(start, This parameter specifies absolute position of the first character in the read range.) DOC_PARAM(start, This parameter specifies absolute position of the first character in the read range.)
@ -646,7 +646,7 @@ DOC_SEE(4coder_Buffer_Positioning_System)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Replace_Range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String string) Buffer_Replace_Range(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 one_past_last, String string)
/* /*
DOC_PARAM(buffer, This parameter specifies the buffer to edit.) DOC_PARAM(buffer, This parameter specifies the buffer to edit.)
DOC_PARAM(start, This parameter specifies absolute position of the first character in the replace range.) DOC_PARAM(start, This parameter specifies absolute position of the first character in the replace range.)
@ -670,7 +670,7 @@ DOC_SEE(4coder_Buffer_Positioning_System)
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id); Editing_File *file = imp_get_file(models, buffer_id);
b32 result = false; b32 result = false;
int32_t size = 0; i32 size = 0;
if (buffer_api_check_file(file)){ if (buffer_api_check_file(file)){
size = buffer_size(&file->state.buffer); size = buffer_size(&file->state.buffer);
if (0 <= start && start <= one_past_last && one_past_last <= size){ if (0 <= start && start <= one_past_last && one_past_last <= size){
@ -736,7 +736,7 @@ DOC_SEE(Partial_Cursor)
// TODO(allen): work with edit handler // TODO(allen): work with edit handler
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Batch_Edit(Application_Links *app, Buffer_ID buffer_id, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type) Buffer_Batch_Edit(Application_Links *app, Buffer_ID buffer_id, char *str, i32 str_len, Buffer_Edit *edits, i32 edit_count, Buffer_Batch_Edit_Type type)
/* /*
DOC_PARAM(buffer, The buffer on which to apply the batch of edits.) DOC_PARAM(buffer, The buffer on which to apply the batch of edits.)
DOC_PARAM(str, This parameter provides all of the source string for the edits in the batch.) DOC_PARAM(str, This parameter provides all of the source string for the edits in the batch.)
@ -783,7 +783,7 @@ DOC_SEE(Buffer_Batch_Edit_Type)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Get_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t *value_out) Buffer_Get_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 *value_out)
/* /*
DOC_PARAM(buffer, the buffer from which to read a setting) DOC_PARAM(buffer, the buffer from which to read a setting)
DOC_PARAM(setting, the setting to read from the buffer) DOC_PARAM(setting, the setting to read from the buffer)
@ -867,7 +867,7 @@ DOC_RETURN(returns non-zero on success)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Set_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t value) Buffer_Set_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value)
/* /*
DOC_PARAM(buffer, The buffer parameter specifies the buffer on which to set a setting.) DOC_PARAM(buffer, The buffer parameter specifies the buffer on which to set a setting.)
DOC_PARAM(setting, The setting parameter identifies the setting that shall be changed.) DOC_PARAM(setting, The setting parameter identifies the setting that shall be changed.)
@ -1095,7 +1095,7 @@ If the buffer_id does not specify a valid buffer, the returned scope is null.)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Token_Count(Application_Links *app, Buffer_ID buffer_id, int32_t *count_out) Buffer_Token_Count(Application_Links *app, Buffer_ID buffer_id, i32 *count_out)
/* /*
DOC_PARAM(buffer, Specifies the buffer from which to read the token count.) DOC_PARAM(buffer, Specifies the buffer from which to read the token count.)
DOC_RETURN(If tokens are available for the buffer, the number of tokens on the buffer is returned. DOC_RETURN(If tokens are available for the buffer, the number of tokens on the buffer is returned.
@ -1113,7 +1113,7 @@ If the buffer does not exist or if it is not a lexed buffer, the return is zero.
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Read_Tokens(Application_Links *app, Buffer_ID buffer_id, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out) Buffer_Read_Tokens(Application_Links *app, Buffer_ID buffer_id, i32 start_token, i32 end_token, Cpp_Token *tokens_out)
/* /*
DOC_PARAM(buffer, Specifies the buffer from which to read tokens.) DOC_PARAM(buffer, Specifies the buffer from which to read tokens.)
DOC_PARAM(first_token, Specifies the index of the first token to read.) DOC_PARAM(first_token, Specifies the index of the first token to read.)
@ -1157,7 +1157,7 @@ Buffer_Get_Token_Range(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Get_Token_Index(Application_Links *app, Buffer_ID buffer_id, int32_t pos, Cpp_Get_Token_Result *get_result) Buffer_Get_Token_Index(Application_Links *app, Buffer_ID buffer_id, i32 pos, Cpp_Get_Token_Result *get_result)
/* /*
DOC_PARAM(buffer, The buffer from which to get a token.) DOC_PARAM(buffer, The buffer from which to get a token.)
DOC_PARAM(pos, The position in the buffer in absolute coordinates.) DOC_PARAM(pos, The position in the buffer in absolute coordinates.)
@ -1349,7 +1349,7 @@ DOC_SEE(Buffer_Create_Flag)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Buffer_Save(Application_Links *app, Buffer_ID buffer_id, String file_name, uint32_t flags) Buffer_Save(Application_Links *app, Buffer_ID buffer_id, String file_name, u32 flags)
/* /*
DOC_PARAM(buffer, The buffer parameter specifies the buffer to save to a file.) DOC_PARAM(buffer, The buffer parameter specifies the buffer to save to a file.)
DOC_PARAM(file_name, The file_name parameter specifies the name of the file to write with the contents of the buffer; it need not be null terminated.) DOC_PARAM(file_name, The file_name parameter specifies the name of the file to write with the contents of the buffer; it need not be null terminated.)
@ -1480,8 +1480,8 @@ Buffer_Reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag fl
// TODO(allen): try(perform a diff maybe apply edits in reopen) // TODO(allen): try(perform a diff maybe apply edits in reopen)
int32_t line_numbers[16]; i32 line_numbers[16];
int32_t column_numbers[16]; i32 column_numbers[16];
View *vptrs[16]; View *vptrs[16];
i32 vptr_count = 0; i32 vptr_count = 0;
@ -1937,7 +1937,7 @@ DOC_SEE(get_active_view)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
View_Get_Setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t *value_out) View_Get_Setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 *value_out)
/* /*
DOC_PARAM(view, the view from which to read a setting) DOC_PARAM(view, the view from which to read a setting)
DOC_PARAM(setting, the view setting to read) DOC_PARAM(setting, the view setting to read)
@ -1982,7 +1982,7 @@ DOC_RETURN(returns non-zero on success)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
View_Set_Setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t value) View_Set_Setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 value)
/* /*
DOC_PARAM(view, The view parameter specifies the view on which to set a setting.) DOC_PARAM(view, The view parameter specifies the view on which to set a setting.)
DOC_PARAM(setting, The setting parameter identifies the setting that shall be changed.) DOC_PARAM(setting, The setting parameter identifies the setting that shall be changed.)
@ -2224,7 +2224,7 @@ DOC_SEE(Set_Buffer_Flag)
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
View_Post_Fade(Application_Links *app, View_ID view_id, float seconds, int32_t start, int32_t end, int_color color) View_Post_Fade(Application_Links *app, View_ID view_id, float seconds, i32 start, i32 end, int_color color)
/* /*
DOC_PARAM(view, The view parameter specifies the view onto which the fade effect shall be posted.) DOC_PARAM(view, The view parameter specifies the view onto which the fade effect shall be posted.)
DOC_PARAM(seconds, This parameter specifies the number of seconds the fade effect should last.) DOC_PARAM(seconds, This parameter specifies the number of seconds the fade effect should last.)
@ -2238,7 +2238,7 @@ DOC_SEE(int_color)
View *view = imp_get_view(models, view_id); View *view = imp_get_view(models, view_id);
b32 result = false; b32 result = false;
if (view_api_check_view(view)){ if (view_api_check_view(view)){
int32_t size = end - start; i32 size = end - start;
if (size > 0){ if (size > 0){
view_post_paste_effect(view, seconds, start, size, color|0xFF000000); view_post_paste_effect(view, seconds, start, size, color|0xFF000000);
result = true; result = true;
@ -2429,7 +2429,7 @@ get_lifetime_object_from_workspace(Dynamic_Workspace *workspace){
} }
API_EXPORT Managed_Scope API_EXPORT Managed_Scope
Get_Managed_Scope_With_Multiple_Dependencies(Application_Links *app, Managed_Scope *scopes, int32_t count) Get_Managed_Scope_With_Multiple_Dependencies(Application_Links *app, Managed_Scope *scopes, i32 count)
/* /*
DOC_PARAM(scopes, An array of scope handles which are to represent the various dependencies that the returned scope will have.) DOC_PARAM(scopes, An array of scope handles which are to represent the various dependencies that the returned scope will have.)
DOC_PARAM(count, The number of scopes in the scopes array) DOC_PARAM(count, The number of scopes in the scopes array)
@ -2593,7 +2593,7 @@ DOC_SEE(managed_variable_get_id)
} }
internal b32 internal b32
get_dynamic_variable__internal(Models *models, Managed_Scope handle, int32_t location, uint64_t **ptr_out){ get_dynamic_variable__internal(Models *models, Managed_Scope handle, i32 location, uint64_t **ptr_out){
Heap *heap = &models->mem.heap; Heap *heap = &models->mem.heap;
Dynamic_Variable_Layout *layout = &models->variable_layout; Dynamic_Variable_Layout *layout = &models->variable_layout;
Dynamic_Workspace *workspace = get_dynamic_workspace(models, handle); Dynamic_Workspace *workspace = get_dynamic_workspace(models, handle);
@ -2657,7 +2657,7 @@ DOC(Managed objects allocate memory that is tied to the scope. When the scope i
Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope); Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope);
Managed_Object result = 0; Managed_Object result = 0;
if (workspace != 0){ if (workspace != 0){
int32_t size = count*item_size; i32 size = count*item_size;
void *ptr = memory_bank_allocate(heap, &workspace->mem_bank, size + sizeof(Managed_Memory_Header)); void *ptr = memory_bank_allocate(heap, &workspace->mem_bank, size + sizeof(Managed_Memory_Header));
Managed_Memory_Header *header = (Managed_Memory_Header*)ptr; Managed_Memory_Header *header = (Managed_Memory_Header*)ptr;
header->std_header.type = ManagedObjectType_Memory; header->std_header.type = ManagedObjectType_Memory;
@ -2670,7 +2670,7 @@ DOC(Managed objects allocate memory that is tied to the scope. When the scope i
} }
API_EXPORT Managed_Object API_EXPORT Managed_Object
Alloc_Buffer_Markers_On_Buffer(Application_Links *app, Buffer_ID buffer_id, int32_t count, Managed_Scope *optional_extra_scope) Alloc_Buffer_Markers_On_Buffer(Application_Links *app, Buffer_ID buffer_id, i32 count, Managed_Scope *optional_extra_scope)
/* /*
DOC_PARAM(buffer_id, The id for the buffer onto which these markers will be attached. The markers will live in the scope of the buffer, or in another scope dependent on this buffer, thus guaranteeing that when the buffer is closed, all attached markers are freed in bulk with it.) DOC_PARAM(buffer_id, The id for the buffer onto which these markers will be attached. The markers will live in the scope of the buffer, or in another scope dependent on this buffer, thus guaranteeing that when the buffer is closed, all attached markers are freed in bulk with it.)
DOC_PARAM(count, The number of Marker items allocated in this object. The total memory size is sizeof(Marker)*count.) DOC_PARAM(count, The number of Marker items allocated in this object. The total memory size is sizeof(Marker)*count.)
@ -2910,7 +2910,7 @@ DOC_RETURN(Returns non-zero on success, and zero on failure. This call fails wh
return(false); return(false);
} }
API_EXPORT int32_t API_EXPORT i32
Buffer_Markers_Get_Attached_Visual_Count(Application_Links *app, Managed_Object object) Buffer_Markers_Get_Attached_Visual_Count(Application_Links *app, Managed_Object object)
/* /*
DOC_PARAM(object, The handle to the marker object to be queried.) DOC_PARAM(object, The handle to the marker object to be queried.)
@ -2979,7 +2979,7 @@ get_dynamic_object_memory_ptr(Managed_Object_Standard_Header *header){
return(ptr); return(ptr);
} }
API_EXPORT uint32_t API_EXPORT u32
Managed_Object_Get_Item_Size(Application_Links *app, Managed_Object object) Managed_Object_Get_Item_Size(Application_Links *app, Managed_Object object)
/* /*
DOC_PARAM(object, The handle to the managed object to be queried.) DOC_PARAM(object, The handle to the managed object to be queried.)
@ -2994,7 +2994,7 @@ DOC_RETURN(Returns the size, in bytes, of a single item in the managed object.
return(0); return(0);
} }
API_EXPORT uint32_t API_EXPORT u32
Managed_Object_Get_Item_Count(Application_Links *app, Managed_Object object) Managed_Object_Get_Item_Count(Application_Links *app, Managed_Object object)
/* /*
DOC_PARAM(object, The handle to the managed object to be queried.) DOC_PARAM(object, The handle to the managed object to be queried.)
@ -3090,7 +3090,7 @@ DOC(Permanently frees the specified object. Not only does this free up the memo
} }
API_EXPORT b32 API_EXPORT b32
Managed_Object_Store_Data(Application_Links *app, Managed_Object object, uint32_t first_index, uint32_t count, void *mem) Managed_Object_Store_Data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem)
/* /*
DOC_PARAM(object, The handle to the managed object in which data will be stored.) DOC_PARAM(object, The handle to the managed object in which data will be stored.)
DOC_PARAM(first_index, The first index of the range in the managed object to be stored. Managed object indics are zero based.) DOC_PARAM(first_index, The first index of the range in the managed object to be stored. Managed object indics are zero based.)
@ -3119,7 +3119,7 @@ DOC_SEE(managed_object_get_item_count)
} }
API_EXPORT b32 API_EXPORT b32
Managed_Object_Load_Data(Application_Links *app, Managed_Object object, uint32_t first_index, uint32_t count, void *mem_out) Managed_Object_Load_Data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem_out)
/* /*
DOC_PARAM(object, The handle to the managed object from which data will be loaded.) DOC_PARAM(object, The handle to the managed object from which data will be loaded.)
DOC_PARAM(first_index, The first index of the range in the managed object to be loaded. Managed object indics are zero based.) DOC_PARAM(first_index, The first index of the range in the managed object to be loaded. Managed object indics are zero based.)
@ -3208,8 +3208,8 @@ DOC_SEE(Mouse_State)
return(models->input->mouse); return(models->input->mouse);
} }
API_EXPORT int32_t API_EXPORT i32
Get_Active_Query_Bars(Application_Links *app, View_ID view_id, int32_t max_result_count, Query_Bar **result_array) Get_Active_Query_Bars(Application_Links *app, View_ID view_id, i32 max_result_count, Query_Bar **result_array)
/* /*
DOC_PARAM(view_id, Specifies the view for which query bars should be retrieved.) DOC_PARAM(view_id, Specifies the view for which query bars should be retrieved.)
DOC_PARAM(max_result_count, Specifies the number of Query_Bar pointers available in result_array.) DOC_PARAM(max_result_count, Specifies the number of Query_Bar pointers available in result_array.)
@ -3223,7 +3223,7 @@ that if you only care about the most recent query bar, you can call Get_Active_Q
max_result_count of 1 and be assured you will get the most recent bar if any exist. max_result_count of 1 and be assured you will get the most recent bar if any exist.
) )
*/{ */{
int32_t result = 0; i32 result = 0;
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id); View *view = imp_get_view(models, view_id);
if (view != 0){ if (view != 0){
@ -3239,7 +3239,7 @@ max_result_count of 1 and be assured you will get the most recent bar if any exi
} }
API_EXPORT b32 API_EXPORT b32
Start_Query_Bar(Application_Links *app, Query_Bar *bar, uint32_t flags) Start_Query_Bar(Application_Links *app, Query_Bar *bar, u32 flags)
/* /*
DOC_PARAM(bar, This parameter provides a Query_Bar that should remain in valid memory DOC_PARAM(bar, This parameter provides a Query_Bar that should remain in valid memory
until end_query_bar or the end of the command. It is commonly a good idea to make until end_query_bar or the end of the command. It is commonly a good idea to make
@ -3267,7 +3267,7 @@ only use for this call is in an interactive command that makes calls to get_user
} }
API_EXPORT void API_EXPORT void
End_Query_Bar(Application_Links *app, Query_Bar *bar, uint32_t flags) End_Query_Bar(Application_Links *app, Query_Bar *bar, u32 flags)
/* /*
DOC_PARAM(bar, This parameter should be a bar pointer of a currently active query bar.) DOC_PARAM(bar, This parameter should be a bar pointer of a currently active query bar.)
DOC_PARAM(flags, This parameter is not currently used and should be 0 for now.) DOC_PARAM(flags, This parameter is not currently used and should be 0 for now.)
@ -3297,7 +3297,7 @@ DOC(This call posts a string to the *messages* buffer.)
} }
#if 0 #if 0
//API_EXPORT int32_t //API_EXPORT i32
Get_Theme_Count(Application_Links *app) Get_Theme_Count(Application_Links *app)
/* /*
DOC_RETURN(Returns the number of themes that currently exist in the core.) DOC_RETURN(Returns the number of themes that currently exist in the core.)
@ -3308,7 +3308,7 @@ DOC_RETURN(Returns the number of themes that currently exist in the core.)
} }
//API_EXPORT String //API_EXPORT String
Get_Theme_Name(Application_Links *app, struct Partition *arena, int32_t index) Get_Theme_Name(Application_Links *app, struct Partition *arena, i32 index)
/* /*
DOC_PARAM(arena, The arena which will be used to allocate the returned string.) DOC_PARAM(arena, The arena which will be used to allocate the returned string.)
DOC_PARAM(index, The index of the theme to query. Index zero always refers to the active theme, all other indices refer to the static copies of available themes.) DOC_PARAM(index, The index of the theme to query. Index zero always refers to the active theme, all other indices refer to the static copies of available themes.)
@ -3393,7 +3393,7 @@ DOC(This call changes 4coder's color pallet to one of the built in themes.)
} }
//API_EXPORT b32 //API_EXPORT b32
Change_Theme_By_Index(Application_Links *app, int32_t index) Change_Theme_By_Index(Application_Links *app, i32 index)
/* /*
DOC_PARAM(index, The index parameter specifies the index of theme to begin using.) DOC_PARAM(index, The index parameter specifies the index of theme to begin using.)
DOC_RETURN(Returns non-zero on success and zero on failure. This call fails when index is not less than the total number of themes.) DOC_RETURN(Returns non-zero on success and zero on failure. This call fails when index is not less than the total number of themes.)
@ -3524,7 +3524,7 @@ Buffer_History_Get_Record_Info(Application_Links *app, Buffer_ID buffer_id, Hist
} }
API_EXPORT b32 API_EXPORT b32
Buffer_History_Get_Group_Sub_Record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, int32_t sub_index, Record_Info *record_out){ Buffer_History_Get_Group_Sub_Record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index, Record_Info *record_out){
Models *models = (Models*)app->cmd_context; Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id); Editing_File *file = imp_get_file(models, buffer_id);
block_zero_struct(record_out); block_zero_struct(record_out);
@ -3869,7 +3869,7 @@ DOC_RETURN(Returns true on success and zero on failure.)
return(success); return(success);
} }
API_EXPORT int32_t API_EXPORT i32
Get_Available_Font_Count(Application_Links *app) Get_Available_Font_Count(Application_Links *app)
/* /*
DOC(An available font is a font that the 4coder font system detected on initialization. Available fonts either come from the font folder in the same path as the 4ed executable, or from the system fonts. Attempting to load fonts not in returned by available fonts will likely fail, but is permitted. Available fonts are not updated after initialization. Just because a font is returned by the available font system does not necessarily mean that it can be loaded.) DOC(An available font is a font that the 4coder font system detected on initialization. Available fonts either come from the font folder in the same path as the 4ed executable, or from the system fonts. Attempting to load fonts not in returned by available fonts will likely fail, but is permitted. Available fonts are not updated after initialization. Just because a font is returned by the available font system does not necessarily mean that it can be loaded.)
@ -3882,7 +3882,7 @@ DOC_RETURN(Returns the number of available fonts that the user can query.)
} }
API_EXPORT Available_Font API_EXPORT Available_Font
Get_Available_Font(Application_Links *app, int32_t index) Get_Available_Font(Application_Links *app, i32 index)
/* /*
DOC_PARAM(index, The index of the available font to retrieve. Must be in the range [0,count-1] where count is the value returned by get_available_font_count.) DOC_PARAM(index, The index of the available font to retrieve. Must be in the range [0,count-1] where count is the value returned by get_available_font_count.)
DOC_RETURN(Returns a valid Available_Font if index is in the required range. Otherwise returns an invalid Available_Font. An Available_Font is valid if and only if it's name field contains a string with a non-zero length (i.e. font.name[0] != 0)) DOC_RETURN(Returns a valid Available_Font if index is in the required range. Otherwise returns an invalid Available_Font. An Available_Font is valid if and only if it's name field contains a string with a non-zero length (i.e. font.name[0] != 0))
@ -3901,7 +3901,7 @@ DOC_SEE(get_available_font_count)
} }
API_EXPORT void API_EXPORT void
Set_Theme_Colors(Application_Links *app, Theme_Color *colors, int32_t count) Set_Theme_Colors(Application_Links *app, Theme_Color *colors, i32 count)
/* /*
DOC_PARAM(colors, The colors pointer provides an array of color structs pairing differet style tags to color codes.) DOC_PARAM(colors, The colors pointer provides an array of color structs pairing differet style tags to color codes.)
DOC_PARAM(count, The count parameter specifies the number of Theme_Color structs in the colors array.) DOC_PARAM(count, The count parameter specifies the number of Theme_Color structs in the colors array.)
@ -3919,7 +3919,7 @@ DOC_SEE(Theme_Color)
} }
API_EXPORT void API_EXPORT void
Get_Theme_Colors(Application_Links *app, Theme_Color *colors, int32_t count) Get_Theme_Colors(Application_Links *app, Theme_Color *colors, i32 count)
/* /*
DOC_PARAM(colors, an array of color structs listing style tags to get color values for) DOC_PARAM(colors, an array of color structs listing style tags to get color values for)
DOC_PARAM(count, the number of color structs in the colors array) DOC_PARAM(count, the number of color structs in the colors array)
@ -3946,8 +3946,8 @@ Finalize_Color(Application_Links *app, int_color color){
} }
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT int32_t API_EXPORT i32
Get_Hot_Directory(Application_Links *app, String *out, int32_t *required_size_out) Get_Hot_Directory(Application_Links *app, String *out, i32 *required_size_out)
/* /*
DOC_PARAM(out, On success this character buffer is filled with the 4coder 'hot directory'.) DOC_PARAM(out, On success this character buffer is filled with the 4coder 'hot directory'.)
DOC_PARAM(capacity, Specifies the capacity in bytes of the of the out buffer.) DOC_PARAM(capacity, Specifies the capacity in bytes of the of the out buffer.)
@ -4040,7 +4040,7 @@ DOC(This is a temporary ad-hoc solution to allow some customization of the behav
} }
API_EXPORT void* API_EXPORT void*
Memory_Allocate(Application_Links *app, int32_t size) Memory_Allocate(Application_Links *app, i32 size)
/* /*
DOC_PARAM(size, The size in bytes of the block that should be returned.) DOC_PARAM(size, The size in bytes of the block that should be returned.)
DOC(This calls to a low level OS allocator which means it is best used for infrequent, large allocations. The size of the block must be remembered if it will be freed or if it's mem protection status will be changed.) DOC(This calls to a low level OS allocator which means it is best used for infrequent, large allocations. The size of the block must be remembered if it will be freed or if it's mem protection status will be changed.)
@ -4052,7 +4052,7 @@ DOC_SEE(memory_free)
} }
API_EXPORT b32 API_EXPORT b32
Memory_Set_Protection(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags) Memory_Set_Protection(Application_Links *app, void *ptr, i32 size, Memory_Protect_Flags flags)
/* /*
DOC_PARAM(ptr, The base of the block on which to set memory protection flags.) DOC_PARAM(ptr, The base of the block on which to set memory protection flags.)
DOC_PARAM(size, The size that was originally used to allocate this block.) DOC_PARAM(size, The size that was originally used to allocate this block.)
@ -4066,7 +4066,7 @@ DOC_SEE(Memory_Protect_Flags)
} }
API_EXPORT void API_EXPORT void
Memory_Free(Application_Links *app, void *ptr, int32_t size) Memory_Free(Application_Links *app, void *ptr, i32 size)
/* /*
DOC_PARAM(mem, The base of a block to free.) DOC_PARAM(mem, The base of a block to free.)
DOC_PARAM(size, The size that was originally used to allocate this block.) DOC_PARAM(size, The size that was originally used to allocate this block.)
@ -4107,7 +4107,7 @@ For instance if dir contains "C:/Users/MySelf" and rel is "Documents" the buffer
// TODO(allen): redocument // TODO(allen): redocument
API_EXPORT b32 API_EXPORT b32
Get_4ed_Path(Application_Links *app, String *path_out, int32_t *required_size_out) Get_4ed_Path(Application_Links *app, String *path_out, i32 *required_size_out)
/* /*
DOC_PARAM(out, This parameter provides a character buffer that receives the path to the 4ed executable file.) DOC_PARAM(out, This parameter provides a character buffer that receives the path to the 4ed executable file.)
DOC_PARAM(capacity, This parameter specifies the maximum capacity of the out buffer.) DOC_PARAM(capacity, This parameter specifies the maximum capacity of the out buffer.)
@ -4332,7 +4332,7 @@ Animate(Application_Links *app)
// TODO(casey): Allen, this routine is very intricate and needs to be tested thoroughly before mainlining. I've only done cursory testing on it and have probably missed bugs that only occur in highly segmented buffers. // TODO(casey): Allen, this routine is very intricate and needs to be tested thoroughly before mainlining. I've only done cursory testing on it and have probably missed bugs that only occur in highly segmented buffers.
// TODO(casey): I think this routine could potentially be simplified by making it into something that always works with a partial match list, where the partial matches have 0 characters matched, and they just get moved forward as they go. This would solve the duplicate code problem the routine currently has where it does the same thing in its two halves, but slightly differently. // TODO(casey): I think this routine could potentially be simplified by making it into something that always works with a partial match list, where the partial matches have 0 characters matched, and they just get moved forward as they go. This would solve the duplicate code problem the routine currently has where it does the same thing in its two halves, but slightly differently.
API_EXPORT Found_String_List API_EXPORT Found_String_List
Find_All_In_Range_Insensitive(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t end, String key, Partition *memory) Find_All_In_Range_Insensitive(Application_Links *app, Buffer_ID buffer_id, i32 start, i32 end, String key, Partition *memory)
{ {
Found_String_List result = {}; Found_String_List result = {};
@ -4343,7 +4343,7 @@ Find_All_In_Range_Insensitive(Application_Links *app, Buffer_ID buffer_id, int32
Editing_File *file = imp_get_file(models, buffer_id); Editing_File *file = imp_get_file(models, buffer_id);
if((file != 0) && key.size) if((file != 0) && key.size)
{ {
int32_t total_size = buffer_size(&file->state.buffer); i32 total_size = buffer_size(&file->state.buffer);
u32 clean_edegs = FoundString_CleanEdges; u32 clean_edegs = FoundString_CleanEdges;
if (0 <= start && start <= end && end <= total_size) if (0 <= start && start <= end && end <= total_size)

View File

@ -1168,7 +1168,7 @@ internal Partial_Cursor
buffer_partial_from_pos(Gap_Buffer *buffer, i32 pos){ buffer_partial_from_pos(Gap_Buffer *buffer, i32 pos){
Partial_Cursor result = {}; Partial_Cursor result = {};
int32_t size = buffer_size(buffer); i32 size = buffer_size(buffer);
if (pos > size){ if (pos > size){
pos = size; pos = size;
} }

View File

@ -29,7 +29,7 @@ dynamic_variables_lookup(Dynamic_Variable_Layout *layout, String name){
internal Managed_Variable_ID internal Managed_Variable_ID
dynamic_variables_create__always(Heap *heap, Dynamic_Variable_Layout *layout, String name, u64 default_value){ dynamic_variables_create__always(Heap *heap, Dynamic_Variable_Layout *layout, String name, u64 default_value){
int32_t alloc_size = name.size + 1 + sizeof(Dynamic_Variable_Slot); i32 alloc_size = name.size + 1 + sizeof(Dynamic_Variable_Slot);
void *ptr = heap_allocate(heap, alloc_size); void *ptr = heap_allocate(heap, alloc_size);
if (ptr != 0){ if (ptr != 0){
Dynamic_Variable_Slot *new_slot = (Dynamic_Variable_Slot*)ptr; Dynamic_Variable_Slot *new_slot = (Dynamic_Variable_Slot*)ptr;

View File

@ -40,9 +40,9 @@ struct Font_Slot_Page_And_Index{
}; };
// NOTE(allen): SLOT_PER_PAGE must be >= 1 // NOTE(allen): SLOT_PER_PAGE must be >= 1
global int32_t SLOT_PER_PAGE = 32; global i32 SLOT_PER_PAGE = 32;
global int32_t SLOT_SIZE = sizeof(Font_Settings) + sizeof(Font_Metrics) + sizeof(Font_Page_Storage); global i32 SLOT_SIZE = sizeof(Font_Settings) + sizeof(Font_Metrics) + sizeof(Font_Page_Storage);
global int32_t SLOT_PAGE_SIZE = sizeof(Font_Slot_Page) + ((SLOT_PER_PAGE + 63)/64)*8 + SLOT_PER_PAGE*SLOT_SIZE; global i32 SLOT_PAGE_SIZE = sizeof(Font_Slot_Page) + ((SLOT_PER_PAGE + 63)/64)*8 + SLOT_PER_PAGE*SLOT_SIZE;
struct Font_Vars{ struct Font_Vars{
Font_Slot_Page slot_pages_sentinel; Font_Slot_Page slot_pages_sentinel;

View File

@ -12,10 +12,9 @@
internal void internal void
init_query_set(Query_Set *set){ init_query_set(Query_Set *set){
Query_Slot *slot = set->slots; Query_Slot *slot = set->slots;
int32_t i;
set->free_slot = slot; set->free_slot = slot;
set->used_slot = 0; set->used_slot = 0;
for (i = 0; i+1 < ArrayCount(set->slots); ++i, ++slot){ for (i32 i = 0; i+1 < ArrayCount(set->slots); ++i, ++slot){
slot->next = slot + 1; slot->next = slot + 1;
} }
} }

View File

@ -212,10 +212,10 @@ typedef Sys_Memory_Free_Sig(System_Memory_Free);
#define Sys_Directory_CD_Sig(name) b32 name(char *dir, i32 *len, i32 cap, char *rel_path, i32 rel_len) #define Sys_Directory_CD_Sig(name) b32 name(char *dir, i32 *len, i32 cap, char *rel_path, i32 rel_len)
typedef Sys_Directory_CD_Sig(System_Directory_CD); typedef Sys_Directory_CD_Sig(System_Directory_CD);
#define Sys_Get_Current_Path_Sig(name) int32_t name(char *out, i32 capacity) #define Sys_Get_Current_Path_Sig(name) i32 name(char *out, i32 capacity)
typedef Sys_Get_Current_Path_Sig(System_Get_Current_Path); typedef Sys_Get_Current_Path_Sig(System_Get_Current_Path);
#define Sys_Get_4ed_Path_Sig(name) int32_t name(char *out, i32 capacity) #define Sys_Get_4ed_Path_Sig(name) i32 name(char *out, i32 capacity)
typedef Sys_Get_4ed_Path_Sig(System_Get_4ed_Path); typedef Sys_Get_4ed_Path_Sig(System_Get_4ed_Path);
// behavior and appearance options // behavior and appearance options

View File

@ -496,7 +496,7 @@ buffer_bind_name(Models *models, Heap *heap, Partition *scratch, Working_Set *wo
// List of conflict files. // List of conflict files.
Editing_File **conflict_file_ptrs = push_array(scratch, Editing_File*, 0); Editing_File **conflict_file_ptrs = push_array(scratch, Editing_File*, 0);
int32_t conflict_count = 0; i32 conflict_count = 0;
{ {
Editing_File **new_file_ptr = push_array(scratch, Editing_File*, 1); Editing_File **new_file_ptr = push_array(scratch, Editing_File*, 1);
@ -517,7 +517,7 @@ buffer_bind_name(Models *models, Heap *heap, Partition *scratch, Working_Set *wo
// Fill conflict array. // Fill conflict array.
Buffer_Name_Conflict_Entry *conflicts = push_array(scratch, Buffer_Name_Conflict_Entry, conflict_count); Buffer_Name_Conflict_Entry *conflicts = push_array(scratch, Buffer_Name_Conflict_Entry, conflict_count);
for (int32_t i = 0; i < conflict_count; ++i){ for (i32 i = 0; i < conflict_count; ++i){
Editing_File *file_ptr = conflict_file_ptrs[i]; Editing_File *file_ptr = conflict_file_ptrs[i];
Buffer_Name_Conflict_Entry *entry = &conflicts[i]; Buffer_Name_Conflict_Entry *entry = &conflicts[i];
entry->buffer_id = file_ptr->id.id; entry->buffer_id = file_ptr->id.id;
@ -547,13 +547,13 @@ buffer_bind_name(Models *models, Heap *heap, Partition *scratch, Working_Set *wo
} }
// Re-bind all of the files // Re-bind all of the files
for (int32_t i = 0; i < conflict_count; ++i){ for (i32 i = 0; i < conflict_count; ++i){
Editing_File *file_ptr = conflict_file_ptrs[i]; Editing_File *file_ptr = conflict_file_ptrs[i];
if (file_ptr->unique_name.name.str != 0){ if (file_ptr->unique_name.name.str != 0){
buffer_unbind_name_low_level(working_set, file_ptr); buffer_unbind_name_low_level(working_set, file_ptr);
} }
} }
for (int32_t i = 0; i < conflict_count; ++i){ for (i32 i = 0; i < conflict_count; ++i){
Editing_File *file_ptr = conflict_file_ptrs[i]; Editing_File *file_ptr = conflict_file_ptrs[i];
Buffer_Name_Conflict_Entry *entry = &conflicts[i]; Buffer_Name_Conflict_Entry *entry = &conflicts[i];
String unique_name = make_string(entry->unique_name_in_out, entry->unique_name_len_in_out); String unique_name = make_string(entry->unique_name_in_out, entry->unique_name_len_in_out);