xref: /openbsd/usr.bin/vi/include/com_extern.h (revision 3d8817e4)
1 /*	$OpenBSD: com_extern.h,v 1.5 2002/02/17 19:42:34 millert Exp $	*/
2 
3 #ifndef HAVE_BSEARCH
4 void	*bsearch(const void *, const void *, size_t,
5    size_t, int (*)(const void *, const void *));
6 #endif
7 #ifndef HAVE_SETENV
8 int setenv(const char *, const char *, int);
9 #endif
10 #ifndef HAVE_UNSETENV
11 void unsetenv(const char *);
12 #endif
13 #ifndef HAVE_GETHOSTNAME
14 int gethostname(char *, int);
15 #endif
16 #ifndef HAVE_GETOPT
17 int getopt(int, char * const *, const char *);
18 #endif
19 #ifndef HAVE_MEMCHR
20 void *memchr(const void *, int, size_t);
21 #endif
22 #ifndef HAVE_MEMCPY
23 void *memcpy(void *, const void *, size_t);
24 #endif
25 #ifndef HAVE_MEMMOVE
26 void *memmove(void *, const void *, size_t);
27 #endif
28 #ifndef HAVE_MEMSET
29 void *memset(void *, int, size_t);
30 #endif
31 #ifndef HAVE_MKSTEMP
32 int mkstemp(char *);
33 #endif
34 #ifndef HAVE_MMAP
35 char *mmap(char *, size_t, int, int, int, off_t);
36 #endif
37 #ifndef HAVE_MMAP
38 int munmap(char *, size_t);
39 #endif
40 #ifndef HAVE_SNPRINTF
41 int snprintf(char *, size_t, const char *, ...);
42 #endif
43 #ifndef HAVE_STRDUP
44 char *strdup(const char *);
45 #endif
46 #ifndef HAVE_STRERROR
47 char *strerror(int);
48 #endif
49 #ifndef HAVE_STRPBRK
50 char *strpbrk(const char *, const char *);
51 #endif
52 #ifndef HAVE_STRSEP
53 char *strsep(char **, const char *);
54 #endif
55 #ifndef HAVE_STRTOL
56 long strtol(const char *, char **, int);
57 #endif
58 #ifndef HAVE_STRTOUL
59 unsigned long strtoul(const char *, char **, int);
60 #endif
61 #ifndef HAVE_VSNPRINTF
62 int vsnprintf(char *, size_t, const char *, ...);
63 #endif
64 SCR *api_fscreen(int, char *);
65 int api_aline(SCR *, recno_t, char *, size_t);
66 int api_dline(SCR *, recno_t);
67 int api_gline(SCR *, recno_t, char **, size_t *);
68 int api_iline(SCR *, recno_t, char *, size_t);
69 int api_lline(SCR *, recno_t *);
70 int api_sline(SCR *, recno_t, char *, size_t);
71 int api_getmark(SCR *, int, MARK *);
72 int api_setmark(SCR *, int, MARK *);
73 int api_nextmark(SCR *, int, char *);
74 int api_getcursor(SCR *, MARK *);
75 int api_setcursor(SCR *, MARK *);
76 void api_emessage(SCR *, char *);
77 void api_imessage(SCR *, char *);
78 int api_edit(SCR *, char *, SCR **, int);
79 int api_escreen(SCR *);
80 int api_swscreen(SCR *, SCR *);
81 int api_map(SCR *, char *, char *, size_t);
82 int api_unmap(SCR *, char *);
83 int api_opts_get(SCR *, char *, char **, int *);
84 int api_opts_set(SCR *, char *, char *, u_long, int);
85 int api_run_str(SCR *, char *);
86 int cut(SCR *, CHAR_T *, MARK *, MARK *, int);
87 int cut_line(SCR *, recno_t, size_t, size_t, CB *);
88 void cut_close(GS *);
89 TEXT *text_init(SCR *, const char *, size_t, size_t);
90 void text_lfree(TEXTH *);
91 void text_free(TEXT *);
92 int del(SCR *, MARK *, MARK *, int);
93 FREF *file_add(SCR *, CHAR_T *);
94 int file_init(SCR *, FREF *, char *, int);
95 int file_end(SCR *, EXF *, int);
96 int file_write(SCR *, MARK *, MARK *, char *, int);
97 int file_m1(SCR *, int, int);
98 int file_m2(SCR *, int);
99 int file_m3(SCR *, int);
100 int file_aw(SCR *, int);
101 void set_alt_name(SCR *, char *);
102 lockr_t file_lock(SCR *, char *, int *, int, int);
103 int v_key_init(SCR *);
104 void v_key_ilookup(SCR *);
105 size_t v_key_len(SCR *, ARG_CHAR_T);
106 CHAR_T *v_key_name(SCR *, ARG_CHAR_T);
107 int v_key_val(SCR *, ARG_CHAR_T);
108 int v_event_push(SCR *, EVENT *, CHAR_T *, size_t, u_int);
109 int v_event_get(SCR *, EVENT *, int, u_int32_t);
110 void v_event_err(SCR *, EVENT *);
111 int v_event_flush(SCR *, u_int);
112 int db_eget(SCR *, recno_t, char **, size_t *, int *);
113 int db_get(SCR *, recno_t, u_int32_t, char **, size_t *);
114 int db_delete(SCR *, recno_t);
115 int db_append(SCR *, int, recno_t, char *, size_t);
116 int db_insert(SCR *, recno_t, char *, size_t);
117 int db_set(SCR *, recno_t, char *, size_t);
118 int db_exist(SCR *, recno_t);
119 int db_last(SCR *, recno_t *);
120 void db_err(SCR *, recno_t);
121 int log_init(SCR *, EXF *);
122 int log_end(SCR *, EXF *);
123 int log_cursor(SCR *);
124 int log_line(SCR *, recno_t, u_int);
125 int log_mark(SCR *, LMARK *);
126 int log_backward(SCR *, MARK *);
127 int log_setline(SCR *);
128 int log_forward(SCR *, MARK *);
129 int editor(GS *, int, char *[]);
130 void v_end(GS *);
131 int mark_init(SCR *, EXF *);
132 int mark_end(SCR *, EXF *);
133 int mark_get(SCR *, ARG_CHAR_T, MARK *, mtype_t);
134 int mark_set(SCR *, ARG_CHAR_T, MARK *, int);
135 int mark_insdel(SCR *, lnop_t, recno_t);
136 void msgq(SCR *, mtype_t, const char *, ...);
137 void msgq_str(SCR *, mtype_t, char *, char *);
138 void mod_rpt(SCR *);
139 void msgq_status(SCR *, recno_t, u_int);
140 int msg_open(SCR *, char *);
141 void msg_close(GS *);
142 const char *msg_cmsg(SCR *, cmsg_t, size_t *);
143 const char *msg_cat(SCR *, const char *, size_t *);
144 char *msg_print(SCR *, const char *, int *);
145 int opts_init(SCR *, int *);
146 int opts_set(SCR *, ARGS *[], char *);
147 int o_set(SCR *, int, u_int, char *, u_long);
148 int opts_empty(SCR *, int, int);
149 void opts_dump(SCR *, enum optdisp);
150 int opts_save(SCR *, FILE *);
151 OPTLIST const *opts_search(char *);
152 void opts_nomatch(SCR *, char *);
153 int opts_copy(SCR *, SCR *);
154 void opts_free(SCR *);
155 int f_altwerase(SCR *, OPTION *, char *, u_long *);
156 int f_columns(SCR *, OPTION *, char *, u_long *);
157 int f_lines(SCR *, OPTION *, char *, u_long *);
158 int f_lisp(SCR *, OPTION *, char *, u_long *);
159 int f_msgcat(SCR *, OPTION *, char *, u_long *);
160 int f_paragraph(SCR *, OPTION *, char *, u_long *);
161 int f_print(SCR *, OPTION *, char *, u_long *);
162 int f_readonly(SCR *, OPTION *, char *, u_long *);
163 int f_recompile(SCR *, OPTION *, char *, u_long *);
164 int f_reformat(SCR *, OPTION *, char *, u_long *);
165 int f_section(SCR *, OPTION *, char *, u_long *);
166 int f_ttywerase(SCR *, OPTION *, char *, u_long *);
167 int f_w300(SCR *, OPTION *, char *, u_long *);
168 int f_w1200(SCR *, OPTION *, char *, u_long *);
169 int f_w9600(SCR *, OPTION *, char *, u_long *);
170 int f_window(SCR *, OPTION *, char *, u_long *);
171 int put(SCR *, CB *, CHAR_T *, MARK *, MARK *, int);
172 int rcv_tmp(SCR *, EXF *, char *);
173 int rcv_init(SCR *);
174 int rcv_sync(SCR *, u_int);
175 int rcv_list(SCR *);
176 int rcv_read(SCR *, FREF *);
177 int screen_init(GS *, SCR *, SCR **);
178 int screen_end(SCR *);
179 SCR *screen_next(SCR *);
180 int f_search(SCR *, MARK *, MARK *, char *, size_t, char **, u_int);
181 int b_search(SCR *, MARK *, MARK *, char *, size_t, char **, u_int);
182 void search_busy(SCR *, busy_t);
183 int seq_set(SCR *, CHAR_T *,
184    size_t, CHAR_T *, size_t, CHAR_T *, size_t, seq_t, int);
185 int seq_delete(SCR *, CHAR_T *, size_t, seq_t);
186 int seq_mdel(SEQ *);
187 SEQ *seq_find
188 (SCR *, SEQ **, EVENT *, CHAR_T *, size_t, seq_t, int *);
189 void seq_close(GS *);
190 int seq_dump(SCR *, seq_t, int);
191 int seq_save(SCR *, FILE *, char *, seq_t);
192 int e_memcmp(CHAR_T *, EVENT *, size_t);
193 void *binc(SCR *, void *, size_t *, size_t);
194 int nonblank(SCR *, recno_t, size_t *);
195 char *tail(char *);
196 CHAR_T *v_strdup(SCR *, const CHAR_T *, size_t);
197 enum nresult nget_uslong(u_long *, const char *, char **, int);
198 enum nresult nget_slong(long *, const char *, char **, int);
199 void TRACE(SCR *, const char *, ...);
200