diff --git a/4coder_API.html b/4coder_API.html
index 8c080761..7bef8f01 100644
--- a/4coder_API.html
+++ b/4coder_API.html
@@ -22,7 +22,7 @@ ul { list-style: none; padding: 0; margin: 0; }
§1 Introduction
-This is the documentation for alpha 4.0.9 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.
+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.
If you have questions or discover errors please contact editor@4coder.net or to get help from community members you can post on the 4coder forums hosted on handmade.network at 4coder.handmade.network
@@ -34,9 +34,13 @@ Coming Soon
+
+
§3.3.3: memory_alloc
+
void* app->memory_alloc(
+
Application_Links *app,
int32_t size
)
+
+
Description
TODO
+
+
§3.3.4: memory_set_protection
+
int32_t app->memory_set_protection(
+
Application_Links *app,
void *ptr,
int32_t size,
Memory_Protect_Flags flags
)
+
+
Description
TODO
+
+
§3.3.5: memory_free
+
void app->memory_free(
+
Application_Links *app,
void *mem
)
+
+
Description
TODO
-
§3.3.3: clipboard_post
+
§3.3.6: clipboard_post
void app->clipboard_post(
Application_Links *app,
int32_t clipboard_id,
char *str,
int32_t len
)
@@ -202,7 +225,7 @@ If the view parameter is NULL, no view will switch to the output.
-
§3.3.4: clipboard_count
+
§3.3.7: clipboard_count
int32_t app->clipboard_count(
Application_Links *app,
int32_t clipboard_id
)
@@ -212,7 +235,7 @@ be pasted into other applications.
Description
This call returns the number of items in the clipboard.
See Also
-
§3.3.5: clipboard_index
+
§3.3.8: clipboard_index
int32_t app->clipboard_index(
Application_Links *app,
int32_t clipboard_id,
int32_t item_index,
char *out,
int32_t len
)
@@ -235,8 +258,14 @@ be pasted into other applications.
Return
This call returns the size of the item associated with item_index.
Description
This function always returns the size of the item even if the output buffer is NULL.
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.
See Also
+
+
§3.3.9: get_buffer_count
+
int32_t app->get_buffer_count(
+
Application_Links *app
)
+
+
Description
TODO
-
§3.3.6: get_buffer_first
+
§3.3.10: get_buffer_first
Buffer_Summary app->get_buffer_first(
Application_Links *app,
Access_Flag access
)
@@ -249,7 +278,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.
See Also
-
§3.3.7: get_buffer_next
+
§3.3.11: get_buffer_next
void app->get_buffer_next(
Application_Links *app,
Buffer_Summary *buffer,
Access_Flag access
)
@@ -267,7 +296,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.
See Also
-
§3.3.8: get_buffer
+
§3.3.12: get_buffer
Buffer_Summary app->get_buffer(
Application_Links *app,
Buffer_ID buffer_id,
Access_Flag access
)
@@ -281,7 +310,7 @@ Buffers should not be killed or created durring a buffer loop.
Return
This call returns a summary that describes the indicated buffer if it exists and is accessible.
See Also
-
§3.3.9: get_buffer_by_name
+
§3.3.13: get_buffer_by_name
Buffer_Summary app->get_buffer_by_name(
Application_Links *app,
char *name,
int32_t len,
Access_Flag access
)
@@ -299,7 +328,7 @@ Buffers should not be killed or created durring a buffer loop.
Return
This call returns a summary that describes the indicated buffer if it exists and is accessible.
See Also
-
§3.3.10: buffer_boundary_seek
+
§3.3.14: buffer_boundary_seek
int32_t app->buffer_boundary_seek(
Application_Links *app,
Buffer_Summary *buffer,
int32_t start_pos,
bool32 seek_forward,
Seek_Boundary_Flag flags
)
@@ -323,7 +352,7 @@ Buffers should not be killed or created durring a buffer loop.
See Also
-
§3.3.11: buffer_read_range
+
§3.3.15: buffer_read_range
bool32 app->buffer_read_range(
Application_Links *app,
Buffer_Summary *buffer,
int32_t start,
int32_t end,
char *out
)
@@ -349,7 +378,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.
See Also
-
§3.3.12: buffer_replace_range
+
§3.3.16: buffer_replace_range
bool32 app->buffer_replace_range(
Application_Links *app,
Buffer_Summary *buffer,
int32_t start,
int32_t end,
char *str,
int32_t len
)
@@ -382,7 +411,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.
See Also
-
§3.3.13: buffer_batch_edit
+
§3.3.17: buffer_batch_edit
bool32 app->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
)
@@ -406,9 +435,9 @@ range is not within the bounds of the buffer.
type
This prameter specifies what type of batch edit to execute.
-Return
This call returns non-zero if the batch edit succeeds.
See Also
+Return
This call returns non-zero if the batch edit succeeds.
Description
TODO
See Also
-
§3.3.14: buffer_set_setting
+
§3.3.18: buffer_set_setting
bool32 app->buffer_set_setting(
Application_Links *app,
Buffer_Summary *buffer,
Buffer_Setting_ID setting,
int32_t value
)
@@ -426,7 +455,7 @@ range is not within the bounds of the buffer.
See Also
-
§3.3.15: buffer_auto_indent
+
§3.3.19: buffer_auto_indent
bool32 app->buffer_auto_indent(
Application_Links *app,
Buffer_Summary *buffer,
int32_t start,
int32_t end,
int32_t tab_width,
Auto_Indent_Flag flags
)
@@ -455,7 +484,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.
See Also
-
§3.3.16: create_buffer
+
§3.3.20: create_buffer
Buffer_Summary app->create_buffer(
Application_Links *app,
char *filename,
int32_t filename_len,
Buffer_Create_Flag flags
)
@@ -477,7 +506,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.
See Also
-
§3.3.17: save_buffer
+
§3.3.21: save_buffer
bool32 app->save_buffer(
Application_Links *app,
Buffer_Summary *buffer,
char *filename,
int32_t filename_len,
uint32_t flags
)
@@ -499,7 +528,7 @@ the filename does not correspond to a file on disk the buffer is created empty.<
Return
This call returns non-zero on success.
-
§3.3.18: kill_buffer
+
§3.3.22: kill_buffer
bool32 app->kill_buffer(
Application_Links *app,
Buffer_Identifier buffer,
View_ID view_id,
Buffer_Kill_Flag flags
)
@@ -519,7 +548,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.
See Also
-
§3.3.19: get_view_first
+
§3.3.23: get_view_first
View_Summary app->get_view_first(
Application_Links *app,
Access_Flag access
)
@@ -532,7 +561,7 @@ If the view is not open the kill fails.
See Also
-
§3.3.20: get_view_next
+
§3.3.24: get_view_next
void app->get_view_next(
Application_Links *app,
View_Summary *view,
Access_Flag access
)
@@ -549,7 +578,7 @@ Views should not be closed or opened durring a view loop.
See Also
-
§3.3.21: get_view
+
§3.3.25: get_view
View_Summary app->get_view(
Application_Links *app,
View_ID view_id,
Access_Flag access
)
@@ -563,7 +592,7 @@ Views should not be closed or opened durring a view loop.
Return
This call returns a summary that describes the indicated view if it is open and accessible.
See Also
-
§3.3.22: get_active_view
+
§3.3.26: get_active_view
View_Summary app->get_active_view(
Application_Links *app,
Access_Flag access
)
@@ -573,7 +602,7 @@ Views should not be closed or opened durring a view loop.
Return
This call returns a summary that describes the active view.
See Also
-
§3.3.23: open_view
+
§3.3.27: open_view
View_Summary app->open_view(
Application_Links *app,
View_Summary *view_location,
View_Split_Position position
)
@@ -589,7 +618,7 @@ Views should not be closed or opened durring a view loop.
Description
4coder is built with a limit of 16 views. If 16 views are already open when this is called the
call will fail.
See Also
-
§3.3.24: close_view
+
§3.3.28: close_view
bool32 app->close_view(
Application_Links *app,
View_Summary *view
)
@@ -602,7 +631,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.
-
§3.3.25: set_active_view
+
§3.3.29: set_active_view
bool32 app->set_active_view(
Application_Links *app,
View_Summary *view
)
@@ -614,7 +643,7 @@ If the given view is the last open view in the system, the call will fail.
active view, and takes subsequent commands and is returned
from get_active_view.See Also
-
§3.3.26: view_set_setting
+
§3.3.30: view_set_setting
bool32 app->view_set_setting(
Application_Links *app,
View_Summary *view,
View_Setting_ID setting,
int32_t value
)
@@ -632,7 +661,7 @@ from get_active_view.
Return
This call returns non-zero on success.
See Also
-
§3.3.27: view_set_split_proportion
+
§3.3.31: view_set_split_proportion
bool32 app->view_set_split_proportion(
Application_Links *app,
View_Summary *view,
float t
)
@@ -646,7 +675,7 @@ from get_active_view.
Return
This call returns non-zero on success.
-
§3.3.28: view_compute_cursor
+
§3.3.32: view_compute_cursor
bool32 app->view_compute_cursor(
Application_Links *app,
View_Summary *view,
Buffer_Seek seek,
Full_Cursor *cursor_out
)
@@ -664,7 +693,7 @@ from get_active_view.
Return
This call returns non-zero on success.
Description
Computes a Full_Cursor for the given seek position with no side effects.
See Also
-
§3.3.29: view_set_cursor
+
§3.3.33: view_set_cursor
bool32 app->view_set_cursor(
Application_Links *app,
View_Summary *view,
Buffer_Seek seek,
bool32 set_preferred_x
)
@@ -684,7 +713,7 @@ from get_active_view.
See Also
-
§3.3.30: view_set_mark
+
§3.3.34: view_set_mark
bool32 app->view_set_mark(
Application_Links *app,
View_Summary *view,
Buffer_Seek seek
)
@@ -698,7 +727,7 @@ cursor in the same column or x position.
Return
This call returns non-zero on success.
Description
This call sets the the view's mark position.
See Also
-
§3.3.31: view_set_highlight
+
§3.3.35: view_set_highlight
bool32 app->view_set_highlight(
Application_Links *app,
View_Summary *view,
int32_t start,
int32_t end,
bool32 turn_on
)
@@ -723,7 +752,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.
-
§3.3.32: view_set_buffer
+
§3.3.36: view_set_buffer
bool32 app->view_set_buffer(
Application_Links *app,
View_Summary *view,
Buffer_ID buffer_id,
Set_Buffer_Flag flags
)
@@ -742,7 +771,7 @@ the turn_on set to false, will switch back to showing the cursor.
ReturnThis call returns non-zero on success.
Description
On success view_set_buffer sets the specified view's current buffer and
cancels and dialogue shown in the view and displays the file.
See Also
-
§3.3.33: view_post_fade
+
§3.3.37: view_post_fade
bool32 app->view_post_fade(
Application_Links *app,
View_Summary *view,
float seconds,
int32_t start,
int32_t end,
int_color color
)
@@ -768,7 +797,7 @@ cancels and dialogue shown in the view and displays the file.
Return
This call returns non-zero on success.
See Also
See Also
-
§3.3.36: get_mouse_state
+
§3.3.40: get_mouse_state
Mouse_State app->get_mouse_state(
Application_Links *app
)
Return
This call returns the current mouse state as of the beginning of the frame.
See Also
-
§3.3.37: start_query_bar
+
§3.3.41: start_query_bar
bool32 app->start_query_bar(
Application_Links *app,
Query_Bar *bar,
uint32_t flags
)
@@ -818,7 +847,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.
-
§3.3.38: end_query_bar
+
§3.3.42: end_query_bar
void app->end_query_bar(
Application_Links *app,
Query_Bar *bar,
uint32_t flags
)
@@ -832,7 +861,7 @@ only use for this call is in an interactive command that makes calls to get_user
Description
Stops showing the particular query bar specified by the bar parameter.
-
§3.3.39: print_message
+
§3.3.43: print_message
void app->print_message(
Application_Links *app,
char *str,
int32_t len
)
@@ -846,7 +875,7 @@ only use for this call is in an interactive command that makes calls to get_user
Description
This call posts a string to the *messages* buffer.
-
§3.3.40: change_theme
+
§3.3.44: change_theme
void app->change_theme(
Application_Links *app,
char *name,
int32_t len
)
@@ -860,7 +889,7 @@ only use for this call is in an interactive command that makes calls to get_user
Description
This call changes 4coder's theme to one of the built in themes.
-
§3.3.41: change_font
+
§3.3.45: change_font
void app->change_font(
Application_Links *app,
char *name,
int32_t len
)
@@ -874,7 +903,7 @@ only use for this call is in an interactive command that makes calls to get_user
Description
This call changes 4coder's font to one of the built in fonts.
-
§3.3.42: set_theme_colors
+
§3.3.46: set_theme_colors
void app->set_theme_colors(
Application_Links *app,
Theme_Color *colors,
int32_t count
)
@@ -890,7 +919,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.
-
§3.3.43: get_theme_colors
+
§3.3.47: get_theme_colors
void app->get_theme_colors(
Application_Links *app,
Theme_Color *colors,
int32_t count
)
@@ -906,7 +935,7 @@ no change is made to the color pallet.
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.
-
§3.3.44: directory_get_hot
+
§3.3.48: directory_get_hot
int32_t app->directory_get_hot(
Application_Links *app,
char *out,
int32_t capacity
)
@@ -924,7 +953,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.
-
§3.3.45: get_file_list
+
§3.3.49: get_file_list
File_List app->get_file_list(
Application_Links *app,
char *dir,
int32_t len
)
@@ -940,7 +969,7 @@ directories controlled on the custom side.
the specified directory. The File_List returned should be passed to free_file_list
when it is no longer in use.
-
§3.3.46: free_file_list
+
§3.3.50: free_file_list
void app->free_file_list(
Application_Links *app,
File_List list
)
@@ -950,7 +979,7 @@ when it is no longer in use.
Description
After this call the file list passed in should not be read or written to.
-
§3.3.47: file_exists
+
§3.3.51: file_exists
bool32 app->file_exists(
Application_Links *app,
char *filename,
int len
)
@@ -964,7 +993,7 @@ when it is no longer in use.
Return
This call returns non-zero if and only if the file exists.
-
§3.3.48: directory_cd
+
§3.3.52: directory_cd
bool32 app->directory_cd(
Application_Links *app,
char *dir,
int *len,
int capacity,
char *rel_path,
int rel_len
)
@@ -997,7 +1026,7 @@ will contain "C:/Users/MySelf/Documents" and len will contain the length of that
string. This call can also be used with rel set to ".." to traverse to parent
folders.
-
§3.3.49: get_4ed_path
+
§3.3.53: get_4ed_path
bool32 app->get_4ed_path(
Application_Links *app,
char *out,
int32_t capacity
)
@@ -1011,7 +1040,7 @@ folders.
Return
This call returns non-zero on success.
-
§3.3.50: show_mouse_cursor
+
§3.3.54: show_mouse_cursor
void app->show_mouse_cursor(
Application_Links *app,
Mouse_Cursor_Show_Type show
)
@@ -1110,10 +1139,6 @@ the range [1,16].
cmdid_history_forward unperforms the previous cmdid_history_backward step if possib.e
-
cmdid_clean_all_lines
-
cmdid_clean_all_lines deletes extra whitespace out the currently active buffer.
-
-
cmdid_interactive_new
cmdid_interactive_new begins an interactive dialogue to create a new buffer.
@@ -1207,11 +1232,12 @@ the range [1,16].
enum Buffer_Batch_Edit_Type;
Description
A Buffer_Batch_Edit_Type is a type of batch operation.
Values
BatchEdit_Normal
-
+
The BatchEdit_Normal operation is always correct but does the most work.
BatchEdit_PreserveTokens
-
+
The BatchEdit_PreserveTokens operation is one in which none of the edits add, delete, or change any tokens.
+ This usually applies when whitespace is being replaced with whitespace.
@@ -1342,8 +1368,24 @@ Flags can be combined with bit or to specify a state with multiple modifiers.
+
+
§3.4.17: Memory_Protect_Flags
+
enum Memory_Protect_Flags;
+
Description
TODO
Flags
+
MemProtect_Read = 0x1
+
+
+
+
MemProtect_Write = 0x2
+
+
+
+
MemProtect_Execute = 0x4
+
+
+
-
§3.4.17: Buffer_Create_Flag
+
§3.4.18: Buffer_Create_Flag
enum Buffer_Create_Flag;
Description
A Buffer_Create_Flag field specifies how a buffer should be created.
Flags
BufferCreate_Background = 0x1
@@ -1356,7 +1398,7 @@ Flags can be combined with bit or to specify a state with multiple modifiers.
-
§3.4.18: Buffer_Kill_Flag
+
§3.4.19: Buffer_Kill_Flag
enum Buffer_Kill_Flag;
Description
A Buffer_Kill_Flag field specifies how a buffer should be killed.
Flags
BufferKill_Background = 0x1
@@ -1369,7 +1411,7 @@ Flags can be combined with bit or to specify a state with multiple modifiers.
-
§3.4.19: Access_Flag
+
§3.4.20: Access_Flag
enum Access_Flag;
Description
An Access_Flag field specifies what sort of permission you grant to an
access call. An access call is usually one the returns a summary struct. If a
@@ -1399,7 +1441,7 @@ that protection flag, the object is still returned from the access call.
-
§3.4.20: Seek_Boundary_Flag
+
§3.4.21: Seek_Boundary_Flag
enum Seek_Boundary_Flag;
Description
A Seek_Boundary_Flag field specifies a set of "boundary" types used in seeks for the
beginning or end of different types of words.
Flags
@@ -1420,7 +1462,7 @@ beginning or end of different types of words.
-
§3.4.21: Command_Line_Input_Flag
+
§3.4.22: Command_Line_Input_Flag
enum Command_Line_Input_Flag;
Description
A Command_Line_Input_Flag field specifies the behavior of a call to a command line interface.
Flags
CLI_OverlapWithConflict = 0x1
@@ -1441,7 +1483,7 @@ beginning or end of different types of words.
-
§3.4.22: Auto_Indent_Flag
+
§3.4.23: Auto_Indent_Flag
enum Auto_Indent_Flag;
Description
An Auto_Indent_Flag field specifies the behavior of an auto indentation operation.
Flags
AutoIndent_ClearLine = 0x1
@@ -1457,7 +1499,7 @@ beginning or end of different types of words.
-
§3.4.23: Set_Buffer_Flag
+
§3.4.24: Set_Buffer_Flag
enum Set_Buffer_Flag;
Description
A Set_Buffer_Flag field specifies the behavior of an operation that sets the buffer of a view.
Flags
SetBuffer_KeepOriginalGUI = 0x1
@@ -1467,7 +1509,7 @@ beginning or end of different types of words.
-
§3.4.24: Input_Type_Flag
+
§3.4.25: Input_Type_Flag
enum Input_Type_Flag;
Description
A Input_Type_Flag field specifies a set of input event types.
Flags
EventOnAnyKey = 0x1
@@ -1507,7 +1549,7 @@ beginning or end of different types of words.
-
§3.4.25: Generic_Command
+
§3.4.26: Generic_Command
union Generic_Command {
Command_ID cmdid;
@@ -1528,7 +1570,7 @@ internal command or a custom command.
-
§3.4.26: Key_Event_Data
+
§3.4.27: Key_Event_Data
struct Key_Event_Data {
Key_Code keycode;
@@ -1562,7 +1604,7 @@ at the time of the event.
-
§3.4.27: Mouse_State
+
§3.4.28: Mouse_State
struct Mouse_State {
char l;
@@ -1622,7 +1664,7 @@ mouse if in the window.
-
§3.4.28: Range
+
§3.4.29: Range
union Range {
struct {
@@ -1662,7 +1704,7 @@ Throughout the API ranges are thought of in the form [min,max
-
§3.4.29: File_Info
+
§3.4.30: File_Info
struct File_Info {
char * filename;
@@ -1685,7 +1727,7 @@ int folder;
See Also
-
§3.4.30: File_List
+
§3.4.31: File_List
struct File_List {
void * block;
@@ -1713,7 +1755,7 @@ int block_size;
-
§3.4.31: Buffer_Identifier
+
§3.4.32: Buffer_Identifier
struct Buffer_Identifier {
char * name;
@@ -1738,7 +1780,7 @@ can either be a name or an id. If the
-
§3.4.32: GUI_Scroll_Vars
+
§3.4.33: GUI_Scroll_Vars
struct GUI_Scroll_Vars {
float scroll_y;
@@ -1776,7 +1818,7 @@ int32_t prev_target_x;
-
§3.4.33: Full_Cursor
+
§3.4.34: Full_Cursor
struct Full_Cursor {
int32_t pos;
@@ -1820,7 +1862,7 @@ coordinate system supported by 4coder.
See Also
-
§3.4.34: Buffer_Seek
+
§3.4.35: Buffer_Seek
struct Buffer_Seek {
Buffer_Seek_Type type;
@@ -1885,7 +1927,7 @@ for concisely creating Buffer_Seek structs. They can be found in 4coder_buffer_
See Also
-
§3.4.35: Buffer_Edit
+
§3.4.36: Buffer_Edit
struct Buffer_Edit {
int32_t str_start;
@@ -1915,7 +1957,7 @@ will be replaced into the buffer.
-
§3.4.36: Buffer_Summary
+
§3.4.37: Buffer_Summary
struct Buffer_Summary {
bool32 exists;
@@ -1990,7 +2032,7 @@ bool32 unwrapped_lines;
See Also
-
§3.4.37: View_Summary
+
§3.4.38: View_Summary
struct View_Summary {
bool32 exists;
@@ -2060,7 +2102,7 @@ GUI_Scroll_Vars scroll_vars;
See Also