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