xref: /freebsd/contrib/less/funcs.h (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1 public char * save(constant char *s);
2 public void out_of_memory(void);
3 public void * ecalloc(int count, unsigned int size);
4 public char * skipsp(char *s);
5 public int sprefix(char *ps, char *s, int uppercase);
6 public void quit(int status);
7 public void raw_mode(int on);
8 public void scrsize(void);
9 public char * special_key_str(int key);
10 public void get_term(void);
11 public void init_mouse(void);
12 public void deinit_mouse(void);
13 public void init(void);
14 public void deinit(void);
15 public int interactive(void);
16 public void home(void);
17 public void dump_screen(void);
18 public void add_line(void);
19 public void remove_top(int n);
20 public void win32_scroll_up(int n);
21 public void lower_left(void);
22 public void line_left(void);
23 public void check_winch(void);
24 public void goto_line(int sindex);
25 public void vbell(void);
26 public void bell(void);
27 public void clear(void);
28 public void clear_eol(void);
29 public void clear_bot(void);
30 public COLOR_TYPE parse_color(char *str, int *p_fg, int *p_bg);
31 public void at_enter(int attr);
32 public void at_exit(void);
33 public void at_switch(int attr);
34 public int is_at_equiv(int attr1, int attr2);
35 public int apply_at_specials(int attr);
36 public void putbs(void);
37 public int win32_kbhit(void);
38 public char WIN32getch(void);
39 public void WIN32setcolors(int fg, int bg);
40 public void WIN32textout(char *text, int len);
41 public void match_brac(char obrac, char cbrac, int forwdir, int n);
42 public void ch_ungetchar(int c);
43 public void end_logfile(void);
44 public void sync_logfile(void);
45 public int ch_seek(POSITION pos);
46 public int ch_end_seek(void);
47 public int ch_end_buffer_seek(void);
48 public int ch_beg_seek(void);
49 public POSITION ch_length(void);
50 public POSITION ch_tell(void);
51 public int ch_forw_get(void);
52 public int ch_back_get(void);
53 public void ch_setbufspace(int bufspace);
54 public void ch_flush(void);
55 public int seekable(int f);
56 public void ch_set_eof(void);
57 public void ch_init(int f, int flags);
58 public void ch_close(void);
59 public int ch_getflags(void);
60 public void setfmt(char *s, char **fmtvarptr, int *attrptr, char *default_fmt, int for_printf);
61 public void init_charset(void);
62 public int binary_char(LWCHAR c);
63 public int control_char(LWCHAR c);
64 public char * prchar(LWCHAR c);
65 public char * prutfchar(LWCHAR ch);
66 public int utf_len(int ch);
67 public int is_utf8_well_formed(char *ss, int slen);
68 public void utf_skip_to_lead(char **pp, char *limit);
69 public LWCHAR get_wchar(constant char *p);
70 public void put_wchar(char **pp, LWCHAR ch);
71 public LWCHAR step_char(char **pp, signed int dir, constant char *limit);
72 public int is_composing_char(LWCHAR ch);
73 public int is_ubin_char(LWCHAR ch);
74 public int is_wide_char(LWCHAR ch);
75 public int is_combining_char(LWCHAR ch1, LWCHAR ch2);
76 public void cmd_reset(void);
77 public void clear_cmd(void);
78 public void cmd_putstr(constant char *s);
79 public int len_cmdbuf(void);
80 public void cmd_repaint(constant char *old_cp);
81 public void set_mlist(void *mlist, int cmdflags);
82 public void cmd_addhist(struct mlist *mlist, constant char *cmd, int modified);
83 public void cmd_accept(void);
84 public int cmd_char(int c);
85 public LINENUM cmd_int(long *frac);
86 public char * get_cmdbuf(void);
87 public char * cmd_lastpattern(void);
88 public void init_cmdhist(void);
89 public void save_cmdhist(void);
90 public int in_mca(void);
91 public int norm_search_type(int st);
92 public void dispversion(void);
93 public int getcc(void);
94 public void ungetcc(LWCHAR c);
95 public void ungetcc_back(LWCHAR c);
96 public void ungetsc(char *s);
97 public LWCHAR peekcc(void);
98 public void commands(void);
99 public int cvt_length(int len, int ops);
100 public int * cvt_alloc_chpos(int len);
101 public void cvt_text(char *odst, char *osrc, int *chpos, int *lenp, int ops);
102 public void expand_cmd_tables(void);
103 public void init_cmds(void);
104 public void add_fcmd_table(char *buf, int len);
105 public void add_ecmd_table(char *buf, int len);
106 public int fcmd_decode(char *cmd, char **sp);
107 public int ecmd_decode(char *cmd, char **sp);
108 public char * lgetenv(char *var);
109 public int isnullenv(char *s);
110 public int lesskey(char *filename, int sysvar);
111 public int lesskey_src(char *filename, int sysvar);
112 public int add_hometable(int (*call_lesskey)(char *, int), char *envname, char *def_filename, int sysvar);
113 public int editchar(int c, int flags);
114 public void init_textlist(struct textlist *tlist, char *str);
115 public char * forw_textlist(struct textlist *tlist, char *prev);
116 public char * back_textlist(struct textlist *tlist, char *prev);
117 public void close_altpipe(IFILE ifile);
118 public void check_altpipe_error(void);
119 public int edit(char *filename);
120 public int edit_ifile(IFILE ifile);
121 public int edit_list(char *filelist);
122 public int edit_first(void);
123 public int edit_last(void);
124 public int edit_next(int n);
125 public int edit_prev(int n);
126 public int edit_index(int n);
127 public IFILE save_curr_ifile(void);
128 public void unsave_ifile(IFILE save_ifile);
129 public void reedit_ifile(IFILE save_ifile);
130 public void reopen_curr_ifile(void);
131 public int edit_stdin(void);
132 public void cat_file(void);
133 public void use_logfile(char *filename);
134 public char * shell_unquote(char *str);
135 public char * get_meta_escape(void);
136 public char * shell_quote(char *s);
137 public char * dirfile(char *dirname, char *filename, int must_exist);
138 public char * homefile(char *filename);
139 public char * fexpand(char *s);
140 public char * fcomplete(char *s);
141 public int bin_file(int f);
142 public char * lglob(char *filename);
143 public int is_fake_pathname(char *path);
144 public char * lrealpath(char *path);
145 public char * open_altfile(char *filename, int *pf, void **pfd);
146 public void close_altfile(char *altfilename, char *filename);
147 public int is_dir(char *filename);
148 public char * bad_file(char *filename);
149 public POSITION filesize(int f);
150 public int curr_ifile_changed(void);
151 public char * shell_coption(void);
152 public char * last_component(char *name);
153 public void eof_bell(void);
154 public int eof_displayed(void);
155 public int entire_file_displayed(void);
156 public void squish_check(void);
157 public int overlay_header(void);
158 public void forw(int n, POSITION pos, int force, int only_last, int nblank);
159 public void back(int n, POSITION pos, int force, int only_last);
160 public void forward(int n, int force, int only_last);
161 public void backward(int n, int force, int only_last);
162 public int get_back_scroll(void);
163 public int get_one_screen(void);
164 public void del_ifile(IFILE h);
165 public IFILE next_ifile(IFILE h);
166 public IFILE prev_ifile(IFILE h);
167 public IFILE getoff_ifile(IFILE ifile);
168 public int nifile(void);
169 public IFILE get_ifile(char *filename, IFILE prev);
170 public char * get_filename(IFILE ifile);
171 public char * get_real_filename(IFILE ifile);
172 public int get_index(IFILE ifile);
173 public void store_pos(IFILE ifile, struct scrpos *scrpos);
174 public void get_pos(IFILE ifile, struct scrpos *scrpos);
175 public void set_open(IFILE ifile);
176 public int opened(IFILE ifile);
177 public void hold_ifile(IFILE ifile, int incr);
178 public int held_ifile(IFILE ifile);
179 public void * get_filestate(IFILE ifile);
180 public void set_filestate(IFILE ifile, void *filestate);
181 public void set_altpipe(IFILE ifile, void *p);
182 public void *get_altpipe(IFILE ifile);
183 public void set_altfilename(IFILE ifile, char *altfilename);
184 public char * get_altfilename(IFILE ifile);
185 public void if_dump(void);
186 public POSITION forw_line_seg(POSITION curr_pos, int skipeol, int rscroll, int nochop);
187 public POSITION forw_line(POSITION curr_pos);
188 public POSITION back_line(POSITION curr_pos);
189 public void set_attnpos(POSITION pos);
190 public void jump_forw(void);
191 public void jump_forw_buffered(void);
192 public void jump_back(LINENUM linenum);
193 public void repaint(void);
194 public void jump_percent(int percent, long fraction);
195 public void jump_line_loc(POSITION pos, int sline);
196 public void jump_loc(POSITION pos, int sline);
197 public void init_line(void);
198 public int is_ascii_char(LWCHAR ch);
199 public POSITION line_position(void);
200 public void prewind(void);
201 public void plinestart(POSITION pos);
202 public int line_pfx_width(void);
203 public void pshift_all(void);
204 public int pwidth(LWCHAR ch, int a, LWCHAR prev_ch, int prev_a);
205 public void savec(void);
206 public void loadc(void);
207 public int is_ansi_end(LWCHAR ch);
208 public int is_ansi_middle(LWCHAR ch);
209 public void skip_ansi(struct ansi_state *pansi, char **pp, constant char *limit);
210 public struct ansi_state * ansi_start(LWCHAR ch);
211 public int ansi_step(struct ansi_state *pansi, LWCHAR ch);
212 public void ansi_done(struct ansi_state *pansi);
213 public int pappend(int c, POSITION pos);
214 public int pflushmbc(void);
215 public void pdone(int endline, int chopped, int forw);
216 public void set_attr_line(int a);
217 public void set_status_col(char c, int attr);
218 public int gline(int i, int *ap);
219 public void null_line(void);
220 public POSITION forw_raw_line(POSITION curr_pos, char **linep, int *line_lenp);
221 public POSITION back_raw_line(POSITION curr_pos, char **linep, int *line_lenp);
222 public int skip_columns(int cols, char **linep, int *line_lenp);
223 public void load_line(constant char *str);
224 public int rrshift(void);
225 public int set_color_map(int attr, char *colorstr);
226 public char * get_color_map(int attr);
227 public void clr_linenum(void);
228 public void add_lnum(LINENUM linenum, POSITION pos);
229 public LINENUM find_linenum(POSITION pos);
230 public POSITION find_pos(LINENUM linenum);
231 public LINENUM currline(int where);
232 public void scan_eof(void);
233 public LINENUM vlinenum(LINENUM linenum);
234 public void lsystem(char *cmd, char *donemsg);
235 public int pipe_mark(int c, char *cmd);
236 public int pipe_data(char *cmd, POSITION spos, POSITION epos);
237 public void init_mark(void);
238 public int badmark(LWCHAR c);
239 public void setmark(LWCHAR c, int where);
240 public void clrmark(LWCHAR c);
241 public void lastmark(void);
242 public void gomark(LWCHAR c);
243 public POSITION markpos(LWCHAR c);
244 public char posmark(POSITION pos);
245 public void unmark(IFILE ifile);
246 public void mark_check_ifile(IFILE ifile);
247 public void save_marks(FILE *fout, char *hdr);
248 public void restore_mark(char *line);
249 public void opt_o(int type, char *s);
250 public void opt__O(int type, char *s);
251 public void opt_j(int type, char *s);
252 public void calc_jump_sline(void);
253 public void opt_shift(int type, char *s);
254 public void calc_shift_count(void);
255 public void opt_k(int type, char *s);
256 public void opt_ks(int type, char *s);
257 public void opt_t(int type, char *s);
258 public void opt__T(int type, char *s);
259 public void opt_p(int type, char *s);
260 public void opt__P(int type, char *s);
261 public void opt_b(int type, char *s);
262 public void opt_i(int type, char *s);
263 public void opt__V(int type, char *s);
264 public void opt_D(int type, char *s);
265 public void set_tabs(char *s, int len);
266 public void opt_x(int type, char *s);
267 public void opt_quote(int type, char *s);
268 public void opt_rscroll(int type, char *s);
269 public void opt_query(int type, char *s);
270 public void opt_mousecap(int type, char *s);
271 public void opt_wheel_lines(int type, char *s);
272 public void opt_linenum_width(int type, char *s);
273 public void opt_status_col_width(int type, char *s);
274 public void opt_filesize(int type, char *s);
275 public void opt_intr(int type, char *s);
276 public void opt_header(int type, char *s);
277 public void opt_search_type(int type, char *s);
278 public void opt_ttyin_name(int type, char *s);
279 public int chop_line(void);
280 public int get_swindow(void);
281 public char * propt(int c);
282 public void scan_option(char *s);
283 public void toggle_option(struct loption *o, int lower, char *s, int how_toggle);
284 public int opt_has_param(struct loption *o);
285 public char * opt_prompt(struct loption *o);
286 public char * opt_toggle_disallowed(int c);
287 public int isoptpending(void);
288 public void nopendopt(void);
289 public int getnum(char **sp, char *printopt, int *errp);
290 public long getfraction(char **sp, char *printopt, int *errp);
291 public int get_quit_at_eof(void);
292 public void init_option(void);
293 public struct loption * findopt(int c);
294 public struct loption * findopt_name(char **p_optname, char **p_oname, int *p_err);
295 public void init_poll(void);
296 public int supports_ctrl_x(void);
297 public int iread(int fd, unsigned char *buf, unsigned int len);
298 public void intread(void);
299 public time_type get_time(void);
300 public char * errno_message(char *filename);
301 public char * signal_message(int sig);
302 public uintmax muldiv(uintmax val, uintmax num, uintmax den);
303 public int percentage(POSITION num, POSITION den);
304 public POSITION percent_pos(POSITION pos, int percent, long fraction);
305 public int os9_signal(int type, RETSIGTYPE (*handler)());
306 public void sleep_ms(int ms);
307 public void put_line(void);
308 public void flush(void);
309 public void set_output(int fd);
310 public int putchr(int c);
311 public void clear_bot_if_needed(void);
312 public void putstr(constant char *s);
313 public int less_printf(char *fmt, PARG *parg);
314 public void get_return(void);
315 public void error(char *fmt, PARG *parg);
316 public void ierror(char *fmt, PARG *parg);
317 public void ixerror(char *fmt, PARG *parg);
318 public int query(char *fmt, PARG *parg);
319 public int compile_pattern(char *pattern, int search_type, int show_error, PATTERN_TYPE *comp_pattern);
320 public void uncompile_pattern(PATTERN_TYPE *pattern);
321 public int valid_pattern(char *pattern);
322 public int is_null_pattern(PATTERN_TYPE pattern);
323 public int match_pattern(PATTERN_TYPE pattern, char *tpattern, char *line, int line_len, char **sp, char **ep, int nsp, int notbol, int search_type);
324 public char * pattern_lib_name(void);
325 public POSITION position(int sindex);
326 public void add_forw_pos(POSITION pos);
327 public void add_back_pos(POSITION pos);
328 public void pos_clear(void);
329 public void pos_init(void);
330 public int onscreen(POSITION pos);
331 public int empty_screen(void);
332 public int empty_lines(int s, int e);
333 public void get_scrpos(struct scrpos *scrpos, int where);
334 public int sindex_from_sline(int sline);
335 public void init_prompt(void);
336 public char * pr_expand(constant char *proto);
337 public char * eq_message(void);
338 public char * pr_string(void);
339 public char * wait_message(void);
340 public void init_search(void);
341 public void repaint_hilite(int on);
342 public void clear_attn(void);
343 public void undo_search(int clear);
344 public void clr_hlist(struct hilite_tree *anchor);
345 public void clr_hilite(void);
346 public void clr_filter(void);
347 public int is_filtered(POSITION pos);
348 public POSITION next_unfiltered(POSITION pos);
349 public POSITION prev_unfiltered(POSITION pos);
350 public int is_hilited_attr(POSITION pos, POSITION epos, int nohide, int *p_matches);
351 public void chg_hilite(void);
352 public void chg_caseless(void);
353 public int search(int search_type, char *pattern, int n);
354 public void prep_hilite(POSITION spos, POSITION epos, int maxlines);
355 public void set_filter_pattern(char *pattern, int search_type);
356 public int is_filtering(void);
357 public RETSIGTYPE winch(int type);
358 public void init_signals(int on);
359 public void psignals(void);
360 public void cleantags(void);
361 public int gettagtype(void);
362 public void findtag(char *tag);
363 public POSITION tagsearch(void);
364 public char * nexttag(int n);
365 public char * prevtag(int n);
366 public int ntags(void);
367 public int curr_tag(void);
368 public int edit_tagfile(void);
369 public int open_tty(void);
370 public void open_getchr(void);
371 public void close_getchr(void);
372 public int pclose(FILE *f);
373 public int default_wheel_lines(void);
374 public int getchr(void);
375 public void xbuf_init(struct xbuffer *xbuf);
376 public void xbuf_deinit(struct xbuffer *xbuf);
377 public void xbuf_reset(struct xbuffer *xbuf);
378 public void xbuf_add_byte(struct xbuffer *xbuf, unsigned char b);
379 public void xbuf_add_data(struct xbuffer *xbuf, unsigned char *data, int len);
380 public int xbuf_pop(struct xbuffer *buf);
381 public void xbuf_set(struct xbuffer *dst, struct xbuffer *src);
382 public char * xbuf_char_data(struct xbuffer *xbuf);
383 public int help_ckd_add(void *r, uintmax a, uintmax b, int rsize, int rsigned);
384 public int help_ckd_mul(void *r, uintmax a, uintmax b, int rsize, int rsigned);
385