sel_post_req( )
This procedure is used to send a non-blocking request to the selection owner. The
application’s reply procedure is called by the SELECTION package when the selection
owner has sent its reply.
int
sel_post_req( sel )
Selection_requestor sel;
sel is the selection requestor. Returns XV_OK if it successfully sends the request,
otherwise it returns XV_ERROR. When no reply procedure is defined, XV_ERROR is re-
turned (see the description for the attribute SEL_REPLY_PROC).
textsw_add_mark()
Adds a new mark at position. flags can be either TEXTSW_MARK_DEFAULTS or
TEXTSW_MARK_MOVE_AT_INSERT.
Textsw_mark
textsw_add_mark(textsw, position, flags)
Textsw textsw;
Textsw_index position;
unsigned flags;
textsw_append_file_name()
Returns 0 if textsw is editing a file and, if so, appends the name of the file at the end
of name.
int
textsw_append_file_name(textsw, name)
Textsw textsw;
char *name;
textsw_delete()
Returns 0 if the operation fails. Removes the span of characters beginning with
first and ending one before last_plus_one.
Textsw_index
textsw_delete(textsw, first, last_plus_one)
Textsw textsw;
Textsw_index first, last_plus_one;
textsw_edit()
Returns 0 if the operation fails. Erases a character, a word or a line, depending on
whether unit is SELN_LEVEL_FIRST or SELN_LEVEL_LINE. If direction is 0,
characters after the insertion point are affected; otherwise, characters before the inser-
tion point are affected. The operation will be done count times.
Textsw_index
textsw_edit(textsw, unit, count, direction)
Textsw textsw;
unsigned unit, count, direction;
Procedures and Macros
Procedures and Macros 205
textsw_erase()
Returns 0 if the operation fails. Equivalent to textsw_delete() but does not af-
fect the global shelf.
Textsw_index
textsw_erase(textsw, first, last_plus_one)
Textsw textsw;
Textsw_index first, last_plus_one;
textsw_file_lines_visible()
Fills in top and bottom with the file line indices of the first and last file lines being
displayed in textsw.
void
textsw_file_lines_visible(textsw, top, bottom)
Textsw textsw;
int *top, *bottom;
textsw_find_bytes( )
Beginning at the position addressed by first, searches for the pattern specified by
buf of length buf_len. Searches forward if flags is 0, else searches backward. Re-
turns –1 if no match, else matching span placed in indices addressed by first and
last_plus_one.
int
textsw_find_bytes(
textsw, first, last_plus_one, buf, buf_len, flags)
Textsw textsw;
Textsw_index *first, *last_plus_one;
char *buf;
unsigned buf_len, flags;
textsw_find_mark()
Returns the current position of mark. If this operation fails, it will return TEXTSW_
INFINITY.
Textsw_index
textsw_find_mark(textsw, mark)
Textsw textsw;
Textsw_mark mark;
textsw_first( )
Returns the first textsw view.
Textsw
textsw_first(textsw)
Textsw textsw;
206 XView Reference Manual
textsw_index_for_file_line()
Returns the character index for the first character in the line given by line. If this op-
eration fails, it will return TEXTSW_CANNOT_SET.
Textsw_index
textsw_index_for_file_line(textsw, line)
Textsw textsw;
int line;
textsw_insert()
Inserts characters in buf into textsw at the current insertion point. The number of
characters actually inserted is returned. This will equal buf_len unless there was a
memory allocation failure. If there was a failure, it returns NULL.
Textsw_index
textsw_insert(textsw, buf, buf_len)
Textsw textsw;
char *buf;
int buf_len;
textsw_match_bytes()
Searches for a block of text in the textsw’s contents; ends with characters matching
end_sym. This function places the starting index of the matching block in first
and its ending index in last.
int
textsw_match_bytes(
textsw, first, last_plus_one, start_sym,
start_sym_len, end_sym, end_sym_len, field_flag)
Textsw textsw;
Textsw_index *first, *last_plus_one;
char *start_sym, *end_sym;
int start_sym_len, end_sym_len;
unsigned field_flag;
textsw_next()
Returns the next view in the set of textsw views.
Textsw
textsw_next(textsw)
Textsw textsw;
textsw_normalize_view()
Repositions the text so that the character at position is visible and at the top of the
subwindow.
void
textsw_normalize_view(textsw, position)
Textsw textsw;
Textsw_index position;
Procedures and Macros
Procedures and Macros 207
textsw_possibly_normalize()
If the character at position is already visible, this function does nothing. If it is not
visible, it repositions the text so that it is visible and at the top of the subwindow.
void
textsw_possibly_normalize(textsw, position)
Textsw textsw;
Textsw_index position;
textsw_remove_mark()
Removes an existing mark from textsw.
void
textsw_remove_mark(textsw, mark)
Textsw textsw;
Textsw_mark mark;
textsw_replace_bytes()
Replaces the character span from first to last_plus_one with the characters in
buf. The return value is the number of bytes inserted or deleted. The number is posi-
tive if bytes are inserted, negative if bytes are deleted. (The number is also negative if
the original string is longer than the one that replaces it.) If this operation fails, it will
return a value of NULL.
Textsw_index
textsw_replace_bytes(
textsw, first, last_plus_onebuf, buf_len)
Textsw textsw;
Textsw_index first;
Textsw_index last_plus_one;
char *buf;
unsigned buf_len;
textsw_reset()
Discards edits performed on the contents of textsw. If needed, a message box will be
displayed at x,y.
void
textsw_reset(textsw, x, y)
Textsw textsw;
int x, y;
textsw_save()
Saves any edits made to the file currently loaded into textsw. If needed, a message
box will be displayed at x,y.
unsigned
textsw_save(textsw, x, y)
Textsw textsw;
int x, y;
208 XView Reference Manual
textsw_screen_line_count()
Returns the number of screen lines in textsw.
int
textsw_screen_line_count(textsw)
Textsw textsw;
textsw_scroll_lines()
Moves the text up or down by count lines. If count is positive, then the text is
scrolled up on the screen. If negative, the text is scrolled down (backward in the file).
void
textsw_scroll_lines(textsw, count)
Textsw textsw;
int count;
textsw_set_selection()
Sets the selection to begin at first and includes all characters up to
last_plus_one. A type value of 1 indicates primary selection, 2 indicates sec-
ondary selection.
void
textsw_set_selection(textsw, first, last_plus_one, type)
Textsw textsw;
Textsw_index first, last_plus_one;
unsigned type;
textsw_store_file()
Stores the contents of textsw to the file named by filename. If needed, a message
box will be displayed at x,y.
unsigned
textsw_store_file(textsw, filename, x, y)
Textsw textsw;
char *filename;
int x, y;
ttysw_input()
Appends len number of characters from buf onto tty’s input queue. It returns the
number of characters accepted.
int
ttysw_input(tty, buf, len)
Tty tty;
char *buf;
int len;
Procedures and Macros
Procedures and Macros 209
Get Volume 7B: XView Reference Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.