xref: /openbsd-src/usr.bin/ftp/extern.h (revision ce7279d89b71439c96c854f612f4ac93a461fdc4)
1 /*	$OpenBSD: extern.h,v 1.54 2024/05/21 05:00:48 jsg Exp $	*/
2 /*	$NetBSD: extern.h,v 1.17 1997/08/18 10:20:19 lukem Exp $	*/
3 
4 /*
5  * Copyright (C) 1997 and 1998 WIDE Project.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the project nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  */
32 
33 /*-
34  * Copyright (c) 1994 The Regents of the University of California.
35  * All rights reserved.
36  *
37  * Redistribution and use in source and binary forms, with or without
38  * modification, are permitted provided that the following conditions
39  * are met:
40  * 1. Redistributions of source code must retain the above copyright
41  *    notice, this list of conditions and the following disclaimer.
42  * 2. Redistributions in binary form must reproduce the above copyright
43  *    notice, this list of conditions and the following disclaimer in the
44  *    documentation and/or other materials provided with the distribution.
45  * 3. Neither the name of the University nor the names of its contributors
46  *    may be used to endorse or promote products derived from this software
47  *    without specific prior written permission.
48  *
49  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59  * SUCH DAMAGE.
60  *
61  *	@(#)extern.h	8.3 (Berkeley) 10/9/94
62  */
63 
64 #include <sys/types.h>
65 #include <sys/socket.h>
66 
67 void	abort_remote(FILE *);
68 void	abortpt(int);
69 void	abortrecv(int);
70 void	alarmtimer(int);
71 int	another(int *, char ***, const char *);
72 int	auto_fetch(int, char **, char *);
73 void	cdup(int, char **);
74 void	cmdabort(int);
75 void	cmdscanner(int);
76 int	command(const char *, ...);
77 int	confirm(const char *, const char *);
78 FILE   *dataconn(const char *);
79 int	foregroundproc(void);
80 int	fileindir(const char *, const char *);
81 struct cmd *getcmd(const char *);
82 int	getreply(int);
83 int	globulize(char **);
84 char   *gunique(const char *);
85 void	help(int, char **);
86 char   *hookup(char *, char *);
87 int	initconn(void);
88 void	intr(void);
89 int	isurl(const char *);
90 int	ftp_login(const char *, char *, char *);
91 void	lostpeer(void);
92 void	makeargv(void);
93 void	progressmeter(int, const char *);
94 char   *prompt(void);
95 void	proxtrans(const char *, const char *, const char *);
96 void	psabort(int);
97 void	psummary(int);
98 void	pswitch(int);
99 void	ptransfer(int);
100 void	recvrequest(const char *, const char *, const char *,
101 	    const char *, int, int);
102 char   *remglob(char **, int, char **);
103 off_t	remotesize(const char *, int);
104 time_t	remotemodtime(const char *, int);
105 void	reset(int, char **);
106 void	rmthelp(int, char **);
107 void	sethash(int, char **);
108 void	setpeer(int, char **);
109 void	setttywidth(int);
110 char   *slurpstring(void);
111 int	timed_connect(int s, const struct sockaddr *, socklen_t, int);
112 
113 __dead void	usage(void);
114 
115 void	cookie_get(const char *, const char *, int, char **);
116 void	cookie_load(void);
117 
118 #ifndef SMALL
119 void	abortsend(int);
120 unsigned char complete(EditLine *, int);
121 void	controlediting(void);
122 void	domacro(int, char **);
123 void	list_vertical(StringList *);
124 void	parse_list(char **, char *);
125 char   *remglob2(char **, int, char **, FILE **ftemp, char *type);
126 int	ruserpass(const char *, char **, char **, char **);
127 void	sendrequest(const char *, const char *, const char *, int);
128 ssize_t http_time(time_t, char *, size_t);
129 #endif /* !SMALL */
130 
131 extern jmp_buf	abortprox;
132 extern int	abrtflag;
133 extern FILE    *cout;
134 extern int	data;
135 extern char    *home;
136 extern jmp_buf	jabort;
137 extern int	family;
138 extern int	proxy;
139 extern char	reply_string[];
140 extern off_t	restart_point;
141 extern int	keep_alive_timeout;
142 extern int	connect_timeout;
143 extern int	pipeout;
144 extern char	*action;
145 
146 #ifndef SMALL
147 extern int	NCMDS;
148 extern int	server_timestamps;
149 #endif /* !SMALL */
150 
151 extern char *__progname;		/* from crt0.o */
152 
153