Annotation of src/usr.bin/less/funcs.h, Revision 1.22
1.9 nicm 1: /*
2: * Copyright 2014 Garrett D'Amore <garrett@damore.org>
3: *
4: * This file is made available under the terms of the Less License.
5: */
6:
7: #include <regex.h>
8:
9: struct mlist;
10: struct loption;
11:
1.17 mmcc 12: void *ecalloc(int, unsigned int);
13: char *easprintf(const char *, ...);
14: char *estrdup(const char *);
15: char *skipsp(char *);
16: int sprefix(char *, char *, int);
17: void quit(int);
18: void raw_mode(int);
19: char *special_key_str(int);
20: void get_term(void);
21: void init(void);
22: void deinit(void);
23: void home(void);
24: void add_line(void);
25: void lower_left(void);
26: void line_left(void);
27: void goto_line(int);
28: void vbell(void);
29: void ring_bell(void);
30: void do_clear(void);
31: void clear_eol(void);
32: void clear_bot(void);
33: void at_enter(int);
34: void at_exit(void);
35: void at_switch(int);
36: int is_at_equiv(int, int);
37: int apply_at_specials(int);
38: void putbs(void);
39: void match_brac(int, int, int, int);
40: int ch_get(void);
41: void ch_ungetchar(int);
42: void end_logfile(void);
43: void sync_logfile(void);
44: int ch_seek(off_t);
45: int ch_end_seek(void);
46: int ch_beg_seek(void);
47: off_t ch_length(void);
48: off_t ch_tell(void);
49: int ch_forw_get(void);
50: int ch_back_get(void);
51: void ch_setbufspace(int);
52: void ch_flush(void);
53: int seekable(int);
54: void ch_set_eof(void);
55: void ch_init(int, int);
56: void ch_close(void);
57: int ch_getflags(void);
58: void init_charset(void);
59: int control_char(LWCHAR);
60: char *prchar(LWCHAR);
61: char *prutfchar(LWCHAR);
62: int utf_len(char);
63: int is_utf8_well_formed(const char *);
64: LWCHAR get_wchar(const char *);
65: LWCHAR step_char(char **, int, char *);
66: int is_composing_char(LWCHAR);
67: int is_ubin_char(LWCHAR);
68: int is_wide_char(LWCHAR);
69: int is_combining_char(LWCHAR, LWCHAR);
70: void cmd_reset(void);
71: void clear_cmd(void);
72: void cmd_putstr(char *);
73: int len_cmdbuf(void);
74: void set_mlist(void *, int);
75: void cmd_addhist(struct mlist *, const char *);
76: void cmd_accept(void);
77: int cmd_char(int);
78: off_t cmd_int(long *);
79: char *get_cmdbuf(void);
80: char *cmd_lastpattern(void);
81: void init_cmdhist(void);
82: void save_cmdhist(void);
83: int in_mca(void);
84: void dispversion(void);
85: int getcc(void);
86: void ungetcc(int);
87: void ungetsc(char *);
88: void commands(void);
89: int cvt_length(int);
90: int *cvt_alloc_chpos(int);
91: void cvt_text(char *, char *, int *, int *, int);
92: void init_cmds(void);
93: void add_fcmd_table(char *, int);
94: void add_ecmd_table(char *, int);
95: int fcmd_decode(const char *, char **);
96: int ecmd_decode(const char *, char **);
97: char *lgetenv(char *);
98: int lesskey(char *, int);
99: void add_hometable(char *, char *, int);
100: int editchar(int, int);
101: void init_textlist(struct textlist *, char *);
102: char *forw_textlist(struct textlist *, char *);
103: char *back_textlist(struct textlist *, char *);
104: int edit(char *);
105: int edit_ifile(IFILE);
106: int edit_list(char *);
107: int edit_first(void);
108: int edit_last(void);
109: int edit_next(int);
110: int edit_prev(int);
111: int edit_index(int);
112: IFILE save_curr_ifile(void);
113: void unsave_ifile(IFILE);
114: void reedit_ifile(IFILE);
115: void reopen_curr_ifile(void);
116: int edit_stdin(void);
117: void cat_file(void);
118: void use_logfile(char *);
119: char *shell_unquote(char *);
120: char *get_meta_escape(void);
121: char *shell_quote(const char *);
122: char *homefile(char *);
123: char *fexpand(char *);
124: char *fcomplete(char *);
125: int bin_file(int f);
126: char *lglob(char *);
127: char *open_altfile(char *, int *, void **);
128: void close_altfile(char *, char *, void *);
129: int is_dir(char *);
130: char *bad_file(char *);
131: off_t filesize(int);
132: char *last_component(char *);
133: int eof_displayed(void);
134: int entire_file_displayed(void);
135: void squish_check(void);
136: void forw(int, off_t, int, int, int);
137: void back(int, off_t, int, int);
138: void forward(int, int, int);
139: void backward(int, int, int);
140: int get_back_scroll(void);
141: void del_ifile(IFILE);
142: IFILE next_ifile(IFILE);
143: IFILE prev_ifile(IFILE);
144: IFILE getoff_ifile(IFILE);
145: int nifile(void);
146: IFILE get_ifile(char *, IFILE);
147: char *get_filename(IFILE);
148: int get_index(IFILE);
149: void store_pos(IFILE, struct scrpos *);
150: void get_pos(IFILE, struct scrpos *);
151: int opened(IFILE);
152: void hold_ifile(IFILE, int);
153: int held_ifile(IFILE);
154: void set_open(IFILE);
155: void *get_filestate(IFILE);
156: void set_filestate(IFILE, void *);
157: off_t forw_line(off_t);
158: off_t back_line(off_t);
159: void set_attnpos(off_t);
160: void jump_forw(void);
161: void jump_back(off_t);
162: void repaint(void);
163: void jump_percent(int, long);
164: void jump_line_loc(off_t, int);
165: void jump_loc(off_t, int);
166: void init_line(void);
167: void prewind(void);
168: void plinenum(off_t);
169: void pshift_all(void);
170: int is_ansi_middle(LWCHAR);
171: int pappend(char, off_t);
172: int pflushmbc(void);
173: void pdone(int, int);
174: void set_status_col(char);
175: int gline(int, int *);
176: void null_line(void);
177: off_t forw_raw_line(off_t, char **, int *);
178: off_t back_raw_line(off_t, char **, int *);
179: void clr_linenum(void);
180: void add_lnum(off_t, off_t);
181: off_t find_linenum(off_t);
182: off_t find_pos(off_t);
183: off_t currline(int);
184: void lsystem(const char *, const char *);
185: int pipe_mark(int, char *);
186: void init_mark(void);
187: int badmark(int);
188: void setmark(int);
189: void lastmark(void);
190: void gomark(int);
191: off_t markpos(int);
192: void unmark(IFILE);
193: void opt_o(int, char *);
194: void opt__O(int, char *);
195: void opt_j(int, char *);
196: void calc_jump_sline(void);
197: void opt_shift(int, char *);
198: void calc_shift_count(void);
199: void opt_k(int, char *);
200: void opt_t(int, char *);
201: void opt__T(int, char *);
202: void opt_p(int, char *);
203: void opt__P(int, char *);
204: void opt_b(int, char *);
205: void opt_i(int, char *);
206: void opt__V(int, char *);
207: void opt_x(int, char *);
208: void opt_quote(int, char *);
209: void opt_query(int, char *);
210: int get_swindow(void);
211: char *propt(int);
1.19 krw 212: void scan_option(char *, int);
1.17 mmcc 213: void toggle_option(struct loption *, int, char *, int);
214: int opt_has_param(struct loption *);
215: char *opt_prompt(struct loption *);
216: int isoptpending(void);
217: void nopendopt(void);
218: int getnum(char **, char *, int *);
219: long getfraction(char **, char *, int *);
220: int get_quit_at_eof(void);
221: void init_option(void);
222: struct loption *findopt(int);
223: struct loption *findopt_name(char **, char **, int *);
224: int iread(int, unsigned char *, unsigned int);
225: char *errno_message(char *);
226: int percentage(off_t, off_t);
227: off_t percent_pos(off_t, int, long);
228: void put_line(void);
229: void flush(int);
230: int putchr(int);
231: void putstr(const char *);
232: void get_return(void);
233: void error(const char *, PARG *);
234: void ierror(const char *, PARG *);
235: int query(const char *, PARG *);
236: int compile_pattern(char *, int, regex_t **);
237: void uncompile_pattern(regex_t **);
238: int match_pattern(void *, char *, char *, int, char **, char **,
1.9 nicm 239: int, int);
1.17 mmcc 240: off_t position(int);
241: void add_forw_pos(off_t);
242: void add_back_pos(off_t);
243: void pos_clear(void);
244: void pos_init(void);
245: int onscreen(off_t);
246: int empty_screen(void);
247: int empty_lines(int, int);
248: void get_scrpos(struct scrpos *);
249: int adjsline(int);
250: void init_prompt(void);
251: char *pr_expand(const char *, int);
252: char *eq_message(void);
253: char *prompt_string(void);
254: char *wait_message(void);
255: void init_search(void);
256: void repaint_hilite(int);
257: void clear_attn(void);
258: void undo_search(void);
259: void clr_hilite(void);
260: int is_filtered(off_t);
261: int is_hilited(off_t, off_t, int, int *);
262: void chg_caseless(void);
263: void chg_hilite(void);
264: int search(int, char *, int);
265: void prep_hilite(off_t, off_t, int);
266: void set_filter_pattern(char *, int);
267: int is_filtering(void);
268: void sigwinch(int);
269: void init_signals(int);
270: void psignals(void);
271: void cleantags(void);
272: void findtag(char *);
273: off_t tagsearch(void);
274: char *nexttag(int);
275: char *prevtag(int);
276: int ntags(void);
277: int curr_tag(void);
278: int edit_tagfile(void);
279: void open_getchr(void);
280: int getchr(void);
281: void *lsignal(int, void (*)(int));
282: char *helpfile(void);