doc_text(arena,params,"the id of the child process who's output will be linked");
doc_function_param(arena,&func,"buffer_id");
doc_text(arena,params,"the id of the buffer that will receive the output");
doc_function_param(arena,&func,"flags");
doc_text(arena,params,"flags setting the behavior when the child process or buffer already have a link");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"on success when the two entities exist and the link is created non-zero, otherwise zero");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"Each child process and each buffer may only be a part of one link at a time. So when either is already linked a decision needs to be made to either destroy that link or not create the new link. This decision is controlled by the flags.");
doc_text(arena,params,"the arena on which the returned string will be allocated");
doc_function_param(arena,&func,"clipboard_id");
doc_text(arena,params,"the id of the clipboard to query - currently an ignored parameter and should be set to zero");
doc_function_param(arena,&func,"item_index");
doc_text(arena,params,"the index in the clipboard history to query, 0 always the most recent string in the history");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"on success, when the clipboard contains a string at the given index, a copy of the string is returned, otherwise an empty string is returned");
doc_text(arena,params,"the arena on which the returned string will be allocated");
doc_function_param(arena,&func,"clipboard_id");
doc_text(arena,params,"the id of the clipboard to query - currently an ignored parameter and should be set to zero");
doc_function_param(arena,&func,"item_index");
doc_text(arena,params,"the index in the clipboard history to query, 0 always the most recent string in the history");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"on success, when the clipboard contains a string at the given index, a copy of the string is returned, otherwise an empty string is returned");
doc_text(arena,params,"a pointer to an event struct that contains the information that will be in the virtual event");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"on success, when the event specified is validly formed, non-zero is returned, otherwise zero is returned");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"All virtual events are triggered after all directly enqueued commands, before the next real event, and before the current frame renders.");
doc_function_brief(arena,&func,"Get the id of the 'global' managed scope");
// params
doc_function_begin_params(arena,&func);
doc_custom_app_ptr(arena,&func);
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"the id of the global managed scope");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"The global managed scope has a lifetime tied to the instance of 4coder itself. It is unique in that it does not combine with other scopes to create unique intersection scopes. To put it another way, all scopes are automatically implicitly dependent on the global scope, so adding it to the list of scopes in a 'multiple dependencies' scope has no effect on the result.");
doc_function_brief(arena,&func,"Get a scope that has a lifetime dependent on all of the dependent scopes and is unique up to set isomorphisms of the 'hard' dependencies");
doc_text(arena,params,"a pointer at the base of an array of scope ids specifying the set of dependencies to use in querying or constructing the resulting scope");
doc_function_param(arena,&func,"count");
doc_text(arena,params,"the number of scope ids in the scopes array");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"the scope id of the scope with multiple dependencies on success, when all the scopes in input array exist, zero otherwise");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"The behavior of this call can be confusing so here are some rules of thumb for how it works, assuming all input scopes are valid:");
doc_paragraph(arena,det);
doc_text(arena,det,"1. When there is only one scope in the parameters, that scope is the result. {A} -> A;");
doc_text(arena,det,"3. When any scope in the parameters is the special global scope, it is as if it is not there. {A, G} -> A");
doc_paragraph(arena,det);
doc_text(arena,det,"4. When two scopes are constructed from the same set of parameters, they are the same, regardless of parameter order. {A, B} -> C; {B, A} -> C;");
doc_paragraph(arena,det);
doc_text(arena,det,"5. When any of the scopes in the parameters was itself returned by this call, it is as if the parameters from it's constructor are substituted for it. {A, B} -> C; {C, D} -> E; {A, B, D} -> E;");
doc_paragraph(arena,det);
doc_text(arena,det,"6. When the parameter set is empty the result is the global scope. {} -> G");
doc_text(arena,det,"For a set-theoretic definition one can think of scopes as being keyed by sets of 'atoms'. Getting the key for a scope with multiple dependencies is defined by the operation of union of sets. The global scope is keyed by the empty set. A scope continues to exist for as long all of the atoms in it's key set exist.");
doc_text(arena,params,"the id of the scope to modify");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"non-zero if the scope exists and is atomic, zero otherwise");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"A scope is atomic when it uniquely tied to a specified entity or when it is directly created by the user. By the set-theoretic definition of scopes, a scope is atomic when it's key contains only one atom.");
doc_paragraph(arena,det);
doc_text(arena,det,"A scope is atomic specifically whenever it satisfies any of these conditions:");
doc_paragraph(arena,det);
doc_text(arena,det,"1. It is a scope tied to a buffer and returned by buffer_get_managed_scope");
doc_paragraph(arena,det);
doc_text(arena,det,"2. It is a scope tied to a view and returned by view_get_managed_scope");
doc_paragraph(arena,det);
doc_text(arena,det,"3. It was created by a call to create_user_managed_scope");
doc_text(arena,params,"the id of the scope to query");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"a pointer to the base allocator for the managed scope if it exists, zero otherwise");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"Anything allocated by this base allocator exists only as long as the managed scope exists. All of the allocations in the managed scope are freed by a bulk free operation when the managed scopes life time ends.");
doc_text(arena,params,"a name identifying a managed id group");
doc_function_param(arena,&func,"name");
doc_text(arena,params,"a name identifying a managed id");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"the id assigned to the given (group, name) pair");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"When this is called for the first time for a given group, the first id returned is 1, subsequent calls with new names for an existing group return the next highest id, calls for (group, name) pairs that have already been assigned an id return the same id again. The upshot of this is that managed ids can be used to essentially create run-time allocated co-operative enums, where the group names the enum, and the names are the elements of the enum.");
doc_text(arena,params,"the id of a scope to query");
doc_function_param(arena,&func,"id");
doc_text(arena,params,"the id of the attachment to query");
doc_function_param(arena,&func,"size");
doc_text(arena,params,"the expected size for the attachment, used to allocate memory when the attachment did not previously exist, used to check that the attachment is at least as large as expected if it already exists");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"a pointer to the base of the attachment when the scope exists and no error ocurred in checking the size of the attachment, zero otherwise");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"Attachments are allocated on a scopes base allocator, and thus are only valid for as long as the scope itself is valid. Whe in doubt, re-query for an attachment and recheck that the pointer returned is non-zero, as often calls between one usage and another can have an effect on the location or existence of an attachment.");
doc_text(arena,params,"either a null pointer, or a pointer to a managed scope");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"on success, when the buffer exists, and the optional_extra_scope is valid, a new managed object id, otherwise zero");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"By default, markers are allocated in the scope of the buffer they are attached to, this is how their lifetime is tied to the lifetime of the buffer. When an additional scope is supplied, it is combined with the buffer's scope via the same joining operation used in get_managed_scope_with_multiple_dependencies and the markers are allocated in that scope instead.");
doc_paragraph(arena,det);
doc_text(arena,det,"Markers are updated by edits to the buffer to which they are attached, so that they the same position in the buffer even as text is shifted around by edit operations. This can be used, for instance, to track the locations of compilation errors even as some compilation errors have already been fixed and shifted the position of later errors.");
doc_text(arena,params,"the id of the managed object to query");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"on success, when the object exists, the number of bytes in each item of the managed object, otherwise zero");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"Managed objects are essentially arrays with special management inside the core, such as markers. This call returns the size of the items in the array.");
doc_text(arena,params,"the id of the managed object to query");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"on success, when the object exists, the number of items in the managed object, otherwise zero");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"Managed objects are essentially arrays with special management inside the core, such as markers. This call returns the number of items in the array.");
doc_text(arena,params,"the id of the managed object to query");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"on success, when the object exists, a pointer to the base of the memory allocated for the object, otherwise zero");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"Managed objects are essentially arrays with special management inside the core, such as markers. This call returns a pointer to base of the array. Careful! This pointer is a pointer to memory tied to a managed scope, so it can lose validity if the scope closes, and modifications to the memory at this pointer will be reflected throughout all systems relying on it.");
doc_function_brief(arena,&func,"Destroy a managed object, free it's memory back to the scope containing it, and detach it from whatever associations it has in the core");
doc_text(arena,params,"flags for properties of an event that should be converted into abort events before returning from this call");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"the next input that is sent to this view context, or cleared to zero if this is not a view context thread");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"This works as a blocking call on it's thread, blocking until the core has more input. However it only works in view context threads. View context threads are created by the core whenever a view is created, and has the primary responsibility of dispatching user input and other events. The base of view context threads is determined by HookID_ViewEventHandler.");
doc_function_brief(arena,&func,"In a view context, get the input that has been most recently sent to the view");
// params
doc_function_begin_params(arena,&func);
doc_custom_app_ptr(arena,&func);
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"the most recent input sent to the view; cleared to zero if this is not called from a view context thread, or if no inputs have been sent to this view context thread yet");
doc_text(arena,params,"a pointer to the input struct to copy over the existing input struct in the core");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"This call only has the effect of altering the result of future calls to get_current_input until the next time input is sent to the calling view context thread. There is no effect when called from threads that are not view contexts.");
doc_function_brief(arena,&func,"Notifies the core that the input currently being handled by a view context thread should be treated as if it were not handled");
// params
doc_function_begin_params(arena,&func);
doc_custom_app_ptr(arena,&func);
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"When events are handled, future handlers for them are skipped. This is especially important because text input is passed as a seperate event after key stroke events, and if a key stroke event is marked as handled, then the text event that would have been generated by the key stroke is skipped.");
doc_text(arena,params,"the id of the hook to be modified");
doc_function_param(arena,&func,"func_ptr");
doc_text(arena,params,"a pointer to the hook function, the function pointer must have a specific signature to match the hook_id's expected signature, but this call does not do the type checking for this, so watch out for that");
doc_text(arena,params,"the string to write to the log");
// return
Doc_Block*ret=doc_function_return(arena,&func);
doc_text(arena,ret,"non-zero when the string was written to the log, each thread can individually have logging disabled, in which case zero is returned");
doc_function_brief(arena,&func,"Begin an edit group to merge all edits across all buffers");
// params
doc_function_begin_params(arena,&func);
doc_custom_app_ptr(arena,&func);
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"When inside a global history edit group, all edits are merged into group edits, and the global edit number counter is frozen. Groups are formed by a nest counter, so that each call to global_history_edit_group_begin must be matched by a call to global_history_edit_group_end.");
doc_function_brief(arena,&func,"End an edit group to merge all edits across all buffers");
// params
doc_function_begin_params(arena,&func);
doc_custom_app_ptr(arena,&func);
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"When inside a global history edit group, all edits are merged into group edits, and the global edit number counter is frozen. Groups are formed by a nest counter, so that each call to global_history_edit_group_begin must be matched by a call to global_history_edit_group_end.");
doc_function_brief(arena,&func,"Send the signal to the core to try to shutdown");
// params
doc_function_begin_params(arena,&func);
doc_custom_app_ptr(arena,&func);
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"The exit signal does not automatically close 4coder, first the exit hook is called, which can cancel the exit. If it does not cancel the exit, then 4coder closes.");
doc_function_brief(arena,&func,"Exits 4coder at the end of the frame, no matter what; for instance, call from the exit signal handler to actual exit 4coder.");
doc_text(arena,params,"the number of milliseconds roughly approximating how long to wait until sending a wakeup signal, the wakeup is always delayed by a minimum of a 16 milliseconds");
// details
Doc_Block*det=doc_function_details(arena,&func);
doc_text(arena,det,"Without an animate timer set, 4coder only wakes up when events are sent to it. When there is an animation timer, 4coder wakes up when the animation timer triggers a timer event.");