|
C-Menu 0.2.9
A User Interface Toolkit
|
The working part of View. More...
#include <common.h>#include <ctype.h>#include <errno.h>#include <fcntl.h>#include <iso646.h>#include <regex.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/mman.h>#include <sys/param.h>#include <sys/stat.h>#include <termios.h>#include <time.h>#include <unistd.h>Go to the source code of this file.
Macros | |
| #define | _Perror(msg) |
| #define | _Refresh(view) |
| #define | confirm() |
| #define | get_next_char() |
| read the next characater from the virtual file | |
| #define | get_prev_char() |
| read the previous characater from the virtual fileThere is no need to track line numbers when moving backwards as they are stored in the line table and accessed as needed. When reading in reverse, the Beginning of Data (BOD) flag is set when the file position is zero, and cleared when the position or reading direction changes. Carriage-returns are ignored as they should be. | |
Functions | |
| int | a_toi (char *, bool *) |
| a safer alternative to atoi() for converting ASCII strings to integers. | |
| void | build_prompt (View *view) |
| Build Prompt String. | |
| void | cat_file (View *view) |
| Concatenate File to Standard Output. | |
| void | destroy_line_table (View *view) |
| Destroy Line Table. | |
| void | display_line (View *view) |
| Display Line on Padparam View *view data structure. | |
| void | display_line_eod (View *view) |
| Display End of Data. | |
| int | display_prompt (View *view, char *s) |
| Display Command Line Prompt. | |
| void | display_split_line (View *view) |
| Display Split Line on Pad. | |
| bool | enter_file_spec (Init *init, char *file_spec) |
| use form to enter a file specification | |
| int | fmt_line (View *view) |
| Format Line for Display. | |
| int | get_cmd_arg (View *view, char *prompt) |
| Get Command Argument from User Input. | |
| int | get_cmd_char (View *view, off_t *n) |
| Get Command Character from User Input. | |
| void | get_line (View *, off_t) |
| void | go_to_eof (View *view) |
| Go to End of File. | |
| int | go_to_line (View *view, off_t line_idx) |
| Go to Specific Line. | |
| void | go_to_mark (View *view, uint c) |
| Go to Mark. | |
| void | go_to_percent (View *view, uint percent) |
| Go to Percent of File. | |
| void | go_to_position (View *view, off_t go_to_pos) |
| Go to Specific File Position. | |
| void | increment_ln (View *view) |
| Increment Line Index and Update Line Table. | |
| void | initialize_line_table (View *view) |
| Initialize Line Table. | |
| off_t | line_number (View *view, off_t position) |
| Get Line Number for a Given File Position. | |
| void | log_cc_buf (View *view) |
| Log Complex Character Buffer. | |
| void | log_split_lines (View *view) |
| Log Split Lines. | |
| void | log_stripped_line_out (View *view) |
| Log Stripped Line Output. | |
| void | log_strnz (char *str, uint len) |
| Log String with Specified Length. | |
| void | lp (View *view, char *PrintFile) |
| Send File to Print Queue. | |
| void | next_page (View *view) |
| Advance to Next Page. | |
| int | pad_refresh (View *view) |
| Refresh Pad and Line Number Window. | |
| void | parse_ansi_str (char *ansi_str, attr_t *attr, ushort *cpx) |
| Parse ANSI SGR Escape Sequence. | |
| void | prev_page (View *view) |
| display previous page | |
| void | scroll_down (View *view, uint n) |
| Scroll Down by n Lines. | |
| void | scroll_up (View *view, uint n) |
| Scroll Up by n Lines. | |
| bool | search (View *view, int search_cmd, char *regex_pattern) |
| Search for Regular Expression Pattern. | |
| void | sync_ln (View *view) |
| Synchronize Line Table with Current File Position. | |
| int | view_cmd_processor (Init *init) |
| Main Command Processing Loop for View. | |
| void | view_display_help (Init *init) |
| Display View Help File. | |
| void | view_display_page (View *view) |
| Display Current Page. | |
| int | view_file (Init *init) |
| Start view. | |
| int | write_view_buffer (Init *init, bool f_strip_ansi) |
| Write buffer contents to files. | |
Variables | |
| FILE * | dbgfp |
| char | err_msg [MAXLEN] |
| char | prev_regex_pattern [MAXLEN] |
| #define _Perror | ( | msg | ) |
Definition at line 97 of file view_engine.c.
| #define _Refresh | ( | view | ) |
Definition at line 104 of file view_engine.c.
| #define confirm | ( | ) |
Definition at line 89 of file view_engine.c.
| void get_line | ( | View * | view, |
| off_t | line ) |
Definition at line 1765 of file view_engine.c.
References View::f_eod, View::f_squeeze, View::file_pos, View::line_in_beg_p, View::line_in_end_p, View::line_in_s, View::ln_no, and View::ln_tbl.
Referenced by prev_page(), scroll_down(), scroll_up(), search(), view_display_page(), and write_view_buffer().
| FILE * dbgfp |
Definition at line 110 of file view_engine.c.
| char err_msg |
Definition at line 150 of file view_engine.c.
| char prev_regex_pattern |
Definition at line 109 of file view_engine.c.
Referenced by view_cmd_processor().