new word complete appears to work

master
Allen Webster 2016-07-11 12:15:37 -04:00
parent c479e14f25
commit 0d5f6e82d3
13 changed files with 267 additions and 206 deletions

View File

@ -22,7 +22,7 @@ ul { list-style: none; padding: 0; margin: 0; }
<h2 id='section_introduction'>&sect;1 Introduction</h2>
<div>
<p>
This is the documentation for alpha 4.0.10 The documentation is still under construction so some of the links are linking to sections that have not been written yet. What is here should be correct and I suspect useful even without some of the other sections. </p>
This is the documentation for alpha 4.0.10 super! The documentation is still under construction so some of the links are linking to sections that have not been written yet. What is here should be correct and I suspect useful even without some of the other sections. </p>
<p>
If you have questions or discover errors please contact <span style='font-family: "Courier New", Courier, monospace; text-align: left;'>editor@4coder.net</span> or to get help from community members you can post on the 4coder forums hosted on handmade.network at <span style='font-family: "Courier New", Courier, monospace; text-align: left;'>4coder.handmade.network</span></p>
</div>
@ -34,9 +34,6 @@ Coming Soon</i><div>
<ul>
<li><a href='#exec_command_doc'>exec_command</a></li>
<li><a href='#exec_system_command_doc'>exec_system_command</a></li>
<li><a href='#memory_alloc_doc'>memory_alloc</a></li>
<li><a href='#memory_set_protection_doc'>memory_set_protection</a></li>
<li><a href='#memory_free_doc'>memory_free</a></li>
<li><a href='#clipboard_post_doc'>clipboard_post</a></li>
<li><a href='#clipboard_count_doc'>clipboard_count</a></li>
<li><a href='#clipboard_index_doc'>clipboard_index</a></li>
@ -82,6 +79,9 @@ Coming Soon</i><div>
<li><a href='#directory_get_hot_doc'>directory_get_hot</a></li>
<li><a href='#get_file_list_doc'>get_file_list</a></li>
<li><a href='#free_file_list_doc'>free_file_list</a></li>
<li><a href='#memory_allocate_doc'>memory_allocate</a></li>
<li><a href='#memory_set_protection_doc'>memory_set_protection</a></li>
<li><a href='#memory_free_doc'>memory_free</a></li>
<li><a href='#file_exists_doc'>file_exists</a></li>
<li><a href='#directory_cd_doc'>directory_cd</a></li>
<li><a href='#get_4ed_path_doc'>get_4ed_path</a></li>
@ -186,26 +186,8 @@ If the buffer is not already in an open view and the view parameter is not NULL,
then the provided view will display the output buffer.
If the view parameter is NULL, no view will switch to the output.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Identifier_doc'>Buffer_Identifier</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Command_Line_Input_Flag_doc'>Command_Line_Input_Flag</a></div></div><hr>
<div id='memory_alloc_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.3: memory_alloc</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void* app->memory_alloc(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int32_t size<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div><hr>
<div id='memory_set_protection_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.4: memory_set_protection</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>int32_t app->memory_set_protection(
<div style='margin-left: 4mm;'>Application_Links *app,<br>void *ptr,<br>int32_t size,<br>Memory_Protect_Flags flags<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div><hr>
<div id='memory_free_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.5: memory_free</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->memory_free(
<div style='margin-left: 4mm;'>Application_Links *app,<br>void *mem<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div><hr>
<div id='clipboard_post_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.6: clipboard_post</h4>
<h4>&sect;3.3.3: clipboard_post</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->clipboard_post(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int32_t clipboard_id,<br>char *str,<br>int32_t len<br></div>)
</div>
@ -225,7 +207,7 @@ If the view parameter is NULL, no view will switch to the output.</div><div styl
Also reports the copy to the operating system, so that it may
be pasted into other applications.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#The_4coder_Clipboard_doc'>The_4coder_Clipboard</a></div></div><hr>
<div id='clipboard_count_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.7: clipboard_count</h4>
<h4>&sect;3.3.4: clipboard_count</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>int32_t app->clipboard_count(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int32_t clipboard_id<br></div>)
</div>
@ -235,7 +217,7 @@ be pasted into other applications.</div><div style='margin-top: 3mm; margin-bott
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns the number of items in the clipboard.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#The_4coder_Clipboard_doc'>The_4coder_Clipboard</a></div></div><hr>
<div id='clipboard_index_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.8: clipboard_index</h4>
<h4>&sect;3.3.5: clipboard_index</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>int32_t app->clipboard_index(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int32_t clipboard_id,<br>int32_t item_index,<br>char *out,<br>int32_t len<br></div>)
</div>
@ -259,13 +241,13 @@ be pasted into other applications.</div><div style='margin-top: 3mm; margin-bott
If the output buffer is too small to contain the whole string, it is filled with the
first len character of the clipboard contents. The output string is not null terminated.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#The_4coder_Clipboard_doc'>The_4coder_Clipboard</a></div></div><hr>
<div id='get_buffer_count_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.9: get_buffer_count</h4>
<h4>&sect;3.3.6: get_buffer_count</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>int32_t app->get_buffer_count(
<div style='margin-left: 4mm;'>Application_Links *app<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div><hr>
<div id='get_buffer_first_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.10: get_buffer_first</h4>
<h4>&sect;3.3.7: get_buffer_first</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>Buffer_Summary app->get_buffer_first(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Access_Flag access<br></div>)
</div>
@ -278,7 +260,7 @@ first len character of the clipboard contents. The output string is not null te
If the buffer returned does not exist, the loop is finished.
Buffers should not be killed durring a buffer loop.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_buffer_next_doc'>get_buffer_next</a></div></div><hr>
<div id='get_buffer_next_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.11: get_buffer_next</h4>
<h4>&sect;3.3.8: get_buffer_next</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->get_buffer_next(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>Access_Flag access<br></div>)
</div>
@ -296,7 +278,7 @@ The global buffer order is kept roughly in the order of most recently used to le
If the buffer outputted does not exist, the loop is finished.
Buffers should not be killed or created durring a buffer loop.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_buffer_first_doc'>get_buffer_first</a></div></div><hr>
<div id='get_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.12: get_buffer</h4>
<h4>&sect;3.3.9: get_buffer</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>Buffer_Summary app->get_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_ID buffer_id,<br>Access_Flag access<br></div>)
</div>
@ -310,7 +292,7 @@ Buffers should not be killed or created durring a buffer loop.</div><div style='
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns a summary that describes the indicated buffer if it exists and is accessible.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_ID_doc'>Buffer_ID</a></div></div><hr>
<div id='get_buffer_by_name_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.13: get_buffer_by_name</h4>
<h4>&sect;3.3.10: get_buffer_by_name</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>Buffer_Summary app->get_buffer_by_name(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *name,<br>int32_t len,<br>Access_Flag access<br></div>)
</div>
@ -328,7 +310,7 @@ Buffers should not be killed or created durring a buffer loop.</div><div style='
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns a summary that describes the indicated buffer if it exists and is accessible.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Access_Flag_doc'>Access_Flag</a></div></div><hr>
<div id='buffer_boundary_seek_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.14: buffer_boundary_seek</h4>
<h4>&sect;3.3.11: buffer_boundary_seek</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>int32_t app->buffer_boundary_seek(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int32_t start_pos,<br>bool32 seek_forward,<br>Seek_Boundary_Flag flags<br></div>)
</div>
@ -352,7 +334,7 @@ Buffers should not be killed or created durring a buffer loop.</div><div style='
If the seek goes below 0 the returned value is -1.
If the seek goes past the end the returned value is the size of the buffer.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Seek_Boundary_Flag_doc'>Seek_Boundary_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#4coder_Buffer_Positioning_System_doc'>4coder_Buffer_Positioning_System</a></div></div><hr>
<div id='buffer_read_range_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.15: buffer_read_range</h4>
<h4>&sect;3.3.12: buffer_read_range</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->buffer_read_range(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int32_t start,<br>int32_t end,<br>char *out<br></div>)
</div>
@ -378,7 +360,7 @@ The output is not null terminated.
This call fails if the buffer does not exist,
or if the read range is not within the bounds of the buffer.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#4coder_Buffer_Positioning_System_doc'>4coder_Buffer_Positioning_System</a></div></div><hr>
<div id='buffer_replace_range_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.16: buffer_replace_range</h4>
<h4>&sect;3.3.13: buffer_replace_range</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->buffer_replace_range(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int32_t start,<br>int32_t end,<br>char *str,<br>int32_t len<br></div>)
</div>
@ -411,7 +393,7 @@ from start to end.
This call fails if the buffer does not exist, or if the replace
range is not within the bounds of the buffer.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#4coder_Buffer_Positioning_System_doc'>4coder_Buffer_Positioning_System</a></div></div><hr>
<div id='buffer_batch_edit_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.17: buffer_batch_edit</h4>
<h4>&sect;3.3.14: buffer_batch_edit</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->buffer_batch_edit(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>char *str,<br>int32_t str_len,<br>Buffer_Edit *edits,<br>int32_t edit_count,<br>Buffer_Batch_Edit_Type type<br></div>)
</div>
@ -437,7 +419,7 @@ range is not within the bounds of the buffer.</div><div style='margin-top: 3mm;
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns non-zero if the batch edit succeeds.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Edit_doc'>Buffer_Edit</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Batch_Edit_Type_doc'>Buffer_Batch_Edit_Type</a></div></div><hr>
<div id='buffer_set_setting_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.18: buffer_set_setting</h4>
<h4>&sect;3.3.15: buffer_set_setting</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->buffer_set_setting(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>Buffer_Setting_ID setting,<br>int32_t value<br></div>)
</div>
@ -455,7 +437,7 @@ range is not within the bounds of the buffer.</div><div style='margin-top: 3mm;
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Setting_ID_doc'>Buffer_Setting_ID</a></div></div><hr>
<div id='buffer_auto_indent_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.19: buffer_auto_indent</h4>
<h4>&sect;3.3.16: buffer_auto_indent</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->buffer_auto_indent(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int32_t start,<br>int32_t end,<br>int32_t tab_width,<br>Auto_Indent_Flag flags<br></div>)
</div>
@ -484,7 +466,7 @@ start to end by inserting spaces or tabs at the beginning of the lines.
If the buffer does not have lexing enabled or the lexing job has not
completed this function will fail.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Auto_Indent_Flag_doc'>Auto_Indent_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#4coder_Buffer_Positioning_System_doc'>4coder_Buffer_Positioning_System</a></div></div><hr>
<div id='create_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.20: create_buffer</h4>
<h4>&sect;3.3.17: create_buffer</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>Buffer_Summary app->create_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *filename,<br>int32_t filename_len,<br>Buffer_Create_Flag flags<br></div>)
</div>
@ -506,7 +488,7 @@ If the buffer does not exist a new buffer is created and named after the given f
the filename corresponds to a file on the disk that file is loaded and put into buffer, if
the filename does not correspond to a file on disk the buffer is created empty.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Create_Flag_doc'>Buffer_Create_Flag</a></div></div><hr>
<div id='save_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.21: save_buffer</h4>
<h4>&sect;3.3.18: save_buffer</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->save_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>char *filename,<br>int32_t filename_len,<br>uint32_t flags<br></div>)
</div>
@ -528,7 +510,7 @@ the filename does not correspond to a file on disk the buffer is created empty.<
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns non-zero on success.</div></div><hr>
<div id='kill_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.22: kill_buffer</h4>
<h4>&sect;3.3.19: kill_buffer</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->kill_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Identifier buffer,<br>View_ID view_id,<br>Buffer_Kill_Flag flags<br></div>)
</div>
@ -548,7 +530,7 @@ the filename does not correspond to a file on disk the buffer is created empty.<
dialogue needs to be displayed the provided view is used to show the dialogue.
If the view is not open the kill fails.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Kill_Flag_doc'>Buffer_Kill_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Identifier_doc'>Buffer_Identifier</a></div></div><hr>
<div id='get_view_first_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.23: get_view_first</h4>
<h4>&sect;3.3.20: get_view_first</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>View_Summary app->get_view_first(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Access_Flag access<br></div>)
</div>
@ -561,7 +543,7 @@ If the view is not open the kill fails.</div><div style='margin-top: 3mm; margin
If the View_Summary returned is a null summary, the loop is finished.
Views should not be closed or opened durring a view loop.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_view_next_doc'>get_view_next</a></div></div><hr>
<div id='get_view_next_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.24: get_view_next</h4>
<h4>&sect;3.3.21: get_view_next</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->get_view_next(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Access_Flag access<br></div>)
</div>
@ -578,7 +560,7 @@ Views should not be closed or opened durring a view loop.</div><div style='margi
If the view outputted does not exist, the loop is finished.
Views should not be closed or opened durring a view loop.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_view_first_doc'>get_view_first</a></div></div><hr>
<div id='get_view_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.25: get_view</h4>
<h4>&sect;3.3.22: get_view</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>View_Summary app->get_view(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_ID view_id,<br>Access_Flag access<br></div>)
</div>
@ -592,7 +574,7 @@ Views should not be closed or opened durring a view loop.</div><div style='margi
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns a summary that describes the indicated view if it is open and accessible.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Access_Flag_doc'>Access_Flag</a></div></div><hr>
<div id='get_active_view_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.26: get_active_view</h4>
<h4>&sect;3.3.23: get_active_view</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>View_Summary app->get_active_view(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Access_Flag access<br></div>)
</div>
@ -602,7 +584,7 @@ Views should not be closed or opened durring a view loop.</div><div style='margi
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns a summary that describes the active view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#set_active_view_doc'>set_active_view</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Access_Flag_doc'>Access_Flag</a></div></div><hr>
<div id='open_view_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.27: open_view</h4>
<h4>&sect;3.3.24: open_view</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>View_Summary app->open_view(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view_location,<br>View_Split_Position position<br></div>)
</div>
@ -618,7 +600,7 @@ Views should not be closed or opened durring a view loop.</div><div style='margi
returns a null summary.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>4coder is built with a limit of 16 views. If 16 views are already open when this is called the
call will fail.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#View_Split_Position_doc'>View_Split_Position</a></div></div><hr>
<div id='close_view_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.28: close_view</h4>
<h4>&sect;3.3.25: close_view</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->close_view(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view<br></div>)
</div>
@ -631,7 +613,7 @@ If the given view is the active view, the next active view in the global
order of view will be made active.
If the given view is the last open view in the system, the call will fail.</div></div><hr>
<div id='set_active_view_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.29: set_active_view</h4>
<h4>&sect;3.3.26: set_active_view</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->set_active_view(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view<br></div>)
</div>
@ -643,7 +625,7 @@ If the given view is the last open view in the system, the call will fail.</div>
active view, and takes subsequent commands and is returned
from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_active_view_doc'>get_active_view</a></div></div><hr>
<div id='view_set_setting_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.30: view_set_setting</h4>
<h4>&sect;3.3.27: view_set_setting</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->view_set_setting(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>View_Setting_ID setting,<br>int32_t value<br></div>)
</div>
@ -661,7 +643,7 @@ from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; colo
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns non-zero on success.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#View_Setting_ID_doc'>View_Setting_ID</a></div></div><hr>
<div id='view_set_split_proportion_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.31: view_set_split_proportion</h4>
<h4>&sect;3.3.28: view_set_split_proportion</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->view_set_split_proportion(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>float t<br></div>)
</div>
@ -675,7 +657,7 @@ from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; colo
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns non-zero on success.</div></div><hr>
<div id='view_compute_cursor_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.32: view_compute_cursor</h4>
<h4>&sect;3.3.29: view_compute_cursor</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->view_compute_cursor(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Buffer_Seek seek,<br>Full_Cursor *cursor_out<br></div>)
</div>
@ -693,7 +675,7 @@ from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; colo
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns non-zero on success.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>Computes a Full_Cursor for the given seek position with no side effects.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Seek_doc'>Buffer_Seek</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Full_Cursor_doc'>Full_Cursor</a></div></div><hr>
<div id='view_set_cursor_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.33: view_set_cursor</h4>
<h4>&sect;3.3.30: view_set_cursor</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->view_set_cursor(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Buffer_Seek seek,<br>bool32 set_preferred_x<br></div>)
</div>
@ -713,7 +695,7 @@ from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; colo
unless the change in cursor position is is a vertical motion that tries to keep the
cursor in the same column or x position.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Seek_doc'>Buffer_Seek</a></div></div><hr>
<div id='view_set_mark_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.34: view_set_mark</h4>
<h4>&sect;3.3.31: view_set_mark</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->view_set_mark(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Buffer_Seek seek<br></div>)
</div>
@ -727,7 +709,7 @@ cursor in the same column or x position.</div><div style='margin-top: 3mm; margi
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns non-zero on success.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call sets the the view's mark position.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Buffer_Seek_doc'>Buffer_Seek</a></div></div><hr>
<div id='view_set_highlight_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.35: view_set_highlight</h4>
<h4>&sect;3.3.32: view_set_highlight</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->view_set_highlight(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>int32_t start,<br>int32_t end,<br>bool32 turn_on<br></div>)
</div>
@ -752,7 +734,7 @@ is set to true the highlight will be shown and the cursor will be hidden. After
that either setting the with view_set_cursor or calling view_set_highlight and
the turn_on set to false, will switch back to showing the cursor.</div></div><hr>
<div id='view_set_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.36: view_set_buffer</h4>
<h4>&sect;3.3.33: view_set_buffer</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->view_set_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Buffer_ID buffer_id,<br>Set_Buffer_Flag flags<br></div>)
</div>
@ -771,7 +753,7 @@ the turn_on set to false, will switch back to showing the cursor.</div></div><hr
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns non-zero on success.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>On success view_set_buffer sets the specified view's current buffer and
cancels and dialogue shown in the view and displays the file.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Set_Buffer_Flag_doc'>Set_Buffer_Flag</a></div></div><hr>
<div id='view_post_fade_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.37: view_post_fade</h4>
<h4>&sect;3.3.34: view_post_fade</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->view_post_fade(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>float seconds,<br>int32_t start,<br>int32_t end,<br>int_color color<br></div>)
</div>
@ -797,7 +779,7 @@ cancels and dialogue shown in the view and displays the file.</div><div style='m
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns non-zero on success.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#int_color_doc'>int_color</a></div></div><hr>
<div id='get_user_input_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.38: get_user_input</h4>
<h4>&sect;3.3.35: get_user_input</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>User_Input app->get_user_input(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Input_Type_Flag get_type,<br>Input_Type_Flag abort_type<br></div>)
</div>
@ -815,19 +797,19 @@ command is executed an abort signal is returned. If an abort signal is ever ret
command should finish execution without any more calls that preempt the command.
If a get condition is met the user input is returned.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Input_Type_Flag_doc'>Input_Type_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#User_Input_doc'>User_Input</a></div></div><hr>
<div id='get_command_input_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.39: get_command_input</h4>
<h4>&sect;3.3.36: get_command_input</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>User_Input app->get_command_input(
<div style='margin-left: 4mm;'>Application_Links *app<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns the input that triggered the currently executing command.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#User_Input_doc'>User_Input</a></div></div><hr>
<div id='get_mouse_state_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.40: get_mouse_state</h4>
<h4>&sect;3.3.37: get_mouse_state</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>Mouse_State app->get_mouse_state(
<div style='margin-left: 4mm;'>Application_Links *app<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call returns the current mouse state as of the beginning of the frame.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Mouse_State_doc'>Mouse_State</a></div></div><hr>
<div id='start_query_bar_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.41: start_query_bar</h4>
<h4>&sect;3.3.38: start_query_bar</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->start_query_bar(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Query_Bar *bar,<br>uint32_t flags<br></div>)
</div>
@ -847,7 +829,7 @@ can be changed after the call to start_query_bar and the query bar shown by 4cod
will reflect the change. Since the bar stops showing when the command exits the
only use for this call is in an interactive command that makes calls to get_user_input.</div></div><hr>
<div id='end_query_bar_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.42: end_query_bar</h4>
<h4>&sect;3.3.39: end_query_bar</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->end_query_bar(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Query_Bar *bar,<br>uint32_t flags<br></div>)
</div>
@ -861,7 +843,7 @@ only use for this call is in an interactive command that makes calls to get_user
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>Stops showing the particular query bar specified by the bar parameter.</div></div><hr>
<div id='print_message_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.43: print_message</h4>
<h4>&sect;3.3.40: print_message</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->print_message(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *str,<br>int32_t len<br></div>)
</div>
@ -875,7 +857,7 @@ only use for this call is in an interactive command that makes calls to get_user
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call posts a string to the *messages* buffer.</div></div><hr>
<div id='change_theme_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.44: change_theme</h4>
<h4>&sect;3.3.41: change_theme</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->change_theme(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *name,<br>int32_t len<br></div>)
</div>
@ -889,7 +871,7 @@ only use for this call is in an interactive command that makes calls to get_user
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call changes 4coder's theme to one of the built in themes.</div></div><hr>
<div id='change_font_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.45: change_font</h4>
<h4>&sect;3.3.42: change_font</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->change_font(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *name,<br>int32_t len<br></div>)
</div>
@ -903,7 +885,7 @@ only use for this call is in an interactive command that makes calls to get_user
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This call changes 4coder's font to one of the built in fonts.</div></div><hr>
<div id='set_theme_colors_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.46: set_theme_colors</h4>
<h4>&sect;3.3.43: set_theme_colors</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->set_theme_colors(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Theme_Color *colors,<br>int32_t count<br></div>)
</div>
@ -919,7 +901,7 @@ only use for this call is in an interactive command that makes calls to get_user
struct's tag is set to the color code in the struct. If the tag value is invalid
no change is made to the color pallet.</div></div><hr>
<div id='get_theme_colors_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.47: get_theme_colors</h4>
<h4>&sect;3.3.44: get_theme_colors</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->get_theme_colors(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Theme_Color *colors,<br>int32_t count<br></div>)
</div>
@ -935,7 +917,7 @@ no change is made to the color pallet.</div></div><hr>
color from the slot in the main color pallet specified by the tag. If the tag
value is invalid the color is filled with black.</div></div><hr>
<div id='directory_get_hot_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.48: directory_get_hot</h4>
<h4>&sect;3.3.45: directory_get_hot</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>int32_t app->directory_get_hot(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *out,<br>int32_t capacity<br></div>)
</div>
@ -953,7 +935,7 @@ accessed in the GUI. Whenever the GUI is opened it shows the hot directory.
In the future this will be deprecated and eliminated in favor of more flexible
directories controlled on the custom side.</div></div><hr>
<div id='get_file_list_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.49: get_file_list</h4>
<h4>&sect;3.3.46: get_file_list</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>File_List app->get_file_list(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *dir,<br>int32_t len<br></div>)
</div>
@ -969,7 +951,7 @@ directories controlled on the custom side.</div></div><hr>
the specified directory. The File_List returned should be passed to free_file_list
when it is no longer in use.</div></div><hr>
<div id='free_file_list_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.50: free_file_list</h4>
<h4>&sect;3.3.47: free_file_list</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->free_file_list(
<div style='margin-left: 4mm;'>Application_Links *app,<br>File_List list<br></div>)
</div>
@ -978,6 +960,24 @@ when it is no longer in use.</div></div><hr>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>This parameter provides the file list to be freed.</div></div>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>After this call the file list passed in should not be read or written to.</div></div><hr>
<div id='memory_allocate_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.48: memory_allocate</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void* app->memory_allocate(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int32_t size<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div><hr>
<div id='memory_set_protection_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.49: memory_set_protection</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->memory_set_protection(
<div style='margin-left: 4mm;'>Application_Links *app,<br>void *ptr,<br>int32_t size,<br>Memory_Protect_Flags flags<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div><hr>
<div id='memory_free_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.50: memory_free</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>void app->memory_free(
<div style='margin-left: 4mm;'>Application_Links *app,<br>void *mem,<br>int32_t size<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div><hr>
<div id='file_exists_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.3.51: file_exists</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>bool32 app->file_exists(
@ -1373,15 +1373,15 @@ Flags can be combined with bit or to specify a state with multiple modifiers.</d
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Memory_Protect_Flags;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>MemProtect_Read</span> = 0x1</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'></div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>MemProtect_Write</span> = 0x2</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'></div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>MemProtect_Execute</span> = 0x4</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'></div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
</div><hr>
<div id='Buffer_Create_Flag_doc' style='margin-bottom: 1cm;'>

View File

@ -1,8 +1,5 @@
#define EXEC_COMMAND_SIG(n) bool32 n(Application_Links *app, Command_ID command_id)
#define EXEC_SYSTEM_COMMAND_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_Identifier buffer, char *path, int32_t path_len, char *command, int32_t command_len, Command_Line_Input_Flag flags)
#define MEMORY_ALLOC_SIG(n) void* n(Application_Links *app, int32_t size)
#define MEMORY_SET_PROTECTION_SIG(n) int32_t n(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags)
#define MEMORY_FREE_SIG(n) void n(Application_Links *app, void *mem)
#define CLIPBOARD_POST_SIG(n) void n(Application_Links *app, int32_t clipboard_id, char *str, int32_t len)
#define CLIPBOARD_COUNT_SIG(n) int32_t n(Application_Links *app, int32_t clipboard_id)
#define CLIPBOARD_INDEX_SIG(n) int32_t n(Application_Links *app, int32_t clipboard_id, int32_t item_index, char *out, int32_t len)
@ -48,6 +45,9 @@
#define DIRECTORY_GET_HOT_SIG(n) int32_t n(Application_Links *app, char *out, int32_t capacity)
#define GET_FILE_LIST_SIG(n) File_List n(Application_Links *app, char *dir, int32_t len)
#define FREE_FILE_LIST_SIG(n) void n(Application_Links *app, File_List list)
#define MEMORY_ALLOCATE_SIG(n) void* n(Application_Links *app, int32_t size)
#define MEMORY_SET_PROTECTION_SIG(n) bool32 n(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags)
#define MEMORY_FREE_SIG(n) void n(Application_Links *app, void *mem, int32_t size)
#define FILE_EXISTS_SIG(n) bool32 n(Application_Links *app, char *filename, int len)
#define DIRECTORY_CD_SIG(n) bool32 n(Application_Links *app, char *dir, int *len, int capacity, char *rel_path, int rel_len)
#define GET_4ED_PATH_SIG(n) bool32 n(Application_Links *app, char *out, int32_t capacity)
@ -55,9 +55,6 @@
extern "C"{
typedef EXEC_COMMAND_SIG(Exec_Command_Function);
typedef EXEC_SYSTEM_COMMAND_SIG(Exec_System_Command_Function);
typedef MEMORY_ALLOC_SIG(Memory_Alloc_Function);
typedef MEMORY_SET_PROTECTION_SIG(Memory_Set_Protection_Function);
typedef MEMORY_FREE_SIG(Memory_Free_Function);
typedef CLIPBOARD_POST_SIG(Clipboard_Post_Function);
typedef CLIPBOARD_COUNT_SIG(Clipboard_Count_Function);
typedef CLIPBOARD_INDEX_SIG(Clipboard_Index_Function);
@ -103,6 +100,9 @@ extern "C"{
typedef DIRECTORY_GET_HOT_SIG(Directory_Get_Hot_Function);
typedef GET_FILE_LIST_SIG(Get_File_List_Function);
typedef FREE_FILE_LIST_SIG(Free_File_List_Function);
typedef MEMORY_ALLOCATE_SIG(Memory_Allocate_Function);
typedef MEMORY_SET_PROTECTION_SIG(Memory_Set_Protection_Function);
typedef MEMORY_FREE_SIG(Memory_Free_Function);
typedef FILE_EXISTS_SIG(File_Exists_Function);
typedef DIRECTORY_CD_SIG(Directory_CD_Function);
typedef GET_4ED_PATH_SIG(Get_4ed_Path_Function);
@ -113,9 +113,6 @@ struct Application_Links{
int memory_size;
Exec_Command_Function *exec_command;
Exec_System_Command_Function *exec_system_command;
Memory_Alloc_Function *memory_alloc;
Memory_Set_Protection_Function *memory_set_protection;
Memory_Free_Function *memory_free;
Clipboard_Post_Function *clipboard_post;
Clipboard_Count_Function *clipboard_count;
Clipboard_Index_Function *clipboard_index;
@ -161,6 +158,9 @@ struct Application_Links{
Directory_Get_Hot_Function *directory_get_hot;
Get_File_List_Function *get_file_list;
Free_File_List_Function *free_file_list;
Memory_Allocate_Function *memory_allocate;
Memory_Set_Protection_Function *memory_set_protection;
Memory_Free_Function *memory_free;
File_Exists_Function *file_exists;
Directory_CD_Function *directory_cd;
Get_4ed_Path_Function *get_4ed_path;
@ -173,9 +173,6 @@ struct Application_Links{
#define FillAppLinksAPI(app_links) do{\
app_links->exec_command = Exec_Command;\
app_links->exec_system_command = Exec_System_Command;\
app_links->memory_alloc = Memory_Alloc;\
app_links->memory_set_protection = Memory_Set_Protection;\
app_links->memory_free = Memory_Free;\
app_links->clipboard_post = Clipboard_Post;\
app_links->clipboard_count = Clipboard_Count;\
app_links->clipboard_index = Clipboard_Index;\
@ -221,6 +218,9 @@ app_links->get_theme_colors = Get_Theme_Colors;\
app_links->directory_get_hot = Directory_Get_Hot;\
app_links->get_file_list = Get_File_List;\
app_links->free_file_list = Free_File_List;\
app_links->memory_allocate = Memory_Allocate;\
app_links->memory_set_protection = Memory_Set_Protection;\
app_links->memory_free = Memory_Free;\
app_links->file_exists = File_Exists;\
app_links->directory_cd = Directory_CD;\
app_links->get_4ed_path = Get_4ed_Path;\

View File

@ -133,6 +133,8 @@ HOOK_SIG(my_start){
app->change_theme(app, literal("4coder"));
app->change_font(app, literal("Liberation Sans"));
init_memory(app);
// Theme options:
// "4coder"
// "Handmade Hero"
@ -291,7 +293,7 @@ default_keys(Bind_Helper *context){
bind(context, ';', MDFR_NONE, write_and_auto_tab);
bind(context, '#', MDFR_NONE, write_and_auto_tab);
bind(context, '\t', MDFR_NONE, cmdid_word_complete);
bind(context, '\t', MDFR_NONE, word_complete);
bind(context, '\t', MDFR_CTRL, auto_tab_range);
bind(context, '\t', MDFR_SHIFT, auto_tab_line_at_cursor);

View File

@ -15,8 +15,21 @@
// Memory
//
static Partition scratch;
static Partition part;
static General_Memory general;
void
init_memory(Application_Links *app){
int part_size = (1 << 20);
int general_size = (1 << 20);
void *part_mem = app->memory_allocate(app, part_size);
part = make_part(part_mem, part_size);
void *general_mem = app->memory_allocate(app, general_size);
general_memory_open(&general, general_mem, general_size);
}
//
// Buffer Streaming
@ -819,6 +832,7 @@ CUSTOM_COMMAND_SIG(to_uppercase){
mem[i] = char_to_upper(mem[i]);
}
app->buffer_replace_range(app, &buffer, range.min, range.max, mem, size);
app->view_set_cursor(app, &view, seek_pos(range.max), true);
}
}
@ -836,6 +850,7 @@ CUSTOM_COMMAND_SIG(to_lowercase){
mem[i] = char_to_lower(mem[i]);
}
app->buffer_replace_range(app, &buffer, range.min, range.max, mem, size);
app->view_set_cursor(app, &view, seek_pos(range.max), true);
}
}
@ -2192,7 +2207,7 @@ CUSTOM_COMMAND_SIG(word_complete){
if (view_paste_index[view.view_id].rewrite != RewriteWordComplete){
do_init = true;
}
view_paste_index[view.view_id].next_rewrite != RewriteWordComplete;
view_paste_index[view.view_id].next_rewrite = RewriteWordComplete;
if (!complete_state.initialized){
do_init = true;
}
@ -2297,7 +2312,8 @@ CUSTOM_COMMAND_SIG(word_complete){
if (match.found_match){
int match_size = match.end - match.start;
char *spare = (char*)GET_MEMORY(match_size);
Temp_Memory temp = begin_temp_memory(&part);
char *spare = push_array(&part, char, match_size);
app->buffer_read_range(app, &match.buffer,
match.start, match.end, spare);
@ -2312,10 +2328,10 @@ CUSTOM_COMMAND_SIG(word_complete){
complete_state.word_end = word_start + match_size;
complete_state.set.ranges[0].mid_size = match_size;
FREE_MEMORY(spare);
end_temp_memory(temp);
break;
}
FREE_MEMORY(spare);
end_temp_memory(temp);
}
else{
complete_state.iter.pos = 0;

View File

@ -38,24 +38,17 @@ struct Search_Match{
int found_match;
};
// TODO(allen): HOW DO I WANT TO GET MEMORY CUSTOM SIDE??
#define GET_MEMORY(a) (void*)(0)
#define REGET_MEMORY(a,b) (void*)(0)
#define REGET_NOCOPY_MEMORY(a,b) (void*)(0)
#define FREE_MEMORY(a) (void)(a)
static void
search_iter_init(Application_Links *app, Search_Iter *iter, int size){
int str_max = size*2;
if (iter->word.str == 0){
iter->word.str = (char*)GET_MEMORY(str_max);
iter->word.str = (char*)general_memory_allocate(&general, str_max);
iter->word.memory_size = str_max;
}
else if (iter->word.memory_size < size){
iter->word.str = (char*)REGET_MEMORY(iter->word.str, str_max);
iter->word.str = (char*)general_memory_reallocate_nocopy(&general, iter->word.str, str_max);
iter->word.memory_size = str_max;
}
iter->i = 0;
iter->pos = 0;
}
@ -65,11 +58,12 @@ search_set_init(Application_Links *app, Search_Set *set, int range_count){
int max = range_count*2;
if (set->ranges == 0){
set->ranges = (Search_Range*)GET_MEMORY(sizeof(Search_Range)*max);
set->ranges = (Search_Range*)general_memory_allocate(&general, sizeof(Search_Range)*max);
set->max = max;
}
else if (set->max < range_count){
set->ranges = (Search_Range*)REGET_MEMORY(set->ranges, sizeof(Search_Range)*max);
set->ranges = (Search_Range*)general_memory_reallocate_nocopy(
&general, set->ranges, sizeof(Search_Range)*max);
set->max = max;
}
@ -81,10 +75,10 @@ search_hits_table_alloc(Application_Links *app, Table *hits, int table_size){
void *mem = 0;
int mem_size = table_required_mem_size(table_size, sizeof(Offset_String));
if (hits->hash_array == 0){
mem = GET_MEMORY(mem_sze);
mem = general_memory_allocate(&general, mem_size);
}
else{
mem = REGET_NOCOPY_MEMORY(hits->hash_array, mem_sze);
mem = general_memory_reallocate_nocopy(&general, hits->hash_array, mem_size);
}
table_init_memory(hits, mem, table_size, sizeof(Offset_String));
}
@ -96,16 +90,16 @@ search_hits_init(Application_Links *app, Table *hits, String_Space *str, int tab
}
else{
int mem_size = table_required_mem_size(table_size, sizeof(Offset_String));
void *mem = REGET_NOCOPY_MEMORY(mem, mem_size);
void *mem = general_memory_reallocate_nocopy(&general, hits->hash_array, mem_size);
table_init_memory(hits, mem, table_size, sizeof(Offset_String));
}
if (str->space == 0){
str->space = (char*)GET_MEMORY(str_size);
str->space = (char*)general_memory_allocate(&general, str_size);
str->max = str_size;
}
else if (str->max < str_size){
str->space = (char*)REGET_NOCOPY_MEMORY(str->space, str_size);
str->space = (char*)general_memory_reallocate_nocopy(&general, str->space, str_size);
str->max = str_size;
}
@ -125,7 +119,8 @@ search_hit_add(Application_Links *app, Table *hits, String_Space *space, char *s
if (new_size < space->max + len){
new_size = space->max + len;
}
space->space = (char*)REGET_MEMORY(space->space, new_size);
space->space = (char*)general_memory_reallocate(
&general, space->space, space->new_pos, new_size);
ostring = strspace_append(space, str, len);
}
@ -136,7 +131,7 @@ search_hit_add(Application_Links *app, Table *hits, String_Space *space, char *s
search_hits_table_alloc(app, &new_hits, hits->max*2);
table_clear(&new_hits);
table_rehash(hits, &new_hits, space->space, tbl_offset_string_hash, tbl_offset_string_compare);
FREE_MEMORY(hits->hash_array);
general_memory_free(&general, hits->hash_array);
*hits = new_hits;
}
@ -293,8 +288,6 @@ search_next_match(Application_Links *app, Search_Set *set, Search_Iter *it_ptr){
Search_Match result = {0};
Search_Iter iter = *it_ptr;
char *spare = (char*)GET_MEMORY(iter.word.size);
int count = set->count;
for (; iter.i < count;){
Search_Range *range = set->ranges + iter.i;
@ -396,8 +389,6 @@ search_next_match(Application_Links *app, Search_Set *set, Search_Iter *it_ptr){
}
double_break:;
FREE_MEMORY(spare);
*it_ptr = iter;
return(result);

View File

@ -338,28 +338,6 @@ DOC_SEE(Command_Line_Input_Flag)
return(result);
}
API_EXPORT void*
Memory_Alloc(Application_Links *app, int32_t size)/*
DOC(TODO)
*/{
void *result = 0;
return(result);
}
API_EXPORT int32_t
Memory_Set_Protection(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags)/*
DOC(TODO)
*/{
int32_t result = 0;
return(result);
}
API_EXPORT void
Memory_Free(Application_Links *app, void *mem)/*
DOC(TODO)
*/{
}
API_EXPORT void
Clipboard_Post(Application_Links *app, int32_t clipboard_id, char *str, int32_t len)/*
DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.)
@ -1941,6 +1919,10 @@ directories controlled on the custom side.
return(hot->string.size);
}
#define Memory_Allocate system->memory_allocate
#define Memory_Set_Protection system->memory_set_protection
#define Memory_Free system->memory_free
#define Get_4ed_Path system->get_4ed_path
#define File_Exists system->file_exists
#define Directory_CD system->directory_cd

View File

@ -6142,7 +6142,8 @@ search_next_match(Partition *part, Search_Set *set, Search_Iter *iter_){
if (iter.pos + iter.word.size < end_pos){
start_pos = Max(iter.pos, range->start);
result.start = buffer_find_string(range->buffer, start_pos, end_pos, iter.word.str, iter.word.size, spare);
result.start = buffer_find_string(
range->buffer, start_pos, end_pos, iter.word.str, iter.word.size, spare);
if (result.start < end_pos){
iter.pos = result.start + 1;

View File

@ -220,7 +220,7 @@ typedef INTERNAL_Sys_Get_Thread_States_Sig(INTERNAL_System_Get_Thread_States);
typedef INTERNAL_Sys_Debug_Message_Sig(INTERNAL_System_Debug_Message);
struct System_Functions{
// files: 7
// files: 9
System_File_Time_Stamp *file_time_stamp;
System_Now_Time_Stamp *now_time_stamp;
System_Set_File_List *set_file_list;
@ -231,7 +231,10 @@ struct System_Functions{
System_File_Load_End *file_load_end;
System_File_Save *file_save;
// 4coder_custom.h: 3
// 4coder_custom.h: 7
Memory_Allocate_Function *memory_allocate;
Memory_Set_Protection_Function *memory_set_protection;
Memory_Free_Function *memory_free;
File_Exists_Function *file_exists;
Directory_CD_Function *directory_cd;
Get_4ed_Path_Function *get_4ed_path;

View File

@ -163,12 +163,9 @@ buffer_unsort_cursors(Cursor_With_Index *positions, int count){
internal_4tech void
buffer_update_cursors(Cursor_With_Index *sorted_positions, int count, int start, int end, int len){
Cursor_With_Index *position;
int shift_amount;
int shift_amount = (len - (end - start));
Cursor_With_Index *position = sorted_positions + count - 1;
shift_amount = (len - (end - start));
position = sorted_positions + count - 1;
for (; position >= sorted_positions && position->pos > end; --position) position->pos += shift_amount;
for (; position >= sorted_positions && position->pos >= start; --position) position->pos = start;
}

View File

@ -1,6 +1,6 @@
/*
* Mr. 4th Dimention - Allen Webster
* (Mostly by insofaras)
*
* 14.11.2015
*
@ -629,6 +629,68 @@ Sys_File_Save_Sig(system_file_save){
return (size == 0);
}
//
// Custom access to OS pages
//
internal
MEMORY_ALLOCATE_SIG(system_memory_allocate){
// NOTE(allen): This must return the exact base of the vpage.
// We will count on the user to keep track of size themselves.
void *result = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if(result == MAP_FAILED){
perror("mmap");
result = NULL;
}
return(result);
}
internal
MEMORY_SET_PROTECTION_SIG(system_memory_set_protection){
#if 0
// NOTE(allen): Don't know how to do this off the top
// of my head. Here is a copy of the windows version.
// There is no such thing as "write only" in windows
// so I just made write = write + read in all cases.
bool32 result = false;
DWORD old_protect = 0;
DWORD protect = 0;
flags = flags & 0x7;
switch (flags){
case 0:
protect = PAGE_NOACCESS; break;
case MemProtect_Read:
protect = PAGE_READONLY; break;
case MemProtect_Write:
case MemProtect_Read|MemProtect_Write:
protect = PAGE_READWRITE; break;
case MemProtect_Execute:
protect = PAGE_EXECUTE; break;
case MemProtect_Execute|MemProtect_Read:
protect = PAGE_EXECUTE_READ; break;
case MemProtect_Execute|MemProtect_Write:
case MemProtect_Execute|MemProtect_Write|MemProtect_Read:
protect = PAGE_EXECUTE_READWRITE; break;
}
VirtualProtect(ptr, size, protect, &old_protect);
return(result);
#endif
}
internal
MEMORY_FREE_SIG(system_memory_free){
// NOTE(allen): This must take the exact base of the vpage.
munmap(mem, size);
}
//
// Filesystem navigation
//

View File

@ -166,43 +166,6 @@ CUSTOM_COMMAND_SIG(cursor_to_surrounding_scope){
}
}
// NOTE(allen): Incomplete
#if 0
CUSTOM_COMMAND_SIG(complete_word){
app->print_message(app, literal("complete_word\n"));
View_Summary view = app->get_active_view(app);
Buffer_Summary buffer = app->get_buffer(app, view.buffer_id);
int start = 0;
int end = 0;
end = view.cursor.pos;
push_parameter(app, par_flags, BoundryAlphanumeric);
exec_command(app, cmdid_seek_left);
app->refresh_view(app, &view);
start = view.cursor.pos;
String complete_string;
int size = (end - start);
char complete_space[256];
if (size < sizeof(complete_space) - 1){
complete_string = make_fixed_width_string(complete_space);
app->buffer_read_range(app, &buffer, start, end, complete_space);
complete_string.size = size;
complete_string.str[size] = 0;
// TODO(allen): Complete this when the heavy duty coroutine stuff
// and the hash table are available.
app->print_message(app, complete_string.str, complete_string.size);
}
}
#endif
// TODO(allen): Query theme settings
#if 0
CUSTOM_COMMAND_SIG(save_theme_settings){
@ -215,23 +178,15 @@ CUSTOM_COMMAND_SIG(save_theme_settings){
if (file){
replace_char(theme_name, '#', ' ');
replace_char(font_name, '#', ' ');
fclose(file);
app->change_theme(app, theme_name, strlen(theme_name));
app->change_font(app, font_name, strlen(font_name));
}
}
#endif
#if 0
void experiment_extension(Bind_Helper *context){
bind(context, 'k', MDFR_ALT, kill_rect);
bind(context, '/', MDFR_ALT, mark_matching_brace);
bind(context, '\'', MDFR_ALT, cursor_to_surrounding_scope);
}
#endif
#include <stdio.h>
#define SETTINGS_FILE ".4coder_settings"

View File

@ -1172,7 +1172,7 @@ Win32LoadAppCode(){
#else
File_Data file = system_load_file("4ed_app.dll");
if (file.got_file){
i32 error;
DLL_Data dll_data;
@ -1181,30 +1181,30 @@ Win32LoadAppCode(){
img.size = dll_total_loaded_size(&dll_data);
img.data = (byte*)
VirtualAlloc((LPVOID)Tbytes(3), img.size,
MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE);
MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE);
dll_load(img, &win32vars.app_dll, file.data, &dll_data);
DWORD extra_;
VirtualProtect(img.data + win32vars.app_dll.text_start,
win32vars.app_dll.text_size,
PAGE_EXECUTE_READ,
&extra_);
win32vars.app_dll.text_size,
PAGE_EXECUTE_READ,
&extra_);
get_funcs = (App_Get_Functions*)
dll_load_function(&win32vars.app_dll, "app_get_functions", 17);
}
else{
// TODO(allen): file loading error
}
Win32FreeMemory(file.data.data);
}
else{
// TODO(allen): file loading error
}
#endif
if (get_funcs){
@ -1226,37 +1226,38 @@ Win32LoadSystemCode(){
win32vars.system.file_load_begin = system_file_load_begin;
win32vars.system.file_load_end = system_file_load_end;
win32vars.system.file_save = system_file_save;
win32vars.system.memory_allocate = Memory_Allocate;
win32vars.system.file_exists = File_Exists;
win32vars.system.directory_cd = Directory_CD;
win32vars.system.get_4ed_path = Get_4ed_Path;
win32vars.system.show_mouse_cursor = Show_Mouse_Cursor;
win32vars.system.post_clipboard = system_post_clipboard;
win32vars.system.create_coroutine = system_create_coroutine;
win32vars.system.launch_coroutine = system_launch_coroutine;
win32vars.system.resume_coroutine = system_resume_coroutine;
win32vars.system.yield_coroutine = system_yield_coroutine;
win32vars.system.cli_call = system_cli_call;
win32vars.system.cli_begin_update = system_cli_begin_update;
win32vars.system.cli_update_step = system_cli_update_step;
win32vars.system.cli_end_update = system_cli_end_update;
win32vars.system.post_job = system_post_job;
win32vars.system.cancel_job = system_cancel_job;
win32vars.system.check_cancel = system_check_cancel;
win32vars.system.grow_thread_memory = system_grow_thread_memory;
win32vars.system.acquire_lock = system_acquire_lock;
win32vars.system.release_lock = system_release_lock;
#if FRED_INTERNAL
win32vars.system.internal_sentinel = INTERNAL_system_sentinel;
win32vars.system.internal_get_thread_states = INTERNAL_get_thread_states;
win32vars.system.internal_debug_message = INTERNAL_system_debug_message;
#endif
win32vars.system.slash = '/';
}

View File

@ -11,6 +11,57 @@ as this is the only one that will be used for generating headers and docs.
#define API_EXPORT
API_EXPORT void*
Memory_Allocate(Application_Links *app, int32_t size)/*
DOC(TODO)
*/{
void *result = VirtualAlloc(0, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
return(result);
}
API_EXPORT bool32
Memory_Set_Protection(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags)/*
DOC(TODO)
*/{
bool32 result = false;
DWORD old_protect = 0;
DWORD protect = 0;
flags = flags & 0x7;
switch (flags){
case 0:
protect = PAGE_NOACCESS; break;
case MemProtect_Read:
protect = PAGE_READONLY; break;
case MemProtect_Write:
case MemProtect_Read|MemProtect_Write:
protect = PAGE_READWRITE; break;
case MemProtect_Execute:
protect = PAGE_EXECUTE; break;
case MemProtect_Execute|MemProtect_Read:
protect = PAGE_EXECUTE_READ; break;
case MemProtect_Execute|MemProtect_Write:
case MemProtect_Execute|MemProtect_Write|MemProtect_Read:
protect = PAGE_EXECUTE_READWRITE; break;
}
VirtualProtect(ptr, size, protect, &old_protect);
return(result);
}
API_EXPORT void
Memory_Free(Application_Links *app, void *mem, int32_t size)/*
DOC(TODO)
*/{
VirtualFree(mem, 0, MEM_RELEASE);
}
API_EXPORT bool32
File_Exists(Application_Links *app, char *filename, int len)/*
DOC_PARAM(filename, This parameter specifies the full path to a file; it need not be null terminated.)