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