xref: /freebsd/contrib/less/funcs.h (revision 5944f899a2519c6321bac3c17cc076418643a088)
1 	public char * save (constant char *s);
2 	public VOID_POINTER ecalloc (int count, unsigned int size);
3 	public char * skipsp (char *s);
4 	public char * skipnsp(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 (void);
12 	public void deinit (void);
13 	public void home (void);
14 	public void add_line (void);
15 	public void remove_top (int n);
16 	public void win32_scroll_up (int n);
17 	public void lower_left (void);
18 	public void line_left (void);
19 	public void check_winch (void);
20 	public void goto_line (int slinenum);
21 	public void vbell (void);
22 	public void bell (void);
23 	public void clear (void);
24 	public void clear_eol (void);
25 	public void clear_bot (void);
26 	public void at_enter (int attr);
27 	public void at_exit (void);
28 	public void at_switch (int attr);
29 	public int is_at_equiv (int attr1, int attr2);
30 	public int apply_at_specials (int attr);
31 	public void backspace (void);
32 	public void putbs (void);
33 	public char WIN32getch (int tty);
34 	public void WIN32setcolors (int fg, int bg);
35 	public void WIN32textout (char *text, int len);
36 	public void match_brac(int obrac, int cbrac, int forwdir, int n);
37 	public void ch_ungetchar (int c);
38 	public void end_logfile (void);
39 	public void sync_logfile (void);
40 	public int ch_seek (POSITION pos);
41 	public int ch_end_seek (void);
42 	public int ch_end_buffer_seek (void);
43 	public int ch_beg_seek (void);
44 	public POSITION ch_length (void);
45 	public POSITION ch_tell (void);
46 	public int ch_forw_get (void);
47 	public int ch_back_get (void);
48 	public void ch_setbufspace (int bufspace);
49 	public void ch_flush (void);
50 	public int seekable (int f);
51 	public void ch_set_eof (void);
52 	public void ch_init (int f, int flags);
53 	public void ch_close (void);
54 	public int ch_getflags (void);
55 struct filestate;
56 	public void ch_dump (struct filestate *fs);
57 	public void init_charset (void);
58 	public int binary_char (LWCHAR c);
59 	public int control_char (LWCHAR c);
60 	public char * prchar (LWCHAR c);
61 	public char * prutfchar (LWCHAR ch);
62 	public int utf_len (char ch);
63 	public int is_utf8_well_formed (unsigned char *s, int slen);
64 	public int utf_bin_count (unsigned char *data, int len);
65 	public LWCHAR get_wchar (constant char *p);
66 	public void put_wchar (char **pp, LWCHAR ch);
67 	public LWCHAR step_char (constant char **pp, signed int dir, constant char *limit);
68 	public int is_composing_char (LWCHAR ch);
69 	public int is_ubin_char (LWCHAR ch);
70 	public int is_wide_char (LWCHAR ch);
71 	public int is_combining_char (LWCHAR ch1, LWCHAR ch2);
72 	public void cmd_reset (void);
73 	public void clear_cmd (void);
74 	public void cmd_putstr (constant char *s);
75 	public int len_cmdbuf (void);
76 	public void set_mlist (constant void *mlist, int cmdflags);
77 struct mlist;
78 	public void cmd_addhist (struct mlist *constant mlist, char *cmd, int modified);
79 	public void cmd_accept (void);
80 	public int cmd_char (int c);
81 	public LINENUM cmd_int (long *frac);
82 	public char * get_cmdbuf (void);
83 	public char * cmd_lastpattern (void);
84 	public void init_cmdhist (void);
85 	public void save_cmdhist (void);
86 	public int in_mca (void);
87 	public void dispversion (void);
88 	public int getcc (void);
89 	public void ungetcc (int c);
90 	public void ungetsc (char *s);
91 	public void commands (void);
92 	public int cvt_length (int len, int ops);
93 	public int * cvt_alloc_chpos (int len);
94 	public void cvt_text (char *odst, char *osrc, int *chpos, int *lenp, int ops);
95 	public void init_cmds (void);
96 	public void add_fcmd_table (char *buf, int len);
97 	public void add_ecmd_table (char *buf, int len);
98 	public int fcmd_decode (char *cmd, char **sp);
99 	public int ecmd_decode (char *cmd, char **sp);
100 	public char * lgetenv (char *var);
101 	public int lesskey (char *filename, int sysvar);
102 	public void add_hometable (char *envname, char *def_filename, int sysvar);
103 	public int editchar (int c, int flags);
104 	public void init_textlist (struct textlist *tlist, char *str);
105 	public char * forw_textlist (struct textlist *tlist, char *prev);
106 	public char * back_textlist (struct textlist *tlist, char *prev);
107 	public int edit (char *filename);
108 	public int edit_ifile (IFILE ifile);
109 	public int edit_list (char *filelist);
110 	public int edit_first (void);
111 	public int edit_last (void);
112 	public int edit_next (int n);
113 	public int edit_prev (int n);
114 	public int edit_index (int n);
115 	public IFILE save_curr_ifile (void);
116 	public void unsave_ifile (IFILE save_ifile);
117 	public void reedit_ifile (IFILE save_ifiler);
118 	public void reopen_curr_ifile (void);
119 	public int edit_stdin (void);
120 	public void cat_file (void);
121 	public void use_logfile (char *filename);
122 	public char * shell_unquote (char *str);
123 	public char * get_meta_escape (void);
124 	public char * shell_quote (char *s);
125 	public char * homefile (char *filename);
126 	public char * fexpand (char *s);
127 	public char * fcomplete (char *s);
128 	public int bin_file (int f);
129 	public char * lglob (char *filename);
130 	public char * open_altfile (char *filename, int *pf, void **pfd);
131 	public void close_altfile (char *altfilename, char *filename, void *pipefd);
132 	public int is_dir (char *filename);
133 	public char * bad_file (char *filename);
134 	public POSITION filesize (int f);
135 	public char * shell_coption (void);
136 	public char * last_component (char *name);
137 	public int eof_displayed (void);
138 	public int entire_file_displayed (void);
139 	public void squish_check (void);
140 	public void forw (int n, POSITION pos, int force, int only_last, int nblank);
141 	public void back (int n, POSITION pos, int force, int only_last);
142 	public void forward (int n, int force, int only_last);
143 	public void backward (int n, int force, int only_last);
144 	public int get_back_scroll (void);
145 	public void del_ifile (IFILE h);
146 	public IFILE next_ifile (IFILE h);
147 	public IFILE prev_ifile (IFILE h);
148 	public IFILE getoff_ifile (IFILE ifile);
149 	public int nifile (void);
150 	public IFILE get_ifile (char *filename, IFILE prev);
151 	public char * get_filename (IFILE ifile);
152 	public int get_index (IFILE ifile);
153 	public void store_pos (IFILE ifile, struct scrpos *scrpos);
154 	public void get_pos (IFILE ifile, struct scrpos *scrpos);
155 	public void set_open (IFILE ifile);
156 	public int opened (IFILE ifile);
157 	public void hold_ifile (IFILE ifile, int incr);
158 	public int held_ifile (IFILE ifile);
159 	public void * get_filestate (IFILE ifile);
160 	public void set_filestate (IFILE ifile, void *filestate);
161 	public void if_dump (void);
162 	public POSITION forw_line (POSITION curr_pos);
163 	public POSITION back_line (POSITION curr_pos);
164 	public void set_attnpos (POSITION pos);
165 	public void jump_forw (void);
166 	public void jump_forw_buffered (void);
167 	public void jump_back (LINENUM linenum);
168 	public void repaint (void);
169 	public void jump_percent (int percent, long fraction);
170 	public void jump_line_loc (POSITION pos, int sline);
171 	public void jump_loc (POSITION pos, int sline);
172 	public void init_line (void);
173 	public int is_ascii_char (LWCHAR ch);
174 	public void prewind (void);
175 	public void plinenum (POSITION pos);
176 	public void pshift_all (void);
177 	public int is_ansi_end (LWCHAR ch);
178 	public int is_ansi_middle (LWCHAR ch);
179 	public int pappend (unsigned char c, POSITION pos);
180 	public int pflushmbc (void);
181 	public void pdone (int endline, int forw);
182 	public void set_status_col (char c);
183 	public int gline (int i, int *ap);
184 	public void null_line (void);
185 	public POSITION forw_raw_line (POSITION curr_pos, char **linep, int *line_lenp);
186 	public POSITION back_raw_line (POSITION curr_pos, char **linep, int *line_lenp);
187 	public void clr_linenum (void);
188 	public void add_lnum (LINENUM linenum, POSITION pos);
189 	public LINENUM find_linenum (POSITION pos);
190 	public POSITION find_pos (LINENUM linenum);
191 	public LINENUM currline (int where);
192 	public void lsystem (char *cmd, char *donemsg);
193 	public int pipe_mark (int c, char *cmd);
194 	public int pipe_data (char *cmd, POSITION spos, POSITION epos);
195 	public void init_mark (void);
196 	public int badmark (int c);
197 	public void setmark (int c);
198 	public void lastmark (void);
199 	public void gomark (int c);
200 	public POSITION markpos (int c);
201 	public void unmark (IFILE ifile);
202 	public void opt_o (int type, char *s);
203 	public void opt__O (int type, char *s);
204 	public void opt_j (int type, char *s);
205 	public void calc_jump_sline (void);
206 	public void opt_shift (int type, char *s);
207 	public void calc_shift_count (void);
208 	public void opt_k (int type, char *s);
209 	public void opt_t (int type, char *s);
210 	public void opt__T (int type, char *s);
211 	public void opt_p (int type, char *s);
212 	public void opt__P (int type, char *s);
213 	public void opt_b (int type, char *s);
214 	public void opt_i (int type, char *s);
215 	public void opt__V (int type, char *s);
216 	public void opt_D (int type, char *s);
217 	public void opt_x (int type, char *s);
218 	public void opt_quote (int type, char *s);
219 	public void opt_query (int type, char *s);
220 	public int get_swindow (void);
221 	public char * propt (int c);
222 	public void scan_option (char *s);
223 struct loption;
224 	public void toggle_option (struct loption *o, int lower, char *s, int how_toggle);
225 	public int opt_has_param (struct loption *o);
226 	public char * opt_prompt (struct loption *o);
227 	public int isoptpending (void);
228 	public void nopendopt (void);
229 	public int getnum (char **sp, char *printopt, int *errp);
230 	public long getfraction (char **sp, char *printopt, int *errp);
231 	public int get_quit_at_eof (void);
232 	public void init_option (void);
233 	public struct loption * findopt (int c);
234 	public struct loption * findopt_name (char **p_optname, char **p_oname, int *p_err);
235 	public int iread (int fd, char *buf, unsigned int len);
236 	public void intread (void);
237 	public time_type get_time (void);
238 	public char * errno_message (char *filename);
239 	public int percentage (POSITION num, POSITION den);
240 	public POSITION percent_pos (POSITION pos, int percent, long fraction);
241 	public int  os9_signal (int type, RETSIGTYPE (*handler)());
242 	public void put_line (void);
243 	public void flush (void);
244 	public int putchr (int c);
245 	public void putstr (constant char *s);
246 	public void get_return (void);
247 	public void error (char *fmt, PARG *parg);
248 	public void ierror (char *fmt, PARG *parg);
249 	public int query (char *fmt, PARG *parg);
250 	public int compile_pattern (char *pattern, int search_type, void **comp_pattern);
251 	public void uncompile_pattern (void **pattern);
252 	public int valid_pattern (char *pattern);
253 	public int is_null_pattern (void *pattern);
254 	public int match_pattern (void *pattern, char *tpattern, char *line, int line_len, char **sp, char **ep, int notbol, int search_type);
255 	public POSITION position (int where);
256 	public void add_forw_pos (POSITION pos);
257 	public void add_back_pos (POSITION pos);
258 	public void pos_clear (void);
259 	public void pos_init (void);
260 	public int onscreen (POSITION pos);
261 	public int empty_screen (void);
262 	public int empty_lines (int s, int e);
263 	public void get_scrpos (struct scrpos *scrpos);
264 	public int adjsline (int sline);
265 	public void init_prompt (void);
266 	public char * pr_expand (constant char *proto, int maxwidth);
267 	public char * eq_message (void);
268 	public char * pr_string (void);
269 	public char * wait_message (void);
270 	public void init_search (void);
271 	public void repaint_hilite (int on);
272 	public void clear_attn (void);
273 	public void undo_search (void);
274 struct hilite_tree;
275 	public void clr_hlist (struct hilite_tree *anchor);
276 	public void clr_hilite (void);
277 	public void clr_filter (void);
278 	public int is_filtered (POSITION pos);
279 	public POSITION next_unfiltered (POSITION pos);
280 	public POSITION prev_unfiltered (POSITION pos);
281 	public int is_hilited (POSITION pos, POSITION epos, int nohide, int *p_matches);
282 	public void chg_caseless (void);
283 	public void chg_hilite (void);
284 	public int search (int search_type, char *pattern, int n);
285 	public void prep_hilite (POSITION spos, POSITION epos, int maxlines);
286 	public void set_filter_pattern (char *pattern, int search_type);
287 	public int is_filtering (void);
288 	public RETSIGTYPE winch (int type);
289 	public void init_signals (int on);
290 	public void psignals (void);
291 	public void cleantags (void);
292 	public int gettagtype (void);
293 	public void findtag (char *tag);
294 	public POSITION tagsearch (void);
295 	public char * nexttag (int n);
296 	public char * prevtag (int n);
297 	public int ntags (void);
298 	public int curr_tag (void);
299 	public int edit_tagfile (void);
300 	public void open_getchr (void);
301 	public void close_getchr (void);
302 	public int getchr (void);
303