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