Annotation of src/usr.bin/less/funcs.h, Revision 1.20
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 binary_char(LWCHAR);
60: int control_char(LWCHAR);
61: char *prchar(LWCHAR);
62: char *prutfchar(LWCHAR);
63: int utf_len(char);
64: int is_utf8_well_formed(const char *);
65: LWCHAR get_wchar(const char *);
66: void put_wchar(char **, LWCHAR);
67: LWCHAR step_char(char **, int, char *);
68: int is_composing_char(LWCHAR);
69: int is_ubin_char(LWCHAR);
70: int is_wide_char(LWCHAR);
71: int is_combining_char(LWCHAR, LWCHAR);
72: void cmd_reset(void);
73: void clear_cmd(void);
74: void cmd_putstr(char *);
75: int len_cmdbuf(void);
76: void set_mlist(void *, int);
77: void cmd_addhist(struct mlist *, const char *);
78: void cmd_accept(void);
79: int cmd_char(int);
80: off_t cmd_int(long *);
81: char *get_cmdbuf(void);
82: char *cmd_lastpattern(void);
83: void init_cmdhist(void);
84: void save_cmdhist(void);
85: int in_mca(void);
86: void dispversion(void);
87: int getcc(void);
88: void ungetcc(int);
89: void ungetsc(char *);
90: void commands(void);
91: int cvt_length(int);
92: int *cvt_alloc_chpos(int);
93: void cvt_text(char *, char *, int *, int *, int);
94: void init_cmds(void);
95: void add_fcmd_table(char *, int);
96: void add_ecmd_table(char *, int);
97: int fcmd_decode(const char *, char **);
98: int ecmd_decode(const char *, char **);
99: char *lgetenv(char *);
100: int lesskey(char *, int);
101: void add_hometable(char *, char *, int);
102: int editchar(int, int);
103: void init_textlist(struct textlist *, char *);
104: char *forw_textlist(struct textlist *, char *);
105: char *back_textlist(struct textlist *, char *);
106: int edit(char *);
107: int edit_ifile(IFILE);
108: int edit_list(char *);
109: int edit_first(void);
110: int edit_last(void);
111: int edit_next(int);
112: int edit_prev(int);
113: int edit_index(int);
114: IFILE save_curr_ifile(void);
115: void unsave_ifile(IFILE);
116: void reedit_ifile(IFILE);
117: void reopen_curr_ifile(void);
118: int edit_stdin(void);
119: void cat_file(void);
120: void use_logfile(char *);
121: char *shell_unquote(char *);
122: char *get_meta_escape(void);
123: char *shell_quote(const char *);
124: char *homefile(char *);
125: char *fexpand(char *);
126: char *fcomplete(char *);
127: int bin_file(int f);
128: char *lglob(char *);
129: char *open_altfile(char *, int *, void **);
130: void close_altfile(char *, char *, void *);
131: int is_dir(char *);
132: char *bad_file(char *);
133: off_t filesize(int);
134: char *last_component(char *);
135: int eof_displayed(void);
136: int entire_file_displayed(void);
137: void squish_check(void);
138: void forw(int, off_t, int, int, int);
139: void back(int, off_t, int, int);
140: void forward(int, int, int);
141: void backward(int, int, int);
142: int get_back_scroll(void);
143: void del_ifile(IFILE);
144: IFILE next_ifile(IFILE);
145: IFILE prev_ifile(IFILE);
146: IFILE getoff_ifile(IFILE);
147: int nifile(void);
148: IFILE get_ifile(char *, IFILE);
149: char *get_filename(IFILE);
150: int get_index(IFILE);
151: void store_pos(IFILE, struct scrpos *);
152: void get_pos(IFILE, struct scrpos *);
153: int opened(IFILE);
154: void hold_ifile(IFILE, int);
155: int held_ifile(IFILE);
156: void set_open(IFILE);
157: void *get_filestate(IFILE);
158: void set_filestate(IFILE, void *);
159: off_t forw_line(off_t);
160: off_t back_line(off_t);
161: void set_attnpos(off_t);
162: void jump_forw(void);
163: void jump_back(off_t);
164: void repaint(void);
165: void jump_percent(int, long);
166: void jump_line_loc(off_t, int);
167: void jump_loc(off_t, int);
168: void init_line(void);
169: void prewind(void);
170: void plinenum(off_t);
171: void pshift_all(void);
172: int is_ansi_middle(LWCHAR);
173: int pappend(char, off_t);
174: int pflushmbc(void);
175: void pdone(int, int);
176: void set_status_col(char);
177: int gline(int, int *);
178: void null_line(void);
179: off_t forw_raw_line(off_t, char **, int *);
180: off_t back_raw_line(off_t, char **, int *);
181: void clr_linenum(void);
182: void add_lnum(off_t, off_t);
183: off_t find_linenum(off_t);
184: off_t find_pos(off_t);
185: off_t currline(int);
186: void lsystem(const char *, const char *);
187: int pipe_mark(int, char *);
188: void init_mark(void);
189: int badmark(int);
190: void setmark(int);
191: void lastmark(void);
192: void gomark(int);
193: off_t markpos(int);
194: void unmark(IFILE);
195: void opt_o(int, char *);
196: void opt__O(int, char *);
197: void opt_j(int, char *);
198: void calc_jump_sline(void);
199: void opt_shift(int, char *);
200: void calc_shift_count(void);
201: void opt_k(int, char *);
202: void opt_t(int, char *);
203: void opt__T(int, char *);
204: void opt_p(int, char *);
205: void opt__P(int, char *);
206: void opt_b(int, char *);
207: void opt_i(int, char *);
208: void opt__V(int, char *);
209: void opt_x(int, char *);
210: void opt_quote(int, char *);
211: void opt_query(int, char *);
212: int get_swindow(void);
213: char *propt(int);
1.19 krw 214: void scan_option(char *, int);
1.17 mmcc 215: void toggle_option(struct loption *, int, char *, int);
216: int opt_has_param(struct loption *);
217: char *opt_prompt(struct loption *);
218: int isoptpending(void);
219: void nopendopt(void);
220: int getnum(char **, char *, int *);
221: long getfraction(char **, char *, int *);
222: int get_quit_at_eof(void);
223: void init_option(void);
224: struct loption *findopt(int);
225: struct loption *findopt_name(char **, char **, int *);
226: int iread(int, unsigned char *, unsigned int);
227: char *errno_message(char *);
228: int percentage(off_t, off_t);
229: off_t percent_pos(off_t, int, long);
230: void put_line(void);
231: void flush(int);
232: int putchr(int);
233: void putstr(const char *);
234: void get_return(void);
235: void error(const char *, PARG *);
236: void ierror(const char *, PARG *);
237: int query(const char *, PARG *);
238: int compile_pattern(char *, int, regex_t **);
239: void uncompile_pattern(regex_t **);
240: int match_pattern(void *, char *, char *, int, char **, char **,
1.9 nicm 241: int, int);
1.17 mmcc 242: off_t position(int);
243: void add_forw_pos(off_t);
244: void add_back_pos(off_t);
245: void pos_clear(void);
246: void pos_init(void);
247: int onscreen(off_t);
248: int empty_screen(void);
249: int empty_lines(int, int);
250: void get_scrpos(struct scrpos *);
251: int adjsline(int);
252: void init_prompt(void);
253: char *pr_expand(const char *, int);
254: char *eq_message(void);
255: char *prompt_string(void);
256: char *wait_message(void);
257: void init_search(void);
258: void repaint_hilite(int);
259: void clear_attn(void);
260: void undo_search(void);
261: void clr_hilite(void);
262: int is_filtered(off_t);
263: int is_hilited(off_t, off_t, int, int *);
264: void chg_caseless(void);
265: void chg_hilite(void);
266: int search(int, char *, int);
267: void prep_hilite(off_t, off_t, int);
268: void set_filter_pattern(char *, int);
269: int is_filtering(void);
270: void sigwinch(int);
271: void init_signals(int);
272: void psignals(void);
273: void cleantags(void);
274: void findtag(char *);
275: off_t tagsearch(void);
276: char *nexttag(int);
277: char *prevtag(int);
278: int ntags(void);
279: int curr_tag(void);
280: int edit_tagfile(void);
281: void open_getchr(void);
282: int getchr(void);
283: void *lsignal(int, void (*)(int));
284: char *helpfile(void);