> home > Custom Layer Boundary API

buffer_kill

January 19th 2020
Close a buffer

Signature

C++
Buffer_Kill_Result
buffer_kill(Application_Links* app,
            Buffer_ID buffer_id,
            Buffer_Kill_Flag flags);

Parameters

app

the standard custom layer context pointer

buffer_id

the id of the buffer to close

flags

flags controlling the buffer closing behavior

Return

a code indicating the result of the attempt to kill a buffer, if the buffer does not exist this will be a failure, if the buffer exists but has unsaved changes, this will indicate as much unless flag was used to override the dirty state check, if the buffer is successfully closed that will be indicated by the code

Details

When a buffer's dirty state includes unsaved changes, this call will not close the buffer unless it is forced to by the flags.
Certain buffers critical to the operation of the core cannot be closed, and attempts to close them will always result in failure to close.

Related

Buffer_Kill_Result
Buffer_Kill_Flag