ReplaceBlockInTextBuffer(3W) — MISC. REFERENCE MANUAL PAGES
Text Buffer Utilities
NAME
ReplaceBlockInTextBuffer
SYNOPSIS
#include <textbuff.h>
...
extern EditResult ReplaceBlockInTextBuffer(text, startloc, endloc, string, f, d)
TextBuffer ∗ text;
TextLocation ∗ startloc;
TextLocation ∗ endloc;
char ∗ string;
TextUpdateFunction f;
caddr_t d;
DESCRIPTION
The ReplaceBlockInTextBuffer function is used to update the contents of the TextBuffer associated with text. The characters stored between startloc and endloc are deleted and the string is inserted after startloc. If the edit succeeds the TextUpdateFunction f is called with the parameters: d, text, and 1; then any other different update functions associated with the TextBuffer are called with their associated data pointer, text, and 0. This function records the operation performed in TextUndoItem structures. The contents of these structures can be used to implement an undo function. The contents can also be used to determine the type of operation performed. A structure is allocated for both the delete and insert information. The hints provided in these structures is the inclusive or of:~ TEXT_BUFFER_NOP
TEXT_BUFFER_INSERT_LINE
TEXT_BUFFER_INSERT_SPLIT_LINE
TEXT_BUFFER_INSERT_CHARS
TEXT_BUFFER_DELETE_START_LINE
TEXT_BUFFER_DELETE_END_LINE
TEXT_BUFFER_DELETE_START_CHARS
TEXT_BUFFER_DELETE_END_CHARS
TEXT_BUFFER_DELETE_JOIN_LINE
TEXT_BUFFER_DELETE_SIMPLE
SEE ALSO
Sun Release 4.0 — Last change: