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